AnsweredAssumed Answered

imx8mq - how to use gpio-key input driver for android btn key

Question asked by sangwook kim on Apr 24, 2019
Latest reply on Apr 24, 2019 by Wigros Sun

hello.

Now, I'm using android O8.1.0_1.3.0 (nxp released) and customized board (added btn).

I want to use gpio-keys driver for android btn key

(home, back, volume_up, volume_down, prop - GPIO3_IO10  ~14)

so, added dts below for gpio-keys driver.

but, when I pushed btn key, i can't show any key event (power-key event work ok! -cat /dev/input/event0)

(#cat /dev/input/event1)

please my dts file and notice me.

how can i modify dts file ?

 

evk_8mq:/ $ cat /proc/bus/input/devices
I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="30370000.snvs:snvs-powerkey"
P: Phys=snvs-pwrkey/input0
S: Sysfs=/devices/platform/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
U: Uniq=
H: Handlers=kbd event0 keychord
B: PROP=0
B: EV=3
B: KEY=10000000000000 0

 

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input1
U: Uniq=
H: Handlers=kbd event1 keychord
B: PROP=0
B: EV=3
B: KEY=4 c004000000000 4000

 

 

/ {
 gpio-keys {
  status = "okay";
  compatible = "gpio-keys"; 
  pinctrl-names = "default"; 
  pinctrl-0 = <&pinctrl_gpio_keys>;
  interrupt-parent = <&gpio3>;
  interrupts = <10 11 12 13 14>;

  back {
    label = "BTN 1";
    gpios = <&gpio3 10 1>;
    //irq-gpios = <&gpio3 10 IRQ_TYPE_LEVEL_LOW>;
    gpio-key;
    linux,code = <KEY_BACKSPACE>;
  };  

  prop {
    label = "BTN 2";
    gpios = <&gpio3 11 1>;
    //irq-gpios = <&gpio3 11 IRQ_TYPE_LEVEL_LOW>;
    gpio-key,wakeup;
    linux,code = <KEY_PROPS>;
  };

  volume-up {
    label = "BTN 3";
    gpios = <&gpio3 12 1>;
    //irq-gpios = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
    gpio-key;
    linux,code = <KEY_VOLUMEUP>;
  };

  volume-down {
    label = "BTN 4";
    gpios = <&gpio3 13 1>;
    //irq-gpios = <&gpio3 13 IRQ_TYPE_LEVEL_LOW>;
    gpio-key;
    linux,code = <KEY_VOLUMEDOWN>;
  };

  home {
    label = "BTN 5";
    gpios = <&gpio3 14 1>;
    //irq-gpios = <&gpio3 14 IRQ_TYPE_LEVEL_LOW>;
    gpio-key;
    linux,code = <KEY_HOME>;
  };  
 };
};

 

&iomuxc {
 imx8mq-evk {

  pinctrl_gpio_keys: gpiokeys {
   fsl,pins = <
    MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10  0x16
    MX8MQ_IOMUXC_NAND_DATA05_GPIO3_IO11  0x16    
    MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12  0x16
    MX8MQ_IOMUXC_NAND_DATA07_GPIO3_IO13  0x16
    MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14  0x16    
   >;  
  };  
 };
};

Outcomes