power.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. static inline void device_pm_init(struct device *dev)
  2. {
  3. dev->power.status = DPM_ON;
  4. }
  5. #ifdef CONFIG_PM_SLEEP
  6. /*
  7. * main.c
  8. */
  9. extern struct list_head dpm_list; /* 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. extern void device_pm_move_before(struct device *, struct device *);
  17. extern void device_pm_move_after(struct device *, struct device *);
  18. extern void device_pm_move_last(struct device *);
  19. #else /* CONFIG_PM_SLEEP */
  20. static inline void device_pm_add(struct device *dev) {}
  21. static inline void device_pm_remove(struct device *dev) {}
  22. static inline void device_pm_move_before(struct device *deva,
  23. struct device *devb) {}
  24. static inline void device_pm_move_after(struct device *deva,
  25. struct device *devb) {}
  26. static inline void device_pm_move_last(struct device *dev) {}
  27. #endif
  28. #ifdef CONFIG_PM
  29. /*
  30. * sysfs.c
  31. */
  32. extern int dpm_sysfs_add(struct device *);
  33. extern void dpm_sysfs_remove(struct device *);
  34. #else /* CONFIG_PM */
  35. static inline int dpm_sysfs_add(struct device *dev)
  36. {
  37. return 0;
  38. }
  39. static inline void dpm_sysfs_remove(struct device *dev)
  40. {
  41. }
  42. #endif