power.h 852 字节
Newer Older
1 2 3 4 5
static inline void device_pm_init(struct device *dev)
{
	dev->power.status = DPM_ON;
}

6
#ifdef CONFIG_PM_SLEEP
L
Linus Torvalds 已提交
7 8 9 10 11

/*
 * main.c
 */

12
extern struct list_head dpm_list;	/* The active device list */
L
Linus Torvalds 已提交
13

14
static inline struct device *to_device(struct list_head *entry)
L
Linus Torvalds 已提交
15
{
16
	return container_of(entry, struct device, power.entry);
L
Linus Torvalds 已提交
17 18
}

19
extern void device_pm_add(struct device *);
L
Linus Torvalds 已提交
20 21
extern void device_pm_remove(struct device *);

22 23
#else /* CONFIG_PM_SLEEP */

24
static inline void device_pm_add(struct device *dev) {}
25
static inline void device_pm_remove(struct device *dev) {}
26

27 28 29 30
#endif

#ifdef CONFIG_PM

L
Linus Torvalds 已提交
31 32 33 34 35 36 37
/*
 * sysfs.c
 */

extern int dpm_sysfs_add(struct device *);
extern void dpm_sysfs_remove(struct device *);

38
#else /* CONFIG_PM */
L
Linus Torvalds 已提交
39

40
static inline int dpm_sysfs_add(struct device *dev)
L
Linus Torvalds 已提交
41 42 43 44
{
	return 0;
}

45 46
static inline void dpm_sysfs_remove(struct device *dev)
{
L
Linus Torvalds 已提交
47 48 49
}

#endif