gpio: rcar: Fix runtime PM imbalance on error
[linux/fpc-iii.git] / drivers / net / wireless / st / cw1200 / pm.h
blobf516eedfe03c91a962050d3d73ae398da23e88a4
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Mac80211 power management interface for ST-Ericsson CW1200 mac80211 drivers
5 * Copyright (c) 2011, ST-Ericsson
6 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
7 */
9 #ifndef PM_H_INCLUDED
10 #define PM_H_INCLUDED
12 /* ******************************************************************** */
13 /* mac80211 API */
15 /* extern */ struct cw1200_common;
16 /* private */ struct cw1200_suspend_state;
18 struct cw1200_pm_state {
19 struct cw1200_suspend_state *suspend_state;
20 struct timer_list stay_awake;
21 struct platform_device *pm_dev;
22 spinlock_t lock; /* Protect access */
25 #ifdef CONFIG_PM
26 int cw1200_pm_init(struct cw1200_pm_state *pm,
27 struct cw1200_common *priv);
28 void cw1200_pm_deinit(struct cw1200_pm_state *pm);
29 int cw1200_wow_suspend(struct ieee80211_hw *hw,
30 struct cfg80211_wowlan *wowlan);
31 int cw1200_can_suspend(struct cw1200_common *priv);
32 int cw1200_wow_resume(struct ieee80211_hw *hw);
33 void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
34 unsigned long tmo);
35 #else
36 static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
37 unsigned long tmo)
40 static inline int cw1200_can_suspend(struct cw1200_common *priv)
42 return 0;
44 #endif
45 #endif