Hi,
I've been following this guide: https://www.emcraft.com/som/vf6/controlling-gpio-from-linux
trying to add a keypad to my imx8mm based board.
I added this to my device tree:
[...]
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_keys>;
col0_btn {
label = "COL0_BTN";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
gpio-key,wakeup;
linux,code = <BTN_0>;
};
};
[...]
&iomuxc {
pinctrl_gpio_keys: keys0grp {
fsl,pins = <
MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x1d6 /* KEY_C0 */
>;
};
[...]
Checking with 'gpioinfo' command in linux:
root@asdf:~# gpioinfo 0
gpiochip0 - 32 lines:
line 0: unnamed unused input active-high
line 1: unnamed unused input active-high
line 2: unnamed unused input active-high
line 3: unnamed "interrupt" input active-high [used]
line 4: unnamed unused input active-high
line 5: unnamed "COL0_BTN" input active-low [used]
Looks good.
Checking with evtest /dev/input/event0
root@asdf:/# evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 256 (BTN_0)
Properties:
Testing ... (interrupt to exit)
However, no push of the button is ever registered. I'm wondering if somehow the mapping between
gpios = <&gpio1 5 GPIO_ACTIVE_LOW> and MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5 is incorrect and is something other than what seems obvious?