All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support
@ 2014-04-14 18:33 Geert Uytterhoeven
  2014-04-14 18:33   ` Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-14 18:33 UTC (permalink / raw)
  To: linux-sh

This series adds support to control the MSTP clocks of the GPIO blocks
on R-Car Gen2 SoCs. Currently we depend on reset state / the bootloader to
have the right clocks enabled. If they're not enabled, GPIO will fail,
but not crash:
  - No heartbeat LED (if you had it enabled),
  - Keypad switches don't work,
  - System doesn't wake-up from suspend when pressing a keypad switch.

After applying this series, the MSTP clocks of the GPIO blocks will be
enabled automatically by runtime PM (or statically, if CONFIG_PM_RUNTIME=n)
during boot up.

  - [1/6] gpio: rcar: Add optional functional clock to bindings
  - [2/6] gpio: rcar: Add minimal runtime PM support
  - [3/6] ARM: shmobile: r8a7790 dtsi: Add GPIO clocks
  - [4/6] ARM: shmobile: r8a7791 dtsi: Add GPIO clocks
  - [5/6] ARM: shmobile: r8a7790 legacy: Add GPIO clocks
  - [6/6] ARM: shmobile: r8a7791 legacy: Add GPIO clocks

For legacy, this should work as-is.
For multiplatform, this needs a method to enable drivers/sh/pm_runtime.c to
actually work.

This was tested on r8a7791/Koelsch, both legacy and multiplatform.
The changes for r8a7790 were straight-forward.
R-Car Gen1 doesn't seem to be affected, at least the r8a7778 datasheet
doesn't mention MSTP bits for GPIO modules.

Thanks for applying!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings
  2014-04-14 18:33 [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support Geert Uytterhoeven
@ 2014-04-14 18:33   ` Geert Uytterhoeven
  2014-04-14 18:33   ` Geert Uytterhoeven
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-14 18:33 UTC (permalink / raw)
  To: Simon Horman, Magnus Damm
  Cc: linux-sh, Geert Uytterhoeven, Linus Walleij, Laurent Pinchart,
	linux-gpio, devicetree

From: Geert Uytterhoeven <geert+renesas@glider.be>

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: linux-gpio@vger.kernel.org
Cc: devicetree@vger.kernel.org
---
v2:
  - Functional clock is mandatory depending on hardware (thanks, Laurent)
---
 .../devicetree/bindings/gpio/renesas,gpio-rcar.txt |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
index f61cef74a212..941a26aa4322 100644
--- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
+++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
@@ -21,6 +21,12 @@ Required Properties:
     GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
   - gpio-ranges: Range of pins managed by the GPIO controller.
 
+Optional properties:
+
+  - clocks: Must contain a reference to the functional clock.  The property is
+    mandatory if the hardware implements a controllable functional clock for
+    the GPIO instance.
+
 Please refer to gpio.txt in this directory for details of gpio-ranges property
 and the common GPIO bindings used by client devices.
 
-- 
1.7.9.5


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

* [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings
@ 2014-04-14 18:33   ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-14 18:33 UTC (permalink / raw)
  To: Simon Horman, Magnus Damm
  Cc: linux-sh, Geert Uytterhoeven, Linus Walleij, Laurent Pinchart,
	linux-gpio, devicetree

From: Geert Uytterhoeven <geert+renesas@glider.be>

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: linux-gpio@vger.kernel.org
Cc: devicetree@vger.kernel.org
---
v2:
  - Functional clock is mandatory depending on hardware (thanks, Laurent)
---
 .../devicetree/bindings/gpio/renesas,gpio-rcar.txt |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
index f61cef74a212..941a26aa4322 100644
--- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
+++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
@@ -21,6 +21,12 @@ Required Properties:
     GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
   - gpio-ranges: Range of pins managed by the GPIO controller.
 
+Optional properties:
+
+  - clocks: Must contain a reference to the functional clock.  The property is
+    mandatory if the hardware implements a controllable functional clock for
+    the GPIO instance.
+
 Please refer to gpio.txt in this directory for details of gpio-ranges property
 and the common GPIO bindings used by client devices.
 
-- 
1.7.9.5


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

* [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
  2014-04-14 18:33 [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support Geert Uytterhoeven
@ 2014-04-14 18:33   ` Geert Uytterhoeven
  2014-04-14 18:33   ` Geert Uytterhoeven
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-14 18:33 UTC (permalink / raw)
  To: Simon Horman, Magnus Damm
  Cc: linux-sh, Geert Uytterhoeven, Linus Walleij, Laurent Pinchart,
	linux-gpio

From: Geert Uytterhoeven <geert+renesas@glider.be>

This is just enough to automatically enable the functional clock, if
present. Clock management during suspend/resume is still to be added.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: linux-gpio@vger.kernel.org
---
v2:
  - Use pm_runtime_put() instead of pm_runtime_put_sync()
---
 drivers/gpio/gpio-rcar.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 03c91482432c..bfcfeeefcf78 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -26,6 +26,7 @@
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/spinlock.h>
 #include <linux/slab.h>
 
@@ -377,6 +378,9 @@ static int gpio_rcar_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, p);
 
+	pm_runtime_enable(dev);
+	pm_runtime_get_sync(dev);
+
 	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 
@@ -460,6 +464,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
 err1:
 	irq_domain_remove(p->irq_domain);
 err0:
+	pm_runtime_put(dev);
+	pm_runtime_disable(dev);
 	return ret;
 }
 
@@ -473,6 +479,8 @@ static int gpio_rcar_remove(struct platform_device *pdev)
 		return ret;
 
 	irq_domain_remove(p->irq_domain);
+	pm_runtime_put(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
 	return 0;
 }
 
-- 
1.7.9.5


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

* [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
@ 2014-04-14 18:33   ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-14 18:33 UTC (permalink / raw)
  To: Simon Horman, Magnus Damm
  Cc: linux-sh, Geert Uytterhoeven, Linus Walleij, Laurent Pinchart,
	linux-gpio

From: Geert Uytterhoeven <geert+renesas@glider.be>

This is just enough to automatically enable the functional clock, if
present. Clock management during suspend/resume is still to be added.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: linux-gpio@vger.kernel.org
---
v2:
  - Use pm_runtime_put() instead of pm_runtime_put_sync()
---
 drivers/gpio/gpio-rcar.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 03c91482432c..bfcfeeefcf78 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -26,6 +26,7 @@
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/spinlock.h>
 #include <linux/slab.h>
 
@@ -377,6 +378,9 @@ static int gpio_rcar_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, p);
 
+	pm_runtime_enable(dev);
+	pm_runtime_get_sync(dev);
+
 	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 
@@ -460,6 +464,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
 err1:
 	irq_domain_remove(p->irq_domain);
 err0:
+	pm_runtime_put(dev);
+	pm_runtime_disable(dev);
 	return ret;
 }
 
@@ -473,6 +479,8 @@ static int gpio_rcar_remove(struct platform_device *pdev)
 		return ret;
 
 	irq_domain_remove(p->irq_domain);
+	pm_runtime_put(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
 	return 0;
 }
 
-- 
1.7.9.5


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

* Re: [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support
  2014-04-14 18:33 [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support Geert Uytterhoeven
  2014-04-14 18:33   ` Geert Uytterhoeven
  2014-04-14 18:33   ` Geert Uytterhoeven
@ 2014-04-14 23:06 ` Simon Horman
  2014-04-15  7:52 ` Geert Uytterhoeven
  3 siblings, 0 replies; 17+ messages in thread
From: Simon Horman @ 2014-04-14 23:06 UTC (permalink / raw)
  To: linux-sh

On Mon, Apr 14, 2014 at 08:33:11PM +0200, Geert Uytterhoeven wrote:
> This series adds support to control the MSTP clocks of the GPIO blocks
> on R-Car Gen2 SoCs. Currently we depend on reset state / the bootloader to
> have the right clocks enabled. If they're not enabled, GPIO will fail,
> but not crash:
>   - No heartbeat LED (if you had it enabled),
>   - Keypad switches don't work,
>   - System doesn't wake-up from suspend when pressing a keypad switch.
> 
> After applying this series, the MSTP clocks of the GPIO blocks will be
> enabled automatically by runtime PM (or statically, if CONFIG_PM_RUNTIME=n)
> during boot up.
> 
>   - [1/6] gpio: rcar: Add optional functional clock to bindings
>   - [2/6] gpio: rcar: Add minimal runtime PM support

I believe that the above two patches need to be merged
by Linus Walleij.

>   - [3/6] ARM: shmobile: r8a7790 dtsi: Add GPIO clocks
>   - [4/6] ARM: shmobile: r8a7791 dtsi: Add GPIO clocks

The above two dtsi patches appear to depend on the new binding added
by patch 1. If that is so please repost them once the binding has been
merged.

>   - [5/6] ARM: shmobile: r8a7790 legacy: Add GPIO clocks
>   - [6/6] ARM: shmobile: r8a7791 legacy: Add GPIO clocks
> 
> For legacy, this should work as-is.

For legacy, is patch 2 required in order for patches 5 and 6 to have
any effect?

> For multiplatform, this needs a method to enable drivers/sh/pm_runtime.c to
> actually work.
> 
> This was tested on r8a7791/Koelsch, both legacy and multiplatform.
> The changes for r8a7790 were straight-forward.
> R-Car Gen1 doesn't seem to be affected, at least the r8a7778 datasheet
> doesn't mention MSTP bits for GPIO modules.

Thanks, good to know.

> Thanks for applying!
> 
> Gr{oetje,eeting}s,
> 
> 						Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> 							    -- Linus Torvalds
> 

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

* Re: [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support
  2014-04-14 18:33 [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2014-04-14 23:06 ` [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support Simon Horman
@ 2014-04-15  7:52 ` Geert Uytterhoeven
  3 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-15  7:52 UTC (permalink / raw)
  To: linux-sh

Hi Simon,

On Tue, Apr 15, 2014 at 1:06 AM, Simon Horman <horms@verge.net.au> wrote:
> On Mon, Apr 14, 2014 at 08:33:11PM +0200, Geert Uytterhoeven wrote:
>> This series adds support to control the MSTP clocks of the GPIO blocks
>> on R-Car Gen2 SoCs. Currently we depend on reset state / the bootloader to
>> have the right clocks enabled. If they're not enabled, GPIO will fail,
>> but not crash:
>>   - No heartbeat LED (if you had it enabled),
>>   - Keypad switches don't work,
>>   - System doesn't wake-up from suspend when pressing a keypad switch.
>>
>> After applying this series, the MSTP clocks of the GPIO blocks will be
>> enabled automatically by runtime PM (or statically, if CONFIG_PM_RUNTIME=n)
>> during boot up.
>>
>>   - [1/6] gpio: rcar: Add optional functional clock to bindings
>>   - [2/6] gpio: rcar: Add minimal runtime PM support
>
> I believe that the above two patches need to be merged
> by Linus Walleij.

Indeed, that's why I CCed him.

>>   - [3/6] ARM: shmobile: r8a7790 dtsi: Add GPIO clocks
>>   - [4/6] ARM: shmobile: r8a7791 dtsi: Add GPIO clocks
>
> The above two dtsi patches appear to depend on the new binding added
> by patch 1. If that is so please repost them once the binding has been
> merged.

That's true. But it's just the standard way of specifying clocks. Not much
can go wrong there ;-)

>>   - [5/6] ARM: shmobile: r8a7790 legacy: Add GPIO clocks
>>   - [6/6] ARM: shmobile: r8a7791 legacy: Add GPIO clocks
>>
>> For legacy, this should work as-is.
>
> For legacy, is patch 2 required in order for patches 5 and 6 to have
> any effect?

Yes, without patch 2, all other patches are no-ops.
It doesn't hurt to apply them, though.

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings
  2014-04-14 18:33   ` Geert Uytterhoeven
@ 2014-04-15 15:56     ` Laurent Pinchart
  -1 siblings, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2014-04-15 15:56 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Linus Walleij, linux-gpio, devicetree

Hi Geert,

Thank you for the patch.

On Monday 14 April 2014 20:33:12 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org
> Cc: devicetree@vger.kernel.org

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2:
>   - Functional clock is mandatory depending on hardware (thanks, Laurent)
> ---
>  .../devicetree/bindings/gpio/renesas,gpio-rcar.txt |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt index
> f61cef74a212..941a26aa4322 100644
> --- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> +++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> @@ -21,6 +21,12 @@ Required Properties:
>      GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
>    - gpio-ranges: Range of pins managed by the GPIO controller.
> 
> +Optional properties:
> +
> +  - clocks: Must contain a reference to the functional clock.  The property
> is +    mandatory if the hardware implements a controllable functional
> clock for +    the GPIO instance.
> +
>  Please refer to gpio.txt in this directory for details of gpio-ranges
> property and the common GPIO bindings used by client devices.

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings
@ 2014-04-15 15:56     ` Laurent Pinchart
  0 siblings, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2014-04-15 15:56 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Linus Walleij, linux-gpio, devicetree

Hi Geert,

Thank you for the patch.

On Monday 14 April 2014 20:33:12 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org
> Cc: devicetree@vger.kernel.org

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2:
>   - Functional clock is mandatory depending on hardware (thanks, Laurent)
> ---
>  .../devicetree/bindings/gpio/renesas,gpio-rcar.txt |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt index
> f61cef74a212..941a26aa4322 100644
> --- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> +++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> @@ -21,6 +21,12 @@ Required Properties:
>      GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
>    - gpio-ranges: Range of pins managed by the GPIO controller.
> 
> +Optional properties:
> +
> +  - clocks: Must contain a reference to the functional clock.  The property
> is +    mandatory if the hardware implements a controllable functional
> clock for +    the GPIO instance.
> +
>  Please refer to gpio.txt in this directory for details of gpio-ranges
> property and the common GPIO bindings used by client devices.

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
  2014-04-14 18:33   ` Geert Uytterhoeven
@ 2014-04-16 11:26     ` Laurent Pinchart
  -1 siblings, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2014-04-16 11:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Linus Walleij, linux-gpio

Hi Geert,

Thank you for the patch.

On Monday 14 April 2014 20:33:13 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> This is just enough to automatically enable the functional clock, if
> present. Clock management during suspend/resume is still to be added.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2:
>   - Use pm_runtime_put() instead of pm_runtime_put_sync()
> ---
>  drivers/gpio/gpio-rcar.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
> index 03c91482432c..bfcfeeefcf78 100644
> --- a/drivers/gpio/gpio-rcar.c
> +++ b/drivers/gpio/gpio-rcar.c
> @@ -26,6 +26,7 @@
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/platform_data/gpio-rcar.h>
>  #include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/spinlock.h>
>  #include <linux/slab.h>
> 
> @@ -377,6 +378,9 @@ static int gpio_rcar_probe(struct platform_device *pdev)
> 
>  	platform_set_drvdata(pdev, p);
> 
> +	pm_runtime_enable(dev);
> +	pm_runtime_get_sync(dev);
> +
>  	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> 
> @@ -460,6 +464,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
> err1:
>  	irq_domain_remove(p->irq_domain);
>  err0:
> +	pm_runtime_put(dev);
> +	pm_runtime_disable(dev);
>  	return ret;
>  }
> 
> @@ -473,6 +479,8 @@ static int gpio_rcar_remove(struct platform_device
> *pdev) return ret;
> 
>  	irq_domain_remove(p->irq_domain);
> +	pm_runtime_put(&pdev->dev);
> +	pm_runtime_disable(&pdev->dev);
>  	return 0;
>  }

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
@ 2014-04-16 11:26     ` Laurent Pinchart
  0 siblings, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2014-04-16 11:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Linus Walleij, linux-gpio

Hi Geert,

Thank you for the patch.

On Monday 14 April 2014 20:33:13 Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> This is just enough to automatically enable the functional clock, if
> present. Clock management during suspend/resume is still to be added.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2:
>   - Use pm_runtime_put() instead of pm_runtime_put_sync()
> ---
>  drivers/gpio/gpio-rcar.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
> index 03c91482432c..bfcfeeefcf78 100644
> --- a/drivers/gpio/gpio-rcar.c
> +++ b/drivers/gpio/gpio-rcar.c
> @@ -26,6 +26,7 @@
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/platform_data/gpio-rcar.h>
>  #include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/spinlock.h>
>  #include <linux/slab.h>
> 
> @@ -377,6 +378,9 @@ static int gpio_rcar_probe(struct platform_device *pdev)
> 
>  	platform_set_drvdata(pdev, p);
> 
> +	pm_runtime_enable(dev);
> +	pm_runtime_get_sync(dev);
> +
>  	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> 
> @@ -460,6 +464,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
> err1:
>  	irq_domain_remove(p->irq_domain);
>  err0:
> +	pm_runtime_put(dev);
> +	pm_runtime_disable(dev);
>  	return ret;
>  }
> 
> @@ -473,6 +479,8 @@ static int gpio_rcar_remove(struct platform_device
> *pdev) return ret;
> 
>  	irq_domain_remove(p->irq_domain);
> +	pm_runtime_put(&pdev->dev);
> +	pm_runtime_disable(&pdev->dev);
>  	return 0;
>  }

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings
  2014-04-14 18:33   ` Geert Uytterhoeven
@ 2014-04-22 21:34     ` Linus Walleij
  -1 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2014-04-22 21:34 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Laurent Pinchart, linux-gpio, devicetree

On Mon, Apr 14, 2014 at 8:33 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:

> From: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> ---
> v2:
>   - Functional clock is mandatory depending on hardware (thanks, Laurent)

This v2 version applied with Laurent's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings
@ 2014-04-22 21:34     ` Linus Walleij
  0 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2014-04-22 21:34 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Laurent Pinchart, linux-gpio, devicetree

On Mon, Apr 14, 2014 at 8:33 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:

> From: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> ---
> v2:
>   - Functional clock is mandatory depending on hardware (thanks, Laurent)

This v2 version applied with Laurent's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
  2014-04-14 18:33   ` Geert Uytterhoeven
@ 2014-04-23  7:03     ` Linus Walleij
  -1 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2014-04-23  7:03 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Laurent Pinchart, linux-gpio

On Mon, Apr 14, 2014 at 8:33 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:

> From: Geert Uytterhoeven <geert+renesas@glider.be>
>
> This is just enough to automatically enable the functional clock, if
> present. Clock management during suspend/resume is still to be added.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org
> ---
> v2:
>   - Use pm_runtime_put() instead of pm_runtime_put_sync()

This v2 version applied with Laurent's ACK. I guess you wanted it
applied to the GPIO tree, I don't see the other patches.

Yours,
Linus Walleij

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

* Re: [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
@ 2014-04-23  7:03     ` Linus Walleij
  0 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2014-04-23  7:03 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Laurent Pinchart, linux-gpio

On Mon, Apr 14, 2014 at 8:33 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:

> From: Geert Uytterhoeven <geert+renesas@glider.be>
>
> This is just enough to automatically enable the functional clock, if
> present. Clock management during suspend/resume is still to be added.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: linux-gpio@vger.kernel.org
> ---
> v2:
>   - Use pm_runtime_put() instead of pm_runtime_put_sync()

This v2 version applied with Laurent's ACK. I guess you wanted it
applied to the GPIO tree, I don't see the other patches.

Yours,
Linus Walleij

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

* Re: [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
  2014-04-23  7:03     ` Linus Walleij
@ 2014-04-23  7:13       ` Geert Uytterhoeven
  -1 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-23  7:13 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Laurent Pinchart, linux-gpio

Hi Linus,

On Wed, Apr 23, 2014 at 9:03 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Apr 14, 2014 at 8:33 PM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>> From: Geert Uytterhoeven <geert+renesas@glider.be>
>>
>> This is just enough to automatically enable the functional clock, if
>> present. Clock management during suspend/resume is still to be added.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
>> Cc: linux-gpio@vger.kernel.org
>> ---
>> v2:
>>   - Use pm_runtime_put() instead of pm_runtime_put_sync()
>
> This v2 version applied with Laurent's ACK. I guess you wanted it
> applied to the GPIO tree, I don't see the other patches.

Thanks, yes that was the idea.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
@ 2014-04-23  7:13       ` Geert Uytterhoeven
  0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2014-04-23  7:13 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Simon Horman, Magnus Damm, linux-sh, Geert Uytterhoeven,
	Laurent Pinchart, linux-gpio

Hi Linus,

On Wed, Apr 23, 2014 at 9:03 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Apr 14, 2014 at 8:33 PM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>> From: Geert Uytterhoeven <geert+renesas@glider.be>
>>
>> This is just enough to automatically enable the functional clock, if
>> present. Clock management during suspend/resume is still to be added.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
>> Cc: linux-gpio@vger.kernel.org
>> ---
>> v2:
>>   - Use pm_runtime_put() instead of pm_runtime_put_sync()
>
> This v2 version applied with Laurent's ACK. I guess you wanted it
> applied to the GPIO tree, I don't see the other patches.

Thanks, yes that was the idea.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2014-04-23  7:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 18:33 [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support Geert Uytterhoeven
2014-04-14 18:33 ` [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings Geert Uytterhoeven
2014-04-14 18:33   ` Geert Uytterhoeven
2014-04-15 15:56   ` Laurent Pinchart
2014-04-15 15:56     ` Laurent Pinchart
2014-04-22 21:34   ` Linus Walleij
2014-04-22 21:34     ` Linus Walleij
2014-04-14 18:33 ` [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support Geert Uytterhoeven
2014-04-14 18:33   ` Geert Uytterhoeven
2014-04-16 11:26   ` Laurent Pinchart
2014-04-16 11:26     ` Laurent Pinchart
2014-04-23  7:03   ` Linus Walleij
2014-04-23  7:03     ` Linus Walleij
2014-04-23  7:13     ` Geert Uytterhoeven
2014-04-23  7:13       ` Geert Uytterhoeven
2014-04-14 23:06 ` [PATCH v2 0/6] ARM: shmobile: Add rcar-gpio clock support Simon Horman
2014-04-15  7:52 ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.