ARM: dts: pcduino: Enable user LED and button support for pcDuino
Subsystems (2)
PATCH 1/1 ARM: dts: pcduino: Enable user LED and button support for pcDuino
The pcDuino board has LEDs connected to PH15/PH16, and back/home/menu buttons to PH17/18/19 respectively. Enable these via gpio-leds and gpio-keys. This is shared across the v1 and v2 versions of the board.
Tested on a v2 and verified against the schematics of a v1.
--- arch/arm/boot/dts/sun4i-a10-pcduino.dts | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)
arch/arm/boot/dts/sun4i-a10-pcduino.dts +57 -0
@@ -51,6 +51,8 @@ #include "sunxi-common-regulators.dtsi" #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/pinctrl/sun4i-a10.h> / { model = "LinkSprite pcDuino";
@@ -64,6 +66,22 @@ status = "okay"; }; + pinctrl at 01c20800 { + led_pins_pcduino: led_pins at 0 { + allwinner,pins = "PH15", "PH16"; + allwinner,function = "gpio_out"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + key_pins_pcduino: key_pins at 0 { + allwinner,pins = "PH17", "PH18", "PH19"; + allwinner,function = "gpio_in"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + }; + mdio at 01c0b080 { status = "okay";
@@ -126,6 +144,45 @@ }; }; + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_pcduino>; + + tx { + label = "pcduino:green:tx"; + gpios = <&pio 7 15 GPIO_ACTIVE_LOW>; + }; + + rx { + label = "pcduino:green:rx"; + gpios = <&pio 7 16 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&key_pins_pcduino>; + #address-cells = <1>; + #size-cells = <0>; + button at 0 { + label = "Key Back"; + linux,code = <KEY_BACK>; + gpios = <&pio 7 17 GPIO_ACTIVE_LOW>; + }; + button at 1 { + label = "Key Home"; + linux,code = <KEY_HOME>; + gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; + }; + button at 2 { + label = "Key Menu"; + linux,code = <KEY_MENU>; + gpios = <&pio 7 19 GPIO_ACTIVE_LOW>; + }; + }; + reg_usb1_vbus: usb1-vbus { status = "okay"; };
Signature · 1 line
1.7.10.4
PATCH 1/1 ARM: dts: pcduino: Enable user LED and button support for pcDuino
Hi,
Quoted 81 lines · Zoltan HERPAI
The pcDuino board has LEDs connected to PH15/PH16, and back/home/menu buttons to PH17/18/19 respectively. Enable these via gpio-leds and gpio-keys. This is shared across the v1 and v2 versions of the board.
Tested on a v2 and verified against the schematics of a v1.
Signed-off-by Zoltan HERPAI <[email protected]>Acked-by Hans de Goede <[email protected]>--- arch/arm/boot/dts/sun4i-a10-pcduino.dts | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)arch/arm/boot/dts/sun4i-a10-pcduino.dts +46
-0@@ -51,6 +51,8 @@ #include "sunxi-common-regulators.dtsi" #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/pinctrl/sun4i-a10.h> / { model = "LinkSprite pcDuino";@@ -64,6 +66,22 @@ status = "okay"; }; + pinctrl at 01c20800 { + led_pins_pcduino: led_pins at 0 { + allwinner,pins = "PH15", "PH16"; + allwinner,function = "gpio_out"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + + key_pins_pcduino: key_pins at 0 { + allwinner,pins = "PH17", "PH18", "PH19"; + allwinner,function = "gpio_in"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + }; + mdio at 01c0b080 { status = "okay";@@ -126,6 +144,45 @@ }; }; + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_pcduino>; + + tx { + label = "pcduino:green:tx"; + gpios = <&pio 7 15 GPIO_ACTIVE_LOW>; + }; + + rx { + label = "pcduino:green:rx"; + gpios = <&pio 7 16 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&key_pins_pcduino>; + #address-cells = <1>; + #size-cells = <0>; + button at 0 { + label = "Key Back"; + linux,code = <KEY_BACK>; + gpios = <&pio 7 17 GPIO_ACTIVE_LOW>; + }; + button at 1 {
arch/arm/boot/dts/sun4i-a10-pcduino.dts line 184
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-pcduino.dts +10
-0+ label = "Key Home"; + linux,code = <KEY_HOME>; + gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; + }; + button at 2 { + label = "Key Menu"; + linux,code = <KEY_MENU>; + gpios = <&pio 7 19 GPIO_ACTIVE_LOW>; + }; + };
Some newlines here would have been nice between the button nodes. I added them and applied the patch.
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150108/2711bcce/attachment.sig>
PATCH 1/1 ARM: dts: pcduino: Enable user LED and button support for pcDuino
Hi Maxime,
Quoted 17 lines · Maxime Ripard
Quoted 17 lines
arch/arm/boot/dts/sun4i-a10-pcduino.dts +17
-0+ gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&key_pins_pcduino>; + #address-cells = <1>; + #size-cells = <0>; + button at 0 { + label = "Key Back"; + linux,code = <KEY_BACK>; + gpios = <&pio 7 17 GPIO_ACTIVE_LOW>; + }; + button at 1 { + label = "Key Home"; + linux,code = <KEY_HOME>; + gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; + }; + button at 2 {
Quoted 8 lines
arch/arm/boot/dts/sun4i-a10-pcduino.dts line 184
Quoted 5 lines
arch/arm/boot/dts/sun4i-a10-pcduino.dts +5
-0+ label = "Key Menu"; + linux,code = <KEY_MENU>; + gpios = <&pio 7 19 GPIO_ACTIVE_LOW>; + }; + };Some newlines here would have been nice between the button nodes. I added them and applied the patch.
First I did it with newlines between the nodes, then spotted that many of the button specs in other DTSes are without them, so I just removed them. Thanks for applying anyway!
Regards,
Zoltan H