power.h 829 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * shutdown.c
  3. */
  4. extern void device_shutdown(void);
  5. #ifdef CONFIG_PM_SLEEP
  6. /*
  7. * main.c
  8. */
  9. extern struct list_head dpm_active; /* The active device list */
  10. static inline struct device *to_device(struct list_head *entry)
  11. {
  12. return container_of(entry, struct device, power.entry);
  13. }
  14. extern void device_pm_add(struct device *);
  15. extern void device_pm_remove(struct device *);
  16. #else /* CONFIG_PM_SLEEP */
  17. static inline void device_pm_add(struct device *dev)
  18. {
  19. }
  20. static inline void device_pm_remove(struct device *dev)
  21. {
  22. }
  23. #endif
  24. #ifdef CONFIG_PM
  25. /*
  26. * sysfs.c
  27. */
  28. extern int dpm_sysfs_add(struct device *);
  29. extern void dpm_sysfs_remove(struct device *);
  30. #else /* CONFIG_PM */
  31. static inline int dpm_sysfs_add(struct device *dev)
  32. {
  33. return 0;
  34. }
  35. static inline void dpm_sysfs_remove(struct device *dev)
  36. {
  37. }
  38. #endif