linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: Provide bulk prepare_enable disable_unprepare variants
@ 2017-07-12 22:04 Bjorn Andersson
  2017-07-12 23:04 ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Andersson @ 2017-07-12 22:04 UTC (permalink / raw)
  To: Stephen Boyd, Russell King, Michael Turquette
  Cc: Dong Aisheng, open list:CLK API, open list

This extends the existing set of bulk helpers with prepare_enable and
disable_unprepare variants.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 include/linux/clk.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/linux/clk.h b/include/linux/clk.h
index 91bd464f4c9b..12c96d94d1fa 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -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);
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: Provide bulk prepare_enable disable_unprepare variants
  2017-07-12 22:04 [PATCH] clk: Provide bulk prepare_enable disable_unprepare variants Bjorn Andersson
@ 2017-07-12 23:04 ` Stephen Boyd
  2017-07-13  4:47   ` Bjorn Andersson
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2017-07-12 23:04 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Russell King, Michael Turquette, Dong Aisheng, open list:CLK API,
	open list

On 07/12, Bjorn Andersson wrote:
> This extends the existing set of bulk helpers with prepare_enable and
> disable_unprepare variants.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---

Looks good. I can stick this under a tag in clk tree if you like
so that it can be pulled into various driver trees?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: Provide bulk prepare_enable disable_unprepare variants
  2017-07-12 23:04 ` Stephen Boyd
@ 2017-07-13  4:47   ` Bjorn Andersson
  2017-07-13  6:49     ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Andersson @ 2017-07-13  4:47 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Russell King, Michael Turquette, Dong Aisheng, open list:CLK API,
	open list

On Wed 12 Jul 16:04 PDT 2017, Stephen Boyd wrote:

> On 07/12, Bjorn Andersson wrote:
> > This extends the existing set of bulk helpers with prepare_enable and
> > disable_unprepare variants.
> > 
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> 
> Looks good. I can stick this under a tag in clk tree if you like
> so that it can be pulled into various driver trees?
> 

Yes please, I have a number of drivers that I could get moved over for
v4.14.

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: Provide bulk prepare_enable disable_unprepare variants
  2017-07-13  4:47   ` Bjorn Andersson
@ 2017-07-13  6:49     ` Stephen Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2017-07-13  6:49 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Russell King, Michael Turquette, Dong Aisheng, open list:CLK API,
	open list

On 07/12, Bjorn Andersson wrote:
> On Wed 12 Jul 16:04 PDT 2017, Stephen Boyd wrote:
> 
> > On 07/12, Bjorn Andersson wrote:
> > > This extends the existing set of bulk helpers with prepare_enable and
> > > disable_unprepare variants.
> > > 
> > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > ---
> > 
> > Looks good. I can stick this under a tag in clk tree if you like
> > so that it can be pulled into various driver trees?
> > 
> 
> Yes please, I have a number of drivers that I could get moved over for
> v4.14.
> 

Actually, let's just send it off to Linus tomorrow and see if we
can merge it now. Should avoid lots of headache if we can merge
it into v4.13-rc1.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-13  6:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 22:04 [PATCH] clk: Provide bulk prepare_enable disable_unprepare variants Bjorn Andersson
2017-07-12 23:04 ` Stephen Boyd
2017-07-13  4:47   ` Bjorn Andersson
2017-07-13  6:49     ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).