power.h 937 B

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