linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] DT: kirkwood: Fix Openblock A6 external GPIO pins
@ 2016-08-15  1:35 Jason Cooper
  2016-08-15 14:51 ` [PATCH] " Jason Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Cooper @ 2016-08-15  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

By assigning the pin hog to the pinctrl node, we correctly configure the
MPPs.  However, they are not available to userspace.

Fix this by assigning the hogs to the gpio node.

After this, the following works as expected:

  # echo 28 >/sys/class/gpio/export
  # echo low >/sys/class/gpio/gpio28/direction

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
I'm submitting this as RFC because it's clear no one is using this, so I'm not
sure how far we need to take this.  The dip switches should probably be under
gpio-keys to make them input only.  Thoughts?

thx,

Jason.

 arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
index 0db0e3edc88f..ddb17b1cdfe0 100644
--- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
+++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
@@ -41,9 +41,6 @@
 		};
 
 		pinctrl: pin-controller at 10000 {
-			pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>;
-			pinctrl-names = "default";
-
 			pmx_uart0: pmx-uart0 {
 				marvell,pins = "mpp10", "mpp11", "mpp15",
 					"mpp16";
@@ -174,3 +171,10 @@
 		phy-handle = <&ethphy0>;
 	};
 };
+
+&gpio0 {
+	status = "okay";
+
+	pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>;
+	pinctrl-names = "default";
+};
-- 
2.9.2

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

* [PATCH] DT: kirkwood: Fix Openblock A6 external GPIO pins
  2016-08-15  1:35 [RFC PATCH] DT: kirkwood: Fix Openblock A6 external GPIO pins Jason Cooper
@ 2016-08-15 14:51 ` Jason Cooper
  2016-08-17 14:46   ` Andrew Lunn
  2016-08-26  9:17   ` Gregory CLEMENT
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Cooper @ 2016-08-15 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

By assigning the pin hog to the pinctrl node, we correctly configure the
MPPs.  However, they are not available to userspace.

Fix this by assigning the hogs to the gpio node.

After this, the following works as expected:

  # echo 28 >/sys/class/gpio/export
  # echo low >/sys/class/gpio/gpio28/direction

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
After sleeping on it a night, I decided to leave the dip switches alone.

 arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
index 0db0e3edc88f..94e49f32d5f9 100644
--- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
+++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
@@ -41,7 +41,7 @@
 		};
 
 		pinctrl: pin-controller at 10000 {
-			pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>;
+			pinctrl-0 = <&pmx_dip_switches>;
 			pinctrl-names = "default";
 
 			pmx_uart0: pmx-uart0 {
@@ -174,3 +174,10 @@
 		phy-handle = <&ethphy0>;
 	};
 };
+
+&gpio0 {
+	status = "okay";
+
+	pinctrl-0 = <&pmx_gpio_header>;
+	pinctrl-names = "default";
+};
-- 
2.9.2

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

* [PATCH] DT: kirkwood: Fix Openblock A6 external GPIO pins
  2016-08-15 14:51 ` [PATCH] " Jason Cooper
@ 2016-08-17 14:46   ` Andrew Lunn
  2016-08-26  9:17   ` Gregory CLEMENT
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2016-08-17 14:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 15, 2016 at 02:51:04PM +0000, Jason Cooper wrote:
> By assigning the pin hog to the pinctrl node, we correctly configure the
> MPPs.  However, they are not available to userspace.
> 
> Fix this by assigning the hogs to the gpio node.
> 
> After this, the following works as expected:
> 
>   # echo 28 >/sys/class/gpio/export
>   # echo low >/sys/class/gpio/gpio28/direction
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* [PATCH] DT: kirkwood: Fix Openblock A6 external GPIO pins
  2016-08-15 14:51 ` [PATCH] " Jason Cooper
  2016-08-17 14:46   ` Andrew Lunn
@ 2016-08-26  9:17   ` Gregory CLEMENT
  1 sibling, 0 replies; 4+ messages in thread
From: Gregory CLEMENT @ 2016-08-26  9:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,
 
 On lun., ao?t 15 2016, Jason Cooper <jason@lakedaemon.net> wrote:

> By assigning the pin hog to the pinctrl node, we correctly configure the
> MPPs.  However, they are not available to userspace.
>
> Fix this by assigning the hogs to the gpio node.
>
> After this, the following works as expected:
>
>   # echo 28 >/sys/class/gpio/export
>   # echo low >/sys/class/gpio/gpio28/direction
>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

Applied on mvebu/dt with Reviewed-by flag from Andrew and I changed the
title to "ARM: dts: kirkwood: ..."

Thanks,

Gregory
> ---
> After sleeping on it a night, I decided to leave the dip switches alone.
>
>  arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
> index 0db0e3edc88f..94e49f32d5f9 100644
> --- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
> +++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
> @@ -41,7 +41,7 @@
>  		};
>  
>  		pinctrl: pin-controller at 10000 {
> -			pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>;
> +			pinctrl-0 = <&pmx_dip_switches>;
>  			pinctrl-names = "default";
>  
>  			pmx_uart0: pmx-uart0 {
> @@ -174,3 +174,10 @@
>  		phy-handle = <&ethphy0>;
>  	};
>  };
> +
> +&gpio0 {
> +	status = "okay";
> +
> +	pinctrl-0 = <&pmx_gpio_header>;
> +	pinctrl-names = "default";
> +};
> -- 
> 2.9.2
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2016-08-26  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-15  1:35 [RFC PATCH] DT: kirkwood: Fix Openblock A6 external GPIO pins Jason Cooper
2016-08-15 14:51 ` [PATCH] " Jason Cooper
2016-08-17 14:46   ` Andrew Lunn
2016-08-26  9:17   ` Gregory CLEMENT

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).