I am using Colibri iMX7 with Torizon and trying to configure SODIMM_101 (GPIO4_IO16) as a push button input but it always reads low.
- Verified gpio-keys node exists and uses SODIMM_101:
cat /proc/bus/input/devices
N: Name=“gpio-keys”
H: Handlers=kbd event0
2.Checked current GPIO state:
cat /sys/kernel/debug/gpio | grep 112
gpio-112 (SODIMM_101 | push_button_101) in lo ACTIVE LOW
3.Dumped active device tree:
dtc -I fs -O dts /sys/firmware/devicetree/base > /tmp/current.dts
grep -A10 gpiokeysgrp /tmp/current.dts
Found MX7D_PAD_SD1_CLK assigned in gpiokeysgrp.
4.cat /sys/kernel/debug/pinctrl/30330000.pinctrl/pinconf-pins | grep 101
pin 101 (MX7D_PAD_SD1_CLK): 0x19
5.button.dts
/dts-v1/;
/plugin/;
/* Disable conflicting controllers /
&usdhc1 {
status = “disabled”; / Frees SD2_RESET_B /
};
&ecspi1 {
status = “disabled”; / Free ECSPI1_SCLK for push button */
};
&pinctrl_gpio2 {
status = “disabled”;
};
&iomuxc {
/* Pinmux for SODIMM_101 (Input for push button) /
pinctrl_sodimm101_button: sodimm101buttongrp {
fsl,pins = <
0x00000168 0x1b1 / ECSPI1_SCLK → GPIO4_IO16 (SODIMM_101) as input */
>;
};
};
gpio-keys {
compatible = “gpio-keys”;
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_sodimm101_button>;
status = “okay”;
button_101 {
label = "push_button_101";
gpios = <&gpio4 16 0>; /* SODIMM_101 */
linux,code = <28>; /* KEY_ENTER */
};
};
6)Tested with evtest and gpiomon. The gpio-keys device is created on event0, but pressing the button gives no event. My hardware works on Colibri iMX6 with the same footswitch on SODIMM_101, so this seems related to the pin configuration on iMX7.
Do I need to override the existing gpiokeysgrp or update pad control differently?