Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-05-08 Thread Dong Aisheng
On Fri, Apr 21, 2017 at 08:16:47PM -0700, Stephen Boyd wrote: > On 04/12, Dong Aisheng wrote: > > > > #ifdef CONFIG_HAVE_CLK > > @@ -230,6 +257,32 @@ static inline void clk_unprepare(struct clk *clk) > > struct clk *clk_get(struct device *dev, const char *id); > > > > /** > > + * clk_bulk_ge

Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-21 Thread Stephen Boyd
On 04/12, Dong Aisheng wrote: > > #ifdef CONFIG_HAVE_CLK > @@ -230,6 +257,32 @@ static inline void clk_unprepare(struct clk *clk) > struct clk *clk_get(struct device *dev, const char *id); > > /** > + * clk_bulk_get - lookup and obtain a number of references to clock producer. > + * @dev: de

Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-14 Thread Dong Aisheng
Hi Geert, On Thu, Apr 13, 2017 at 09:56:31PM +0200, Geert Uytterhoeven wrote: > On Wed, Apr 12, 2017 at 6:03 AM, Dong Aisheng wrote: > > --- a/drivers/clk/clk.c > > +++ b/drivers/clk/clk.c > > @@ -520,6 +520,23 @@ void clk_unprepare(struct clk *clk) > > } > > EXPORT_SYMBOL_GPL(clk_unprepare); >

Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-13 Thread Geert Uytterhoeven
On Tue, Apr 11, 2017 at 7:19 PM, Leonard Crestez wrote: > On Wed, 2017-04-12 at 12:03 +0800, Dong Aisheng wrote: >> +/** >> + * clk_bulk_enable - ungate a bulk of clocks >> + * @num_clks: the number of clk_bulk_data >> + * @clks: the clk_bulk_data table being ungated >> + * >> + * clk_bulk_enable

Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-13 Thread Geert Uytterhoeven
On Wed, Apr 12, 2017 at 6:03 AM, Dong Aisheng wrote: > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -520,6 +520,23 @@ void clk_unprepare(struct clk *clk) > } > EXPORT_SYMBOL_GPL(clk_unprepare); > > +/** > + * clk_bulk_unprepare - undo preparation of a bulk of clock sources > + * @num_c

Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-13 Thread Dong Aisheng
On Wed, Apr 12, 2017 at 12:03:27PM +0800, Dong Aisheng wrote: ... > @@ -445,6 +543,12 @@ static inline struct clk *clk_get(struct device *dev, > const char *id) > return NULL; > } > > +static inline int clk_bulk_get(struct device *dev, int num_clks, > +struct c

Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-13 Thread Dong Aisheng
On Tue, Apr 11, 2017 at 08:19:19PM +0300, Leonard Crestez wrote: > On Wed, 2017-04-12 at 12:03 +0800, Dong Aisheng wrote: > > +/** > > + * clk_bulk_enable - ungate a bulk of clocks > > + * @num_clks: the number of clk_bulk_data > > + * @clks: the clk_bulk_data table being ungated > > + * > > + * cl

Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-11 Thread Leonard Crestez
On Wed, 2017-04-12 at 12:03 +0800, Dong Aisheng wrote: > +/** > + * clk_bulk_enable - ungate a bulk of clocks > + * @num_clks: the number of clk_bulk_data > + * @clks: the clk_bulk_data table being ungated > + * > + * clk_bulk_enable must not sleep > + * Returns 0 on success, -EERROR otherwise. > +

[RFC PATCH 1/3] clk: add clk_bulk_get accessories

2017-04-11 Thread Dong Aisheng
These helper function allows drivers to get several clk consumers in one operation. If any of the clk cannot be acquired then any clks that were got will be put before returning to the caller. This can relieve the driver owners' life who needs to handle many clocks, as well as each clock error re