xref: /linux/drivers/net/wireless/st/cw1200/pm.h (revision 836856e3bd61d0644e5178a2c1b51d90459e2788)
1a910e4a9SSolomon Peachy /*
2a910e4a9SSolomon Peachy  * Mac80211 power management interface for ST-Ericsson CW1200 mac80211 drivers
3a910e4a9SSolomon Peachy  *
4a910e4a9SSolomon Peachy  * Copyright (c) 2011, ST-Ericsson
5a910e4a9SSolomon Peachy  * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
6a910e4a9SSolomon Peachy  *
7a910e4a9SSolomon Peachy  * This program is free software; you can redistribute it and/or modify
8a910e4a9SSolomon Peachy  * it under the terms of the GNU General Public License version 2 as
9a910e4a9SSolomon Peachy  * published by the Free Software Foundation.
10a910e4a9SSolomon Peachy  */
11a910e4a9SSolomon Peachy 
12a910e4a9SSolomon Peachy #ifndef PM_H_INCLUDED
13a910e4a9SSolomon Peachy #define PM_H_INCLUDED
14a910e4a9SSolomon Peachy 
15a910e4a9SSolomon Peachy /* ******************************************************************** */
16a910e4a9SSolomon Peachy /* mac80211 API								*/
17a910e4a9SSolomon Peachy 
18a910e4a9SSolomon Peachy /* extern */  struct cw1200_common;
19a910e4a9SSolomon Peachy /* private */ struct cw1200_suspend_state;
20a910e4a9SSolomon Peachy 
21a910e4a9SSolomon Peachy struct cw1200_pm_state {
22a910e4a9SSolomon Peachy 	struct cw1200_suspend_state *suspend_state;
23a910e4a9SSolomon Peachy 	struct timer_list stay_awake;
24a910e4a9SSolomon Peachy 	struct platform_device *pm_dev;
25a910e4a9SSolomon Peachy 	spinlock_t lock; /* Protect access */
26a910e4a9SSolomon Peachy };
27a910e4a9SSolomon Peachy 
284e17b87eSSolomon Peachy #ifdef CONFIG_PM
29a910e4a9SSolomon Peachy int cw1200_pm_init(struct cw1200_pm_state *pm,
30a910e4a9SSolomon Peachy 		    struct cw1200_common *priv);
31a910e4a9SSolomon Peachy void cw1200_pm_deinit(struct cw1200_pm_state *pm);
32a910e4a9SSolomon Peachy int cw1200_wow_suspend(struct ieee80211_hw *hw,
33a910e4a9SSolomon Peachy 		       struct cfg80211_wowlan *wowlan);
34a910e4a9SSolomon Peachy int cw1200_can_suspend(struct cw1200_common *priv);
35*836856e3SArnd Bergmann int cw1200_wow_resume(struct ieee80211_hw *hw);
364e17b87eSSolomon Peachy void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
374e17b87eSSolomon Peachy 			  unsigned long tmo);
384e17b87eSSolomon Peachy #else
394e17b87eSSolomon Peachy static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
40*836856e3SArnd Bergmann 					unsigned long tmo)
41*836856e3SArnd Bergmann {
42*836856e3SArnd Bergmann }
43*836856e3SArnd Bergmann static inline int cw1200_can_suspend(struct cw1200_common *priv)
44*836856e3SArnd Bergmann {
45*836856e3SArnd Bergmann 	return 0;
464e17b87eSSolomon Peachy }
474e17b87eSSolomon Peachy #endif
48a910e4a9SSolomon Peachy #endif
49