Commit 1430858f authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'clk-bulk-get-prep-enable' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk api update from Stephen Boyd:
 "Small patch to add the clk_bulk_prepare_enable() and
  clk_bulk_disable_unprepare() API to the newly introduced
  clk bulk APIs.

  It would be good to get this into the -rc1 so that other
  driver trees can use it for code targeted for the next
  merge window"

* tag 'clk-bulk-get-prep-enable' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: Provide bulk prepare_enable disable_unprepare variants
parents 2931dc7d 3c48d86c
...@@ -657,6 +657,28 @@ static inline void clk_disable_unprepare(struct clk *clk) ...@@ -657,6 +657,28 @@ static inline void clk_disable_unprepare(struct clk *clk)
clk_unprepare(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) #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
struct clk *of_clk_get(struct device_node *np, int index); 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); struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment