xref: /linux/drivers/net/wireless/realtek/rtw88/ps.h (revision 887069f424550ebdcb411166733e1d05002b58e4)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2018-2019  Realtek Corporation
3  */
4 
5 #ifndef __RTW_PS_H_
6 #define __RTW_PS_H_
7 
8 #define RTW_LPS_THRESHOLD	50
9 
10 #define POWER_MODE_ACK		BIT(6)
11 #define POWER_MODE_PG		BIT(4)
12 #define POWER_MODE_LCLK		BIT(0)
13 
14 #define LEAVE_LPS_TRY_CNT	5
15 #define LEAVE_LPS_TIMEOUT	msecs_to_jiffies(100)
16 
17 int rtw_enter_ips(struct rtw_dev *rtwdev);
18 int rtw_leave_ips(struct rtw_dev *rtwdev);
19 
20 void rtw_power_mode_change(struct rtw_dev *rtwdev, bool enter);
21 void rtw_enter_lps(struct rtw_dev *rtwdev, u8 port_id);
22 void rtw_leave_lps(struct rtw_dev *rtwdev);
23 void rtw_leave_lps_deep(struct rtw_dev *rtwdev);
24 enum rtw_lps_deep_mode rtw_get_lps_deep_mode(struct rtw_dev *rtwdev);
25 #endif
26