mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
UPSTREAM: clk: Provide bulk prepare_enable disable_unprepare variants
This extends the existing set of bulk helpers with prepare_enable and
disable_unprepare variants.
Change-Id: I38d42d5d028f3d096cbd5b7b8d369ff250f038dc
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>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3c48d86cc9)
This commit is contained in:
committed by
Tao Huang
parent
2a0b3c4802
commit
511f7b03fe
@@ -657,6 +657,28 @@ static inline void clk_disable_unprepare(struct clk *clk)
|
||||
clk_unprepare(clk);
|
||||
}
|
||||
|
||||
static inline int clk_bulk_prepare_enable(int num_clks,
|
||||
struct clk_bulk_data *clks)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = clk_bulk_prepare(num_clks, clks);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = clk_bulk_enable(num_clks, clks);
|
||||
if (ret)
|
||||
clk_bulk_unprepare(num_clks, clks);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void clk_bulk_disable_unprepare(int num_clks,
|
||||
struct clk_bulk_data *clks)
|
||||
{
|
||||
clk_bulk_disable(num_clks, clks);
|
||||
clk_bulk_unprepare(num_clks, clks);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
|
||||
struct clk *of_clk_get(struct device_node *np, int index);
|
||||
struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
|
||||
|
||||
Reference in New Issue
Block a user