aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h7
-rw-r--r--include/linux/kmod.h1
-rw-r--r--include/linux/platform_device.h63
-rw-r--r--include/linux/pm.h39
-rw-r--r--include/linux/pm_runtime.h42
-rw-r--r--include/linux/sysdev.h11
6 files changed, 127 insertions, 36 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index d08399db6e2c..0d7535000821 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -632,13 +632,6 @@ static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
632/* drivers/base/power/shutdown.c */ 632/* drivers/base/power/shutdown.c */
633extern void device_shutdown(void); 633extern void device_shutdown(void);
634 634
635#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
636/* drivers/base/sys.c */
637extern void sysdev_shutdown(void);
638#else
639static inline void sysdev_shutdown(void) { }
640#endif
641
642/* debugging and troubleshooting/diagnostic helpers. */ 635/* debugging and troubleshooting/diagnostic helpers. */
643extern const char *dev_driver_string(const struct device *dev); 636extern const char *dev_driver_string(const struct device *dev);
644 637
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 6efd7a78de6a..310231823852 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -113,5 +113,6 @@ extern void usermodehelper_init(void);
113 113
114extern int usermodehelper_disable(void); 114extern int usermodehelper_disable(void);
115extern void usermodehelper_enable(void); 115extern void usermodehelper_enable(void);
116extern bool usermodehelper_is_disabled(void);
116 117
117#endif /* __LINUX_KMOD_H__ */ 118#endif /* __LINUX_KMOD_H__ */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 744942c95fec..ede1a80e3358 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -150,9 +150,6 @@ extern struct platform_device *platform_create_bundle(struct platform_driver *dr
150 struct resource *res, unsigned int n_res, 150 struct resource *res, unsigned int n_res,
151 const void *data, size_t size); 151 const void *data, size_t size);
152 152
153extern const struct dev_pm_ops * platform_bus_get_pm_ops(void);
154extern void platform_bus_set_pm_ops(const struct dev_pm_ops *pm);
155
156/* early platform driver interface */ 153/* early platform driver interface */
157struct early_platform_driver { 154struct early_platform_driver {
158 const char *class_str; 155 const char *class_str;
@@ -205,4 +202,64 @@ static inline char *early_platform_driver_setup_func(void) \
205} 202}
206#endif /* MODULE */ 203#endif /* MODULE */
207 204
205#ifdef CONFIG_PM_SLEEP
206extern int platform_pm_prepare(struct device *dev);
207extern void platform_pm_complete(struct device *dev);
208#else
209#define platform_pm_prepare NULL
210#define platform_pm_complete NULL
211#endif
212
213#ifdef CONFIG_SUSPEND
214extern int platform_pm_suspend(struct device *dev);
215extern int platform_pm_suspend_noirq(struct device *dev);
216extern int platform_pm_resume(struct device *dev);
217extern int platform_pm_resume_noirq(struct device *dev);
218#else
219#define platform_pm_suspend NULL
220#define platform_pm_resume NULL
221#define platform_pm_suspend_noirq NULL
222#define platform_pm_resume_noirq NULL
223#endif
224
225#ifdef CONFIG_HIBERNATE_CALLBACKS
226extern int platform_pm_freeze(struct device *dev);
227extern int platform_pm_freeze_noirq(struct device *dev);
228extern int platform_pm_thaw(struct device *dev);
229extern int platform_pm_thaw_noirq(struct device *dev);
230extern int platform_pm_poweroff(struct device *dev);
231extern int platform_pm_poweroff_noirq(struct device *dev);
232extern int platform_pm_restore(struct device *dev);
233extern int platform_pm_restore_noirq(struct device *dev);
234#else
235#define platform_pm_freeze NULL
236#define platform_pm_thaw NULL
237#define platform_pm_poweroff NULL
238#define platform_pm_restore NULL
239#define platform_pm_freeze_noirq NULL
240#define platform_pm_thaw_noirq NULL
241#define platform_pm_poweroff_noirq NULL
242#define platform_pm_restore_noirq NULL
243#endif
244
245#ifdef CONFIG_PM_SLEEP
246#define USE_PLATFORM_PM_SLEEP_OPS \
247 .prepare = platform_pm_prepare, \
248 .complete = platform_pm_complete, \
249 .suspend = platform_pm_suspend, \
250 .resume = platform_pm_resume, \
251 .freeze = platform_pm_freeze, \
252 .thaw = platform_pm_thaw, \
253 .poweroff = platform_pm_poweroff, \
254 .restore = platform_pm_restore, \
255 .suspend_noirq = platform_pm_suspend_noirq, \
256 .resume_noirq = platform_pm_resume_noirq, \
257 .freeze_noirq = platform_pm_freeze_noirq, \
258 .thaw_noirq = platform_pm_thaw_noirq, \
259 .poweroff_noirq = platform_pm_poweroff_noirq, \
260 .restore_noirq = platform_pm_restore_noirq,
261#else
262#define USE_PLATFORM_PM_SLEEP_OPS
263#endif
264
208#endif /* _PLATFORM_DEVICE_H_ */ 265#endif /* _PLATFORM_DEVICE_H_ */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 512e09177e57..3160648ccdda 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -460,6 +460,7 @@ struct dev_pm_info {
460 unsigned long active_jiffies; 460 unsigned long active_jiffies;
461 unsigned long suspended_jiffies; 461 unsigned long suspended_jiffies;
462 unsigned long accounting_timestamp; 462 unsigned long accounting_timestamp;
463 void *subsys_data; /* Owned by the subsystem. */
463#endif 464#endif
464}; 465};
465 466
@@ -529,21 +530,17 @@ struct dev_power_domain {
529 */ 530 */
530 531
531#ifdef CONFIG_PM_SLEEP 532#ifdef CONFIG_PM_SLEEP
532#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
533extern int sysdev_suspend(pm_message_t state);
534extern int sysdev_resume(void);
535#else
536static inline int sysdev_suspend(pm_message_t state) { return 0; }
537static inline int sysdev_resume(void) { return 0; }
538#endif
539
540extern void device_pm_lock(void); 533extern void device_pm_lock(void);
541extern void dpm_resume_noirq(pm_message_t state); 534extern void dpm_resume_noirq(pm_message_t state);
542extern void dpm_resume_end(pm_message_t state); 535extern void dpm_resume_end(pm_message_t state);
536extern void dpm_resume(pm_message_t state);
537extern void dpm_complete(pm_message_t state);
543 538
544extern void device_pm_unlock(void); 539extern void device_pm_unlock(void);
545extern int dpm_suspend_noirq(pm_message_t state); 540extern int dpm_suspend_noirq(pm_message_t state);
546extern int dpm_suspend_start(pm_message_t state); 541extern int dpm_suspend_start(pm_message_t state);
542extern int dpm_suspend(pm_message_t state);
543extern int dpm_prepare(pm_message_t state);
547 544
548extern void __suspend_report_result(const char *function, void *fn, int ret); 545extern void __suspend_report_result(const char *function, void *fn, int ret);
549 546
@@ -553,6 +550,16 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
553 } while (0) 550 } while (0)
554 551
555extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); 552extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
553
554extern int pm_generic_prepare(struct device *dev);
555extern int pm_generic_suspend(struct device *dev);
556extern int pm_generic_resume(struct device *dev);
557extern int pm_generic_freeze(struct device *dev);
558extern int pm_generic_thaw(struct device *dev);
559extern int pm_generic_restore(struct device *dev);
560extern int pm_generic_poweroff(struct device *dev);
561extern void pm_generic_complete(struct device *dev);
562
556#else /* !CONFIG_PM_SLEEP */ 563#else /* !CONFIG_PM_SLEEP */
557 564
558#define device_pm_lock() do {} while (0) 565#define device_pm_lock() do {} while (0)
@@ -569,6 +576,15 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
569{ 576{
570 return 0; 577 return 0;
571} 578}
579
580#define pm_generic_prepare NULL
581#define pm_generic_suspend NULL
582#define pm_generic_resume NULL
583#define pm_generic_freeze NULL
584#define pm_generic_thaw NULL
585#define pm_generic_restore NULL
586#define pm_generic_poweroff NULL
587#define pm_generic_complete NULL
572#endif /* !CONFIG_PM_SLEEP */ 588#endif /* !CONFIG_PM_SLEEP */
573 589
574/* How to reorder dpm_list after device_move() */ 590/* How to reorder dpm_list after device_move() */
@@ -579,11 +595,4 @@ enum dpm_order {
579 DPM_ORDER_DEV_LAST, 595 DPM_ORDER_DEV_LAST,
580}; 596};
581 597
582extern int pm_generic_suspend(struct device *dev);
583extern int pm_generic_resume(struct device *dev);
584extern int pm_generic_freeze(struct device *dev);
585extern int pm_generic_thaw(struct device *dev);
586extern int pm_generic_restore(struct device *dev);
587extern int pm_generic_poweroff(struct device *dev);
588
589#endif /* _LINUX_PM_H */ 598#endif /* _LINUX_PM_H */
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 8de9aa6e7def..878cf84baeb1 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -245,4 +245,46 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
245 __pm_runtime_use_autosuspend(dev, false); 245 __pm_runtime_use_autosuspend(dev, false);
246} 246}
247 247
248struct pm_clk_notifier_block {
249 struct notifier_block nb;
250 struct dev_power_domain *pwr_domain;
251 char *con_ids[];
252};
253
254#ifdef CONFIG_PM_RUNTIME_CLK
255extern int pm_runtime_clk_init(struct device *dev);
256extern void pm_runtime_clk_destroy(struct device *dev);
257extern int pm_runtime_clk_add(struct device *dev, const char *con_id);
258extern void pm_runtime_clk_remove(struct device *dev, const char *con_id);
259extern int pm_runtime_clk_suspend(struct device *dev);
260extern int pm_runtime_clk_resume(struct device *dev);
261#else
262static inline int pm_runtime_clk_init(struct device *dev)
263{
264 return -EINVAL;
265}
266static inline void pm_runtime_clk_destroy(struct device *dev)
267{
268}
269static inline int pm_runtime_clk_add(struct device *dev, const char *con_id)
270{
271 return -EINVAL;
272}
273static inline void pm_runtime_clk_remove(struct device *dev, const char *con_id)
274{
275}
276#define pm_runtime_clock_suspend NULL
277#define pm_runtime_clock_resume NULL
278#endif
279
280#ifdef CONFIG_HAVE_CLK
281extern void pm_runtime_clk_add_notifier(struct bus_type *bus,
282 struct pm_clk_notifier_block *clknb);
283#else
284static inline void pm_runtime_clk_add_notifier(struct bus_type *bus,
285 struct pm_clk_notifier_block *clknb)
286{
287}
288#endif
289
248#endif 290#endif
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index dfb078db8ebb..d35e783a598c 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -34,12 +34,6 @@ struct sysdev_class {
34 struct list_head drivers; 34 struct list_head drivers;
35 struct sysdev_class_attribute **attrs; 35 struct sysdev_class_attribute **attrs;
36 struct kset kset; 36 struct kset kset;
37#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
38 /* Default operations for these types of devices */
39 int (*shutdown)(struct sys_device *);
40 int (*suspend)(struct sys_device *, pm_message_t state);
41 int (*resume)(struct sys_device *);
42#endif
43}; 37};
44 38
45struct sysdev_class_attribute { 39struct sysdev_class_attribute {
@@ -77,11 +71,6 @@ struct sysdev_driver {
77 struct list_head entry; 71 struct list_head entry;
78 int (*add)(struct sys_device *); 72 int (*add)(struct sys_device *);
79 int (*remove)(struct sys_device *); 73 int (*remove)(struct sys_device *);
80#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
81 int (*shutdown)(struct sys_device *);
82 int (*suspend)(struct sys_device *, pm_message_t state);
83 int (*resume)(struct sys_device *);
84#endif
85}; 74};
86 75
87 76