power.h 852 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #else /* CONFIG_PM_SLEEP */
  17. static inline void device_pm_add(struct device *dev) {}
  18. static inline void device_pm_remove(struct device *dev) {}
  19. #endif
  20. #ifdef CONFIG_PM
  21. /*
  22. * sysfs.c
  23. */
  24. extern int dpm_sysfs_add(struct device *);
  25. extern void dpm_sysfs_remove(struct device *);
  26. #else /* CONFIG_PM */
  27. static inline int dpm_sysfs_add(struct device *dev)
  28. {
  29. return 0;
  30. }
  31. static inline void dpm_sysfs_remove(struct device *dev)
  32. {
  33. }
  34. #endif