]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/linux/pm_clock.h
2 * pm_clock.h - Definitions and headers related to device clocks.
4 * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
6 * This file is released under the GPLv2.
9 #ifndef _LINUX_PM_CLOCK_H
10 #define _LINUX_PM_CLOCK_H
12 #include <linux/device.h>
13 #include <linux/notifier.h>
15 struct pm_clk_notifier_block
{
16 struct notifier_block nb
;
17 struct dev_pm_domain
*pm_domain
;
24 extern int pm_clk_runtime_suspend(struct device
*dev
);
25 extern int pm_clk_runtime_resume(struct device
*dev
);
26 #define USE_PM_CLK_RUNTIME_OPS \
27 .runtime_suspend = pm_clk_runtime_suspend, \
28 .runtime_resume = pm_clk_runtime_resume,
30 #define USE_PM_CLK_RUNTIME_OPS
34 static inline bool pm_clk_no_clocks(struct device
*dev
)
36 return dev
&& dev
->power
.subsys_data
37 && list_empty(&dev
->power
.subsys_data
->clock_list
);
40 extern void pm_clk_init(struct device
*dev
);
41 extern int pm_clk_create(struct device
*dev
);
42 extern void pm_clk_destroy(struct device
*dev
);
43 extern int pm_clk_add(struct device
*dev
, const char *con_id
);
44 extern int pm_clk_add_clk(struct device
*dev
, struct clk
*clk
);
45 extern int of_pm_clk_add_clks(struct device
*dev
);
46 extern void pm_clk_remove(struct device
*dev
, const char *con_id
);
47 extern void pm_clk_remove_clk(struct device
*dev
, struct clk
*clk
);
48 extern int pm_clk_suspend(struct device
*dev
);
49 extern int pm_clk_resume(struct device
*dev
);
51 static inline bool pm_clk_no_clocks(struct device
*dev
)
55 static inline void pm_clk_init(struct device
*dev
)
58 static inline int pm_clk_create(struct device
*dev
)
62 static inline void pm_clk_destroy(struct device
*dev
)
65 static inline int pm_clk_add(struct device
*dev
, const char *con_id
)
70 static inline int pm_clk_add_clk(struct device
*dev
, struct clk
*clk
)
74 static inline int of_pm_clk_add_clks(struct device
*dev
)
78 static inline void pm_clk_remove(struct device
*dev
, const char *con_id
)
81 #define pm_clk_suspend NULL
82 #define pm_clk_resume NULL
83 static inline void pm_clk_remove_clk(struct device
*dev
, struct clk
*clk
)
88 #ifdef CONFIG_HAVE_CLK
89 extern void pm_clk_add_notifier(struct bus_type
*bus
,
90 struct pm_clk_notifier_block
*clknb
);
92 static inline void pm_clk_add_notifier(struct bus_type
*bus
,
93 struct pm_clk_notifier_block
*clknb
)