power.h 1.3 KB
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
extern void device_pm_remove(struct device *);
21 22 23
extern void device_pm_move_before(struct device *, struct device *);
extern void device_pm_move_after(struct device *, struct device *);
extern void device_pm_move_last(struct device *);
L
Linus Torvalds 已提交
24

25 26
#else /* CONFIG_PM_SLEEP */

27
static inline void device_pm_add(struct device *dev) {}
28
static inline void device_pm_remove(struct device *dev) {}
29 30 31 32 33
static inline void device_pm_move_before(struct device *deva,
					 struct device *devb) {}
static inline void device_pm_move_after(struct device *deva,
					struct device *devb) {}
static inline void device_pm_move_last(struct device *dev) {}
34

35 36 37 38
#endif

#ifdef CONFIG_PM

L
Linus Torvalds 已提交
39 40 41 42 43 44 45
/*
 * sysfs.c
 */

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

46
#else /* CONFIG_PM */
L
Linus Torvalds 已提交
47

48
static inline int dpm_sysfs_add(struct device *dev)
L
Linus Torvalds 已提交
49 50 51 52
{
	return 0;
}

53 54
static inline void dpm_sysfs_remove(struct device *dev)
{
L
Linus Torvalds 已提交
55 56 57
}

#endif