Skip to content

Commit cd5bca6

Browse files
Felipe Balbitmlind
authored andcommitted
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>
1 parent f4b3690 commit cd5bca6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

arch/arm/boot/dts/am437x-idk-evm.dts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,29 @@
9696
regulator-boot-on;
9797
vin-supply = <&v1_5dreg>;
9898
};
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+
};
99113
};
100114

101115
&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+
102122
i2c0_pins_default: i2c0_pins_default {
103123
pinctrl-single,pins = <
104124
0x188 (PIN_INPUT | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_sda.i2c0_sda */
@@ -282,6 +302,10 @@
282302
status = "okay";
283303
};
284304

305+
&gpio4 {
306+
status = "okay";
307+
};
308+
285309
&gpio5 {
286310
status = "okay";
287311
};

0 commit comments

Comments
 (0)