Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-13 Thread Shawn Guo
On Thu, Jan 12, 2012 at 04:04:23PM -0800, Saravana Kannan wrote: While the original clk_hw suggestion was well intentioned, it just forces too many unnecessary dereferences and indirection. It also prevents static init of some fields as others have mentioned. Overall, it made the MSM clock

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-13 Thread Saravana Kannan
On 12/17/2011 03:04 AM, Russell King - ARM Linux wrote: On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixnert...@linutronix.de wrote: On Tue, 13 Dec 2011, Mike Turquette wrote: +void __clk_unprepare(struct clk *clk) +{ + if

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-13 Thread Turquette, Mike
On Fri, Jan 13, 2012 at 8:18 PM, Saravana Kannan skan...@codeaurora.org wrote: On 12/17/2011 03:04 AM, Russell King - ARM Linux wrote: On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixnert...@linutronix.de  wrote: On Tue, 13 Dec

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-13 Thread Saravana Kannan
On 01/13/2012 08:39 PM, Turquette, Mike wrote: On Fri, Jan 13, 2012 at 8:18 PM, Saravana Kannanskan...@codeaurora.org wrote: On 12/17/2011 03:04 AM, Russell King - ARM Linux wrote: On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-12 Thread Amit Kucheria
On 12 Jan 04, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:11 PM, Rob Herring robherri...@gmail.com wrote: On 01/04/2012 07:01 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:32 AM, Rob Herring robherri...@gmail.com wrote: On 01/03/2012 08:15 PM, Richard Zhao wrote: On Fri, Dec 16,

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-12 Thread Saravana Kannan
On 01/04/2012 08:07 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:11 PM, Rob Herringrobherri...@gmail.com wrote: On 01/04/2012 07:01 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:32 AM, Rob Herringrobherri...@gmail.com wrote: On 01/03/2012 08:15 PM, Richard Zhao wrote: On Fri,

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-12 Thread Rob Herring
On 01/12/2012 06:04 PM, Saravana Kannan wrote: On 01/04/2012 08:07 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:11 PM, Rob Herringrobherri...@gmail.com wrote: On 01/04/2012 07:01 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:32 AM, Rob Herringrobherri...@gmail.com wrote: On

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-12 Thread Saravana Kannan
On 01/12/2012 04:48 PM, Rob Herring wrote: On 01/12/2012 06:04 PM, Saravana Kannan wrote: On 01/04/2012 08:07 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:11 PM, Rob Herringrobherri...@gmail.com wrote: On 01/04/2012 07:01 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:32 AM, Rob

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-04 Thread Rob Herring
On 01/03/2012 08:15 PM, Richard Zhao wrote: On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixner t...@linutronix.de wrote: On Tue, 13 Dec 2011, Mike Turquette wrote: snip +/** + * clk_init - initialize the data structures in a

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-04 Thread Turquette, Mike
On Wed, Jan 4, 2012 at 6:32 AM, Rob Herring robherri...@gmail.com wrote: On 01/03/2012 08:15 PM, Richard Zhao wrote: On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixner t...@linutronix.de wrote: On Tue, 13 Dec 2011, Mike Turquette

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-04 Thread Rob Herring
On 01/04/2012 07:01 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:32 AM, Rob Herring robherri...@gmail.com wrote: On 01/03/2012 08:15 PM, Richard Zhao wrote: On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixner

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-04 Thread Turquette, Mike
On Wed, Jan 4, 2012 at 6:11 PM, Rob Herring robherri...@gmail.com wrote: On 01/04/2012 07:01 PM, Turquette, Mike wrote: On Wed, Jan 4, 2012 at 6:32 AM, Rob Herring robherri...@gmail.com wrote: On 01/03/2012 08:15 PM, Richard Zhao wrote: On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2012-01-03 Thread Richard Zhao
On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixner t...@linutronix.de wrote: On Tue, 13 Dec 2011, Mike Turquette wrote: +void __clk_unprepare(struct clk *clk) +{ +     if (!clk) +             return; + +     if

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2011-12-17 Thread Russell King - ARM Linux
On Fri, Dec 16, 2011 at 04:45:48PM -0800, Turquette, Mike wrote: On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixner t...@linutronix.de wrote: On Tue, 13 Dec 2011, Mike Turquette wrote: +void __clk_unprepare(struct clk *clk) +{ +     if (!clk) +             return; + +     if

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2011-12-16 Thread Turquette, Mike
On Wed, Dec 14, 2011 at 5:18 AM, Thomas Gleixner t...@linutronix.de wrote: On Tue, 13 Dec 2011, Mike Turquette wrote: +void __clk_unprepare(struct clk *clk) +{ +     if (!clk) +             return; + +     if (WARN_ON(clk-prepare_count == 0)) +             return; + +     if

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2011-12-14 Thread Thomas Gleixner
On Tue, 13 Dec 2011, Mike Turquette wrote: +void __clk_unprepare(struct clk *clk) +{ + if (!clk) + return; + + if (WARN_ON(clk-prepare_count == 0)) + return; + + if (--clk-prepare_count 0) + return; + + WARN_ON(clk-enable_count 0);

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2011-12-14 Thread Turquette, Mike
On Tue, Dec 13, 2011 at 8:52 PM, Ryan Mallon rmal...@gmail.com wrote: On 14/12/11 14:53, Mike Turquette wrote: +void __clk_unprepare(struct clk *clk) +{ +     if (!clk) +             return; + +     if (WARN_ON(clk-prepare_count == 0)) +             return; + +     if

[PATCH v4 3/6] clk: introduce the common clock framework

2011-12-13 Thread Mike Turquette
The common clk framework is an attempt to define a common struct clk which can be used by most platforms, and an API that drivers can always use safely for managing clks. The net result is consolidation of many different struct clk definitions and platform-specific clk framework implementations.

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2011-12-13 Thread Ryan Mallon
On 14/12/11 14:53, Mike Turquette wrote: The common clk framework is an attempt to define a common struct clk which can be used by most platforms, and an API that drivers can always use safely for managing clks. The net result is consolidation of many different struct clk definitions and

Re: [PATCH v4 3/6] clk: introduce the common clock framework

2011-12-13 Thread Richard Zhao
Hi Mike, + * + * @recalc_rate Recalculate the rate of this clock, by quering hardware + * and/or the clock's parent. It is up to the caller to insure + * that the prepare_mutex is held across this call. Returns the + * calculated rate. Optional, but