diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 09:34:19 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 09:34:19 -0400 |
commit | b5e8d269d814763d597ccc0108d1fa6639ad35a1 (patch) | |
tree | 9c401a279d38e977e7208debc74b7ce2708d3498 /include/linux/pm_clock.h | |
parent | 4605ab653c1f9d7cc2dda8033de215c9cee325f4 (diff) |
PM: Move clock-related definitions and headers to separate file
Since the PM clock management code in drivers/base/power/clock_ops.c
is used for both runtime PM and system suspend/hibernation, the
definitions of data structures and headers related to it should not
be located in include/linux/pm_rumtime.h. Move them to a separate
header file.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/pm_clock.h')
-rw-r--r-- | include/linux/pm_clock.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h new file mode 100644 index 000000000000..8348866e7b05 --- /dev/null +++ b/include/linux/pm_clock.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * pm_clock.h - Definitions and headers related to device clocks. | ||
3 | * | ||
4 | * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp. | ||
5 | * | ||
6 | * This file is released under the GPLv2. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_PM_CLOCK_H | ||
10 | #define _LINUX_PM_CLOCK_H | ||
11 | |||
12 | #include <linux/device.h> | ||
13 | #include <linux/notifier.h> | ||
14 | |||
15 | struct pm_clk_notifier_block { | ||
16 | struct notifier_block nb; | ||
17 | struct dev_pm_domain *pm_domain; | ||
18 | char *con_ids[]; | ||
19 | }; | ||
20 | |||
21 | #ifdef CONFIG_PM_CLK | ||
22 | static inline bool pm_clk_no_clocks(struct device *dev) | ||
23 | { | ||
24 | return dev && dev->power.subsys_data | ||
25 | && list_empty(&dev->power.subsys_data->clock_list); | ||
26 | } | ||
27 | |||
28 | extern void pm_clk_init(struct device *dev); | ||
29 | extern int pm_clk_create(struct device *dev); | ||
30 | extern void pm_clk_destroy(struct device *dev); | ||
31 | extern int pm_clk_add(struct device *dev, const char *con_id); | ||
32 | extern void pm_clk_remove(struct device *dev, const char *con_id); | ||
33 | extern int pm_clk_suspend(struct device *dev); | ||
34 | extern int pm_clk_resume(struct device *dev); | ||
35 | #else | ||
36 | static inline bool pm_clk_no_clocks(struct device *dev) | ||
37 | { | ||
38 | return true; | ||
39 | } | ||
40 | static inline void pm_clk_init(struct device *dev) | ||
41 | { | ||
42 | } | ||
43 | static inline int pm_clk_create(struct device *dev) | ||
44 | { | ||
45 | return -EINVAL; | ||
46 | } | ||
47 | static inline void pm_clk_destroy(struct device *dev) | ||
48 | { | ||
49 | } | ||
50 | static inline int pm_clk_add(struct device *dev, const char *con_id) | ||
51 | { | ||
52 | return -EINVAL; | ||
53 | } | ||
54 | static inline void pm_clk_remove(struct device *dev, const char *con_id) | ||
55 | { | ||
56 | } | ||
57 | #define pm_clk_suspend NULL | ||
58 | #define pm_clk_resume NULL | ||
59 | #endif | ||
60 | |||
61 | #ifdef CONFIG_HAVE_CLK | ||
62 | extern void pm_clk_add_notifier(struct bus_type *bus, | ||
63 | struct pm_clk_notifier_block *clknb); | ||
64 | #else | ||
65 | static inline void pm_clk_add_notifier(struct bus_type *bus, | ||
66 | struct pm_clk_notifier_block *clknb) | ||
67 | { | ||
68 | } | ||
69 | #endif | ||
70 | |||
71 | #endif | ||