diff mbox

DT: kirkwood: Fix Openblock A6 external GPIO pins

Message ID 20160815145104.14135-1-jason@lakedaemon.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jason Cooper Aug. 15, 2016, 2:51 p.m. UTC
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(-)

Comments

Andrew Lunn Aug. 17, 2016, 2:46 p.m. UTC | #1
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
Gregory CLEMENT Aug. 26, 2016, 9:17 a.m. UTC | #2
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@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
>
diff mbox

Patch

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@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";
+};