2007-07-30 05:27:18 +08:00
|
|
|
#ifdef CONFIG_PM_SLEEP
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* main.c
|
|
|
|
*/
|
|
|
|
|
2007-09-22 03:36:56 +08:00
|
|
|
extern struct list_head dpm_active; /* The active device list */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-11-22 06:55:18 +08:00
|
|
|
static inline struct device *to_device(struct list_head *entry)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2007-09-22 03:36:56 +08:00
|
|
|
return container_of(entry, struct device, power.entry);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2007-11-22 06:55:18 +08:00
|
|
|
extern void device_pm_add(struct device *);
|
2005-04-17 06:20:36 +08:00
|
|
|
extern void device_pm_remove(struct device *);
|
2008-01-13 03:40:46 +08:00
|
|
|
extern void device_pm_schedule_removal(struct device *);
|
|
|
|
extern int pm_sleep_lock(void);
|
|
|
|
extern void pm_sleep_unlock(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-11-22 06:55:18 +08:00
|
|
|
#else /* CONFIG_PM_SLEEP */
|
|
|
|
|
|
|
|
|
|
|
|
static inline void device_pm_add(struct device *dev)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void device_pm_remove(struct device *dev)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-01-13 03:40:46 +08:00
|
|
|
static inline int pm_sleep_lock(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void pm_sleep_unlock(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-11-22 06:55:18 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* sysfs.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern int dpm_sysfs_add(struct device *);
|
|
|
|
extern void dpm_sysfs_remove(struct device *);
|
|
|
|
|
2007-11-22 06:55:18 +08:00
|
|
|
#else /* CONFIG_PM */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-11-22 06:55:18 +08:00
|
|
|
static inline int dpm_sysfs_add(struct device *dev)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-22 06:55:18 +08:00
|
|
|
static inline void dpm_sysfs_remove(struct device *dev)
|
|
|
|
{
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|