aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap1/pm_bus.c1
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c1
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c2
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c2
-rw-r--r--arch/arm/mach-shmobile/pm_runtime.c1
-rw-r--r--drivers/base/power/clock_ops.c2
-rw-r--r--drivers/base/power/common.c3
-rw-r--r--include/linux/pm_clock.h71
-rw-r--r--include/linux/pm_runtime.h56
9 files changed, 78 insertions, 61 deletions
diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 943072d5a1d5..7868e75ad077 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -13,6 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/pm_runtime.h> 15#include <linux/pm_runtime.h>
16#include <linux/pm_clock.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
17#include <linux/mutex.h> 18#include <linux/mutex.h>
18#include <linux/clk.h> 19#include <linux/clk.h>
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index fadbe5b3005d..074884c646db 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -42,6 +42,7 @@
42#include <linux/leds.h> 42#include <linux/leds.h>
43#include <linux/input/sh_keysc.h> 43#include <linux/input/sh_keysc.h>
44#include <linux/usb/r8a66597.h> 44#include <linux/usb/r8a66597.h>
45#include <linux/pm_clock.h>
45 46
46#include <media/sh_mobile_ceu.h> 47#include <media/sh_mobile_ceu.h>
47#include <media/sh_mobile_csi2.h> 48#include <media/sh_mobile_csi2.h>
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 0ea71f8d4b89..4978e8186127 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -39,7 +39,7 @@
39#include <linux/mtd/mtd.h> 39#include <linux/mtd/mtd.h>
40#include <linux/mtd/partitions.h> 40#include <linux/mtd/partitions.h>
41#include <linux/mtd/physmap.h> 41#include <linux/mtd/physmap.h>
42#include <linux/pm_runtime.h> 42#include <linux/pm_clock.h>
43#include <linux/smsc911x.h> 43#include <linux/smsc911x.h>
44#include <linux/sh_intc.h> 44#include <linux/sh_intc.h>
45#include <linux/tca6416_keypad.h> 45#include <linux/tca6416_keypad.h>
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 4aeca0adae56..5d35831e4fb1 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -15,7 +15,7 @@
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/pm_runtime.h> 18#include <linux/pm_clock.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <asm/system.h> 21#include <asm/system.h>
diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c
index 6ec454e1e063..bd5c6a3b8c55 100644
--- a/arch/arm/mach-shmobile/pm_runtime.c
+++ b/arch/arm/mach-shmobile/pm_runtime.c
@@ -15,6 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/pm_runtime.h> 16#include <linux/pm_runtime.h>
17#include <linux/pm_domain.h> 17#include <linux/pm_domain.h>
18#include <linux/pm_clock.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/clk.h> 20#include <linux/clk.h>
20#include <linux/sh_clk.h> 21#include <linux/sh_clk.h>
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 8383e2488d79..cb44b58d6813 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -10,7 +10,7 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/io.h> 11#include <linux/io.h>
12#include <linux/pm.h> 12#include <linux/pm.h>
13#include <linux/pm_runtime.h> 13#include <linux/pm_clock.h>
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/err.h> 16#include <linux/err.h>
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index d398cf029b32..29820c396182 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -10,8 +10,7 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/device.h> 13#include <linux/pm_clock.h>
14#include <linux/pm_runtime.h>
15 14
16/** 15/**
17 * dev_pm_get_subsys_data - Create or refcount power.subsys_data for device. 16 * dev_pm_get_subsys_data - Create or refcount power.subsys_data for device.
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
15struct 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
22static 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
28extern void pm_clk_init(struct device *dev);
29extern int pm_clk_create(struct device *dev);
30extern void pm_clk_destroy(struct device *dev);
31extern int pm_clk_add(struct device *dev, const char *con_id);
32extern void pm_clk_remove(struct device *dev, const char *con_id);
33extern int pm_clk_suspend(struct device *dev);
34extern int pm_clk_resume(struct device *dev);
35#else
36static inline bool pm_clk_no_clocks(struct device *dev)
37{
38 return true;
39}
40static inline void pm_clk_init(struct device *dev)
41{
42}
43static inline int pm_clk_create(struct device *dev)
44{
45 return -EINVAL;
46}
47static inline void pm_clk_destroy(struct device *dev)
48{
49}
50static inline int pm_clk_add(struct device *dev, const char *con_id)
51{
52 return -EINVAL;
53}
54static 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
62extern void pm_clk_add_notifier(struct bus_type *bus,
63 struct pm_clk_notifier_block *clknb);
64#else
65static inline void pm_clk_add_notifier(struct bus_type *bus,
66 struct pm_clk_notifier_block *clknb)
67{
68}
69#endif
70
71#endif
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index a5a41a850efb..70b284024d9e 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -251,60 +251,4 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
251 __pm_runtime_use_autosuspend(dev, false); 251 __pm_runtime_use_autosuspend(dev, false);
252} 252}
253 253
254struct pm_clk_notifier_block {
255 struct notifier_block nb;
256 struct dev_pm_domain *pm_domain;
257 char *con_ids[];
258};
259
260#ifdef CONFIG_PM_CLK
261static inline bool pm_clk_no_clocks(struct device *dev)
262{
263 return dev && dev->power.subsys_data
264 && list_empty(&dev->power.subsys_data->clock_list);
265}
266
267extern void pm_clk_init(struct device *dev);
268extern int pm_clk_create(struct device *dev);
269extern void pm_clk_destroy(struct device *dev);
270extern int pm_clk_add(struct device *dev, const char *con_id);
271extern void pm_clk_remove(struct device *dev, const char *con_id);
272extern int pm_clk_suspend(struct device *dev);
273extern int pm_clk_resume(struct device *dev);
274#else
275static inline bool pm_clk_no_clocks(struct device *dev)
276{
277 return true;
278}
279static inline void pm_clk_init(struct device *dev)
280{
281}
282static inline int pm_clk_create(struct device *dev)
283{
284 return -EINVAL;
285}
286static inline void pm_clk_destroy(struct device *dev)
287{
288}
289static inline int pm_clk_add(struct device *dev, const char *con_id)
290{
291 return -EINVAL;
292}
293static inline void pm_clk_remove(struct device *dev, const char *con_id)
294{
295}
296#define pm_clk_suspend NULL
297#define pm_clk_resume NULL
298#endif
299
300#ifdef CONFIG_HAVE_CLK
301extern void pm_clk_add_notifier(struct bus_type *bus,
302 struct pm_clk_notifier_block *clknb);
303#else
304static inline void pm_clk_add_notifier(struct bus_type *bus,
305 struct pm_clk_notifier_block *clknb)
306{
307}
308#endif
309
310#endif 254#endif