DT: kirkwood: Fix Openblock A6 external GPIO pins
RFC PATCH 1/1 DT: kirkwood: Fix Openblock A6 external GPIO pins
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
---
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(-)
arch/arm/boot/dts/kirkwood-openblocks_a6.dts +7 -3
@@ -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 = <ðphy0>; }; }; + +&gpio0 { + status = "okay"; + + pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>; + pinctrl-names = "default"; +};
Signature · 1 line
2.9.2
PATCH 1/1 DT: kirkwood: Fix Openblock A6 external GPIO pins
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
---
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(-)
arch/arm/boot/dts/kirkwood-openblocks_a6.dts +8 -1
@@ -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 = <ðphy0>; }; }; + +&gpio0 { + status = "okay"; + + pinctrl-0 = <&pmx_gpio_header>; + pinctrl-names = "default"; +};
Signature · 1 line
2.9.2
PATCH 1/1 DT: kirkwood: Fix Openblock A6 external GPIO pins
Quoted 11 lines · Jason Cooper
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/directionSigned-off-by Jason Cooper <[email protected]>
Andrew
PATCH 1/1 DT: kirkwood: Fix Openblock A6 external GPIO pins
In reply to Jason CooperHi Jason,
Quoted 11 lines · Jason Cooper
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/directionSigned-off-by Jason Cooper <[email protected]>
Applied on mvebu/dt with Reviewed-by flag from Andrew and I changed the title to "ARM: dts: kirkwood: ..."
Thanks,
Gregory
Quoted 33 lines
---
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(-)arch/arm/boot/dts/kirkwood-openblocks_a6.dts +8
-1@@ -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 = <ðphy0>; }; }; + +&gpio0 { + status = "okay"; + + pinctrl-0 = <&pmx_gpio_header>; + pinctrl-names = "default"; +};Signature · 1 line
2.9.2
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com