aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_device.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-28 18:36:05 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-04-28 18:36:05 -0400
commit69c9dd1ecf446ad8a830e4afc539a2a1adc85b78 (patch)
tree2c43906b23ce709057b7cc0546fbcf31d1f9a8d6 /include/linux/platform_device.h
parent4d27e9dcff00a6425d779b065ec8892e4f391661 (diff)
PM: Export platform bus type's default PM callbacks
Export the default PM callbacks defined for the platform bus type so that they can be used by power domains for suspending and resuming platform devices in the future. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/platform_device.h')
-rw-r--r--include/linux/platform_device.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 744942c95fec..e0093e061b08 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -205,4 +205,64 @@ static inline char *early_platform_driver_setup_func(void) \
205} 205}
206#endif /* MODULE */ 206#endif /* MODULE */
207 207
208#ifdef CONFIG_PM_SLEEP
209extern int platform_pm_prepare(struct device *dev);
210extern void platform_pm_complete(struct device *dev);
211#else
212#define platform_pm_prepare NULL
213#define platform_pm_complete NULL
214#endif
215
216#ifdef CONFIG_SUSPEND
217extern int platform_pm_suspend(struct device *dev);
218extern int platform_pm_suspend_noirq(struct device *dev);
219extern int platform_pm_resume(struct device *dev);
220extern int platform_pm_resume_noirq(struct device *dev);
221#else
222#define platform_pm_suspend NULL
223#define platform_pm_resume NULL
224#define platform_pm_suspend_noirq NULL
225#define platform_pm_resume_noirq NULL
226#endif
227
228#ifdef CONFIG_HIBERNATE_CALLBACKS
229extern int platform_pm_freeze(struct device *dev);
230extern int platform_pm_freeze_noirq(struct device *dev);
231extern int platform_pm_thaw(struct device *dev);
232extern int platform_pm_thaw_noirq(struct device *dev);
233extern int platform_pm_poweroff(struct device *dev);
234extern int platform_pm_poweroff_noirq(struct device *dev);
235extern int platform_pm_restore(struct device *dev);
236extern int platform_pm_restore_noirq(struct device *dev);
237#else
238#define platform_pm_freeze NULL
239#define platform_pm_thaw NULL
240#define platform_pm_poweroff NULL
241#define platform_pm_restore NULL
242#define platform_pm_freeze_noirq NULL
243#define platform_pm_thaw_noirq NULL
244#define platform_pm_poweroff_noirq NULL
245#define platform_pm_restore_noirq NULL
246#endif
247
248#ifdef CONFIG_PM_SLEEP
249#define USE_PLATFORM_PM_SLEEP_OPS \
250 .prepare = platform_pm_prepare, \
251 .complete = platform_pm_complete, \
252 .suspend = platform_pm_suspend, \
253 .resume = platform_pm_resume, \
254 .freeze = platform_pm_freeze, \
255 .thaw = platform_pm_thaw, \
256 .poweroff = platform_pm_poweroff, \
257 .restore = platform_pm_restore, \
258 .suspend_noirq = platform_pm_suspend_noirq, \
259 .resume_noirq = platform_pm_resume_noirq, \
260 .freeze_noirq = platform_pm_freeze_noirq, \
261 .thaw_noirq = platform_pm_thaw_noirq, \
262 .poweroff_noirq = platform_pm_poweroff_noirq, \
263 .restore_noirq = platform_pm_restore_noirq,
264#else
265#define USE_PLATFORM_PM_SLEEP_OPS
266#endif
267
208#endif /* _PLATFORM_DEVICE_H_ */ 268#endif /* _PLATFORM_DEVICE_H_ */