Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: am437x-idk: add gpio-based power key

AM437x IDK board has a User Switch which we can
program to whatever we want. Because this board
doesn't have a PMIC which can give us power button
presses, let's use this user switch as a gpio-keys
power button.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by

Felipe Balbi and committed by
Tony Lindgren
cd5bca6f f4b36909

+24
+24
arch/arm/boot/dts/am437x-idk-evm.dts
··· 96 96 regulator-boot-on; 97 97 vin-supply = <&v1_5dreg>; 98 98 }; 99 + 100 + gpio_keys: gpio_keys { 101 + compatible = "gpio-keys"; 102 + pinctrl-names = "default"; 103 + pinctrl-0 = <&gpio_keys_pins_default>; 104 + #address-cells = <1>; 105 + #size-cells = <0>; 106 + 107 + switch@0 { 108 + label = "power-button"; 109 + linux,code = <KEY_POWER>; 110 + gpios = <&gpio4 2 GPIO_ACTIVE_LOW>; 111 + }; 112 + }; 99 113 }; 100 114 101 115 &am43xx_pinmux { 116 + gpio_keys_pins_default: gpio_keys_pins_default { 117 + pinctrl-single,pins = < 118 + 0x1b8 (PIN_INPUT | MUX_MODE7) /* cam0_field.gpio4_2 */ 119 + >; 120 + }; 121 + 102 122 i2c0_pins_default: i2c0_pins_default { 103 123 pinctrl-single,pins = < 104 124 0x188 (PIN_INPUT | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_sda.i2c0_sda */ ··· 299 279 }; 300 280 301 281 &gpio1 { 282 + status = "okay"; 283 + }; 284 + 285 + &gpio4 { 302 286 status = "okay"; 303 287 }; 304 288