diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2017-07-12 18:04:16 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2017-07-13 02:50:53 -0400 |
commit | 3c48d86cc959309ee168fb87737a8cb3f97c5224 (patch) | |
tree | 4d4b13eb9415807c970732f6e3ff807ac86f48ea /include/linux/clk.h | |
parent | 618aee02e2f57042f4cdeab228caf631e524b281 (diff) |
clk: Provide bulk prepare_enable disable_unprepare variants
This extends the existing set of bulk helpers with prepare_enable and
disable_unprepare variants.
Cc: Russell King <linux@armlinux.org.uk>,
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'include/linux/clk.h')
-rw-r--r-- | include/linux/clk.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index c673f0b91751..690e6a6921e1 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -657,6 +657,28 @@ static inline void clk_disable_unprepare(struct clk *clk) | |||
657 | clk_unprepare(clk); | 657 | clk_unprepare(clk); |
658 | } | 658 | } |
659 | 659 | ||
660 | static inline int clk_bulk_prepare_enable(int num_clks, | ||
661 | struct clk_bulk_data *clks) | ||
662 | { | ||
663 | int ret; | ||
664 | |||
665 | ret = clk_bulk_prepare(num_clks, clks); | ||
666 | if (ret) | ||
667 | return ret; | ||
668 | ret = clk_bulk_enable(num_clks, clks); | ||
669 | if (ret) | ||
670 | clk_bulk_unprepare(num_clks, clks); | ||
671 | |||
672 | return ret; | ||
673 | } | ||
674 | |||
675 | static inline void clk_bulk_disable_unprepare(int num_clks, | ||
676 | struct clk_bulk_data *clks) | ||
677 | { | ||
678 | clk_bulk_disable(num_clks, clks); | ||
679 | clk_bulk_unprepare(num_clks, clks); | ||
680 | } | ||
681 | |||
660 | #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) | 682 | #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) |
661 | struct clk *of_clk_get(struct device_node *np, int index); | 683 | struct clk *of_clk_get(struct device_node *np, int index); |
662 | struct clk *of_clk_get_by_name(struct device_node *np, const char *name); | 684 | struct clk *of_clk_get_by_name(struct device_node *np, const char *name); |