diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2013-08-24 20:10:41 +0200 |
---|---|---|
committer | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2013-12-04 17:19:44 +0100 |
commit | ac2df527fb407b61f9c812a99035b62a75a77d6d (patch) | |
tree | 87b9b90703c654b5359749bd48eb87bb5dd0b118 /include/linux | |
parent | 3a3d2b0551d79ef476ef57424beeb8f68789fbcd (diff) | |
download | blackbird-op-linux-ac2df527fb407b61f9c812a99035b62a75a77d6d.tar.gz blackbird-op-linux-ac2df527fb407b61f9c812a99035b62a75a77d6d.zip |
clk: Add common __clk_get(), __clk_put() implementations
This patch adds common __clk_get(), __clk_put() clkdev helpers that
replace their platform specific counterparts when the common clock
API is used.
The owner module pointer field is added to struct clk so a reference
to the clock supplier module can be taken by the clock consumers.
The owner module is assigned while the clock is being registered,
in functions _clk_register() and __clk_register().
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/clk-private.h | 3 | ||||
-rw-r--r-- | include/linux/clkdev.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h index 8138c94409f3..8cb1865e7d9d 100644 --- a/include/linux/clk-private.h +++ b/include/linux/clk-private.h @@ -25,10 +25,13 @@ #ifdef CONFIG_COMMON_CLK +struct module; + struct clk { const char *name; const struct clk_ops *ops; struct clk_hw *hw; + struct module *owner; struct clk *parent; const char **parent_names; struct clk **parents; diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index a6a6f603103b..94bad77eeb4a 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h @@ -43,4 +43,9 @@ int clk_add_alias(const char *, const char *, char *, struct device *); int clk_register_clkdev(struct clk *, const char *, const char *, ...); int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); +#ifdef CONFIG_COMMON_CLK +int __clk_get(struct clk *clk); +void __clk_put(struct clk *clk); +#endif + #endif |