using gpio-keys on ccimx8x-sbc-pro

Hi guys,
I’m trying to get some keyboard events on my ccimx8x-sbc-pro, by using gpio.
I wish I have linux event <59> (corresponding to F1 touche) when I set GPIO05_IO09 to the ground.

To achieve this, i’ve added the following lines in ccimx8x-wb.dtsi, right after reg_rf_bt_en: regulator-som@6 propertie :

gpio-keys {
		compatible = "gpio-keys";
		status = "okay";

		f1 {
			label = "F1Key";
			linux,code = &lt;59&gt;;
			gpios = &lt;&amp;gpio5 9 0&gt;;

when I use my newly compiled dtb, I can’t see the gpio-key propertie …

  1. I have set CONFIG_KEYBOARD_GPIO=y kernel option
  2. I’ve tried to commment / uncomment SC_P_ENET0_REFCLK_125M_25M_LSIO_GPIO5_IO09 line in pinctrl_expansion: expansiongrp

Can anyone tell me what I’m missing ?


do sysinfo and it will generate a file, download it to a PC and extract. Do you see CONFIG_KEYBOARD_GPIO=y

it was the 1st indication I gave in my question :

  1. I have set CONFIG_KEYBOARD_GPIO=y kernel option

And I can confirm that sysinfo is OK with that.

I was loading the wrong dtb file in uboot…
someting, the env ‘fdt_file’ seems to be erased and I still don’t know why.

In the end, I’ve been able to catch gpio-keys and I how my question helps anyone who is looking to achive the same !

yes, just wanted to make sure your changes are making it in to the final image. So you are all set now?

yes I am !
thanks for your support

solved by the customer