Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-06 Thread Ulf Hansson
On 2 May 2014 16:35, Geert Uytterhoeven ge...@linux-m68k.org wrote: Hi Ulf, On Fri, May 2, 2014 at 10:56 AM, Ulf Hansson ulf.hans...@linaro.org wrote: +static int of_clk_pm_runtime_suspend(struct device *dev) +{ + int ret; + + ret = pm_generic_runtime_suspend(dev); + if

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-06 Thread Ulf Hansson
On 2 May 2014 16:58, Geert Uytterhoeven ge...@linux-m68k.org wrote: Hi Ulf, Tomasz, On Fri, May 2, 2014 at 10:13 AM, Ulf Hansson ulf.hans...@linaro.org wrote: +static int of_clk_register(struct device *dev, struct clk *clk) +{ + int error; + + if (!dev-pm_domain) { +

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-02 Thread Ulf Hansson
Normally I don't think it's a good idea to automatically manage clocks from PM core or any other place but from the driver (and possibly the subsystem). The reason is simply that we hide things that normally is supposed to be handled by the driver. Typically a cross SOC driver should work

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-02 Thread Ulf Hansson
Hi Geert, Some more review comments. + + +#ifdef CONFIG_PM_RUNTIME + +static int of_clk_pm_runtime_suspend(struct device *dev) +{ + int ret; + + ret = pm_generic_runtime_suspend(dev); + if (ret) + return ret; + + ret = pm_clk_suspend(dev);

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-02 Thread Geert Uytterhoeven
Hi Ulf, Tomasz, On Fri, May 2, 2014 at 10:13 AM, Ulf Hansson ulf.hans...@linaro.org wrote: +static int of_clk_register(struct device *dev, struct clk *clk) +{ + int error; + + if (!dev-pm_domain) { + error = pm_clk_create(dev); + if (error) +

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-01 Thread Grant Likely
On Wed, 30 Apr 2014 23:54:37 +0200, Geert Uytterhoeven ge...@linux-m68k.org wrote: Hi Grant, On Tue, Apr 29, 2014 at 3:16 PM, Grant Likely grant.lik...@secretlab.ca wrote: On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman khil...@linaro.org wrote: Geert Uytterhoeven

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-01 Thread Geert Uytterhoeven
Hi Grant, On Thu, May 1, 2014 at 10:03 AM, Grant Likely grant.lik...@secretlab.ca wrote: On Wed, 30 Apr 2014 23:54:37 +0200, Geert Uytterhoeven ge...@linux-m68k.org wrote: On Tue, Apr 29, 2014 at 3:16 PM, Grant Likely grant.lik...@secretlab.ca wrote: I also don't like that it tries to set

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-01 Thread Grant Likely
On Thu, May 1, 2014 at 2:41 PM, Geert Uytterhoeven ge...@linux-m68k.org wrote: Hi Grant, On Thu, May 1, 2014 at 10:03 AM, Grant Likely grant.lik...@secretlab.ca wrote: On Wed, 30 Apr 2014 23:54:37 +0200, Geert Uytterhoeven ge...@linux-m68k.org wrote: On Tue, Apr 29, 2014 at 3:16 PM, Grant

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-05-01 Thread Geert Uytterhoeven
Hi Grant, On Thu, May 1, 2014 at 3:56 PM, Grant Likely grant.lik...@secretlab.ca wrote: On Thu, May 1, 2014 at 2:41 PM, Geert Uytterhoeven ge...@linux-m68k.org wrote: On Thu, May 1, 2014 at 10:03 AM, Grant Likely grant.lik...@secretlab.ca wrote: On Wed, 30 Apr 2014 23:54:37 +0200, Geert

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-30 Thread Laurent Pinchart
Hi Ulf and Geert, On Thursday 24 April 2014 15:11:24 Ulf Hansson wrote: On 24 April 2014 12:13, Geert Uytterhoeven geert+rene...@glider.be wrote: When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM core. If Runtime PM is disabled,

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-30 Thread Laurent Pinchart
On Tuesday 29 April 2014 14:16:10 Grant Likely wrote: On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman khil...@linaro.org wrote: Geert Uytterhoeven geert+rene...@glider.be writes: When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-30 Thread Ben Dooks
On 30/04/14 14:25, Laurent Pinchart wrote: On Tuesday 29 April 2014 14:16:10 Grant Likely wrote: On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman khil...@linaro.org wrote: Geert Uytterhoeven geert+rene...@glider.be writes: When adding a device from DT, check if its clocks are suitable for

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-30 Thread Geert Uytterhoeven
Hi Kevin, On Sat, Apr 26, 2014 at 1:44 AM, Kevin Hilman khil...@linaro.org wrote: Geert Uytterhoeven geert+rene...@glider.be writes: When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM core. If Runtime PM is disabled, just enable the

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-30 Thread Geert Uytterhoeven
Hi Grant, On Tue, Apr 29, 2014 at 3:16 PM, Grant Likely grant.lik...@secretlab.ca wrote: On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman khil...@linaro.org wrote: Geert Uytterhoeven geert+rene...@glider.be writes: When adding a device from DT, check if its clocks are suitable for Runtime

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-30 Thread Geert Uytterhoeven
Hi Laurent, On Wed, Apr 30, 2014 at 11:23 PM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: On Thursday 24 April 2014 15:11:24 Ulf Hansson wrote: On 24 April 2014 12:13, Geert Uytterhoeven geert+rene...@glider.be wrote: When adding a device from DT, check if its clocks are

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-29 Thread Grant Likely
On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman khil...@linaro.org wrote: Geert Uytterhoeven geert+rene...@glider.be writes: When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM core. If Runtime PM is disabled, just enable the

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-25 Thread Kevin Hilman
Geert Uytterhoeven geert+rene...@glider.be writes: When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM core. If Runtime PM is disabled, just enable the clock. This allows the PM core to automatically manage gate clocks of devices for

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-25 Thread Tomasz Figa
On 24.04.2014 15:11, Ulf Hansson wrote: On 24 April 2014 12:13, Geert Uytterhoeven geert+rene...@glider.be wrote: When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM core. If Runtime PM is disabled, just enable the clock. This allows

[PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-24 Thread Geert Uytterhoeven
When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM core. If Runtime PM is disabled, just enable the clock. This allows the PM core to automatically manage gate clocks of devices for Runtime PM. Signed-off-by: Geert Uytterhoeven

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-24 Thread Ulf Hansson
On 24 April 2014 12:13, Geert Uytterhoeven geert+rene...@glider.be wrote: When adding a device from DT, check if its clocks are suitable for Runtime PM, and register them with the PM core. If Runtime PM is disabled, just enable the clock. This allows the PM core to automatically manage gate

Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core

2014-04-24 Thread Geert Uytterhoeven
Hi Ulf, On Thu, Apr 24, 2014 at 3:11 PM, Ulf Hansson ulf.hans...@linaro.org wrote: +static int of_clk_register(struct device *dev, struct clk *clk) +{ + int error; + + if (!dev-pm_domain) { + error = pm_clk_create(dev); + if (error) +