2 * pm_clock.h - Definitions and headers related to device clocks.
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 static inline bool pm_clk_no_clocks(struct device *dev)
26 return dev && dev->power.subsys_data
27 && list_empty(&dev->power.subsys_data->clock_list);
30 extern void pm_clk_init(struct device *dev);
31 extern int pm_clk_create(struct device *dev);
32 extern void pm_clk_destroy(struct device *dev);
33 extern int pm_clk_add(struct device *dev, const char *con_id);
34 extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
35 extern void pm_clk_remove(struct device *dev, const char *con_id);
36 extern int pm_clk_suspend(struct device *dev);
37 extern int pm_clk_resume(struct device *dev);
39 static inline bool pm_clk_no_clocks(struct device *dev)
43 static inline void pm_clk_init(struct device *dev)
46 static inline int pm_clk_create(struct device *dev)
50 static inline void pm_clk_destroy(struct device *dev)
53 static inline int pm_clk_add(struct device *dev, const char *con_id)
58 static inline int pm_clk_add_clk(struct device *dev, struct clk *clk)
62 static inline void pm_clk_remove(struct device *dev, const char *con_id)
65 #define pm_clk_suspend NULL
66 #define pm_clk_resume NULL
69 #ifdef CONFIG_HAVE_CLK
70 extern void pm_clk_add_notifier(struct bus_type *bus,
71 struct pm_clk_notifier_block *clknb);
73 static inline void pm_clk_add_notifier(struct bus_type *bus,
74 struct pm_clk_notifier_block *clknb)