Lines Matching +full:deep +full:- +full:sleep
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2 /* Copyright(c) 2018-2019 Realtek Corporation
22 clear_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags); in rtw_ips_pwr_up()
29 set_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags); in rtw_enter_ips()
43 struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; in rtw_restore_port_cfg_iter()
73 request = rtw_read8(rtwdev, rtwdev->hci.rpwm_addr); in rtw_power_mode_change()
74 confirm = rtw_read8(rtwdev, rtwdev->hci.cpwm_addr); in rtw_power_mode_change()
86 rtw_write8(rtwdev, rtwdev->hci.rpwm_addr, request); in rtw_power_mode_change()
92 rtwdev->hci.cpwm_addr); in rtw_power_mode_change()
95 * The reason could be that hardware is locked at Deep sleep, in rtw_power_mode_change()
101 WARN(1, "firmware failed to ack driver for %s Deep Power mode\n", in rtw_power_mode_change()
134 return -EBUSY; in __rtw_fw_leave_lps_check_reg()
139 if (wait_for_completion_timeout(&rtwdev->lps_leave_check, in __rtw_fw_leave_lps_check_c2h()
142 return -EBUSY; in __rtw_fw_leave_lps_check_c2h()
150 if (test_bit(RTW_FLAG_WOWLAN, rtwdev->flags)) in rtw_fw_leave_lps_check()
151 fw = &rtwdev->wow_fw; in rtw_fw_leave_lps_check()
153 fw = &rtwdev->fw; in rtw_fw_leave_lps_check()
170 if (test_bit(RTW_FLAG_WOWLAN, rtwdev->flags)) in rtw_fw_leave_lps_check_prepare()
171 fw = &rtwdev->wow_fw; in rtw_fw_leave_lps_check_prepare()
173 fw = &rtwdev->fw; in rtw_fw_leave_lps_check_prepare()
176 reinit_completion(&rtwdev->lps_leave_check); in rtw_fw_leave_lps_check_prepare()
181 struct rtw_lps_conf *conf = &rtwdev->lps_conf; in rtw_leave_lps_core()
183 conf->state = RTW_ALL_ON; in rtw_leave_lps_core()
184 conf->awake_interval = 1; in rtw_leave_lps_core()
185 conf->rlbm = 0; in rtw_leave_lps_core()
186 conf->smart_ps = 0; in rtw_leave_lps_core()
193 clear_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags); in rtw_leave_lps_core()
200 if (test_bit(RTW_FLAG_WOWLAN, rtwdev->flags)) in rtw_get_lps_deep_mode()
201 return rtwdev->lps_conf.wow_deep_mode; in rtw_get_lps_deep_mode()
203 return rtwdev->lps_conf.deep_mode; in rtw_get_lps_deep_mode()
211 if (!test_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags)) { in __rtw_enter_lps_deep()
213 "Should enter LPS before entering deep PS\n"); in __rtw_enter_lps_deep()
225 struct rtw_lps_conf *conf = &rtwdev->lps_conf; in rtw_enter_lps_core()
227 conf->state = RTW_RF_OFF; in rtw_enter_lps_core()
228 conf->awake_interval = 1; in rtw_enter_lps_core()
229 conf->rlbm = 1; in rtw_enter_lps_core()
230 conf->smart_ps = 2; in rtw_enter_lps_core()
237 set_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags); in rtw_enter_lps_core()
242 struct rtw_lps_conf *conf = &rtwdev->lps_conf; in __rtw_enter_lps()
244 if (test_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags)) in __rtw_enter_lps()
247 conf->mode = RTW_MODE_LPS; in __rtw_enter_lps()
248 conf->port_id = port_id; in __rtw_enter_lps()
255 struct rtw_lps_conf *conf = &rtwdev->lps_conf; in __rtw_leave_lps()
257 if (test_and_clear_bit(RTW_FLAG_LEISURE_PS_DEEP, rtwdev->flags)) { in __rtw_leave_lps()
259 "Should leave deep PS before leaving LPS\n"); in __rtw_leave_lps()
263 if (!test_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags)) in __rtw_leave_lps()
266 conf->mode = RTW_MODE_ACTIVE; in __rtw_leave_lps()
273 lockdep_assert_held(&rtwdev->mutex); in rtw_enter_lps()
275 if (rtwdev->coex.stat.wl_force_lps_ctrl) in rtw_enter_lps()
284 lockdep_assert_held(&rtwdev->mutex); in rtw_leave_lps()
292 lockdep_assert_held(&rtwdev->mutex); in rtw_leave_lps_deep()