aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clk-provider.h
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2016-02-05 17:02:52 -0800
committerStephen Boyd <sboyd@codeaurora.org>2016-04-19 16:51:58 -0700
commit4143804c4fdef40358c654d1fb2271a1a0f1fedf (patch)
tree8e12e7e18b46dc81af91fb4092f61b3bde726f02 /include/linux/clk-provider.h
parentclkdev: Remove clk_register_clkdevs() (diff)
downloadlinux-dev-4143804c4fdef40358c654d1fb2271a1a0f1fedf.tar.xz
linux-dev-4143804c4fdef40358c654d1fb2271a1a0f1fedf.zip
clk: Add {devm_}clk_hw_{register,unregister}() APIs
We've largely split the clk consumer and provider APIs along struct clk and struct clk_hw, but clk_register() still returns a struct clk pointer for each struct clk_hw that's registered. Eventually we'd like to only allocate struct clks when there's a user, because struct clk is per-user now, so clk_register() needs to change. Let's add new APIs to register struct clk_hws, but this time we'll hide the struct clk from the caller by returning an int error code. Also add an unregistration API that takes the clk_hw structure that was passed to the registration API. This way provider drivers never have to deal with a struct clk pointer unless they're using the clk consumer APIs. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'include/linux/clk-provider.h')
-rw-r--r--include/linux/clk-provider.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index da95258127aa..bc6c8de1fac1 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -655,9 +655,15 @@ struct clk *clk_register_gpio_mux(struct device *dev, const char *name,
struct clk *clk_register(struct device *dev, struct clk_hw *hw);
struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
+int __must_check clk_hw_register(struct device *dev, struct clk_hw *hw);
+int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);
+
void clk_unregister(struct clk *clk);
void devm_clk_unregister(struct device *dev, struct clk *clk);
+void clk_hw_unregister(struct clk_hw *hw);
+void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw);
+
/* helper functions */
const char *__clk_get_name(const struct clk *clk);
const char *clk_hw_get_name(const struct clk_hw *hw);