Hi! I am using a iMX8DX Colibri SoM with an Iris V2 board. I want to set up a set of pins as gpio-keys. I could handle 4 of them but I’m having troubles setting up 2 more. For the sake of brevity I’m leaving out from the examples the pins that did work.
I have tried and failed with UART0_RX (SODIMM 36), UART0_TX (SODIMM 38), SPI2_SCK (SODIMM 88), SPI2_CS0 (SODIMM 86). Ideally I would use the first two, so here I’ll explain what I did for them.
First of all UART0_TX and UART0_RX are part of the pinctrl_lpuart0, so I disabled lpuart0:
&lpuart0 {
status = "disabled";
};
And then configured them as gpio-keys:
/ {
model = "Toradex Colibri iMX8DX on Colibri Iris V2 Board, my own changes";
compatible = "toradex,colibri-imx8x-iris-v2",
"toradex,colibri-imx8x",
"fsl,imx8qxp", "fsl,imx8dx";
/* gpio-keys */
gpio-keys-2 {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpiokeys_2>;
right_key {
label = "Right-key";
gpios = <&lsio_gpio1 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
linux,code = <KEY_RIGHT>;
debounce-interval = <10>;
};
down_key {
label = "Left-key";
gpios = <&lsio_gpio1 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
linux,code = <KEY_LEFT>;
debounce-interval = <10>;
};
};
};
&iomuxc {
pinctrl_gpiokeys_2: gpiokeysgrp2 {
fsl,pins = <
IMX8QXP_UART0_RX_LSIO_GPIO1_IO21 0x26000020 /* SODIMM 36, right key */
IMX8QXP_UART0_TX_LSIO_GPIO1_IO22 0x26000020 /* SODIMM 38, left key */
>;
};
};
The pinmuxing value I took it from NXP’s IMX8DQXPRM.pdf aka “i.MX 8DualX/… Applications Processor Reference Manual”
In this case:
Bits 29 to 27: 100b aka LSIO_GPIO1_IO21
Bits 26-25: 11b aka INOUT
Bits 6-5: 01b aka pull up.
Once the dtb is compiled and loaded I can see that:
SODIMM 36 aka iris v2’s X16 pin 31 is at 3.2V
SODIMM 38 aka iris v2’s X16 pin 32 is at GND.
And showkeys won’t see any changes if I put the to GND.
The same exercise can be done with SPI2_[SCK CS0 RXD TXD] pins.
What am I missing here?