在对应的设备树添加:
keypad {
compatible = "gpio-matrix-keypad";
pinctrl-names = "default";
pinctrl-0 = <&GPIO3_A1_pin
&GPIO1_D3_pin
&GPIO1_D4_pin
&GPIO1_C7_pin
&GPIO1_D2_pin
&GPIO1_D1_pin
&GPIO1_D0_pin
&GPIO3_A2_pin>;
debounce-delay-ms = <20>;
col-scan-delay-us = <400>;
row-gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_LOW
&gpio1 RK_PC7 GPIO_ACTIVE_LOW
&gpio1 RK_PD2 GPIO_ACTIVE_LOW
&gpio1 RK_PD0 GPIO_ACTIVE_LOW>;
col-gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW
&gpio1 RK_PD3 GPIO_ACTIVE_LOW
&gpio1 RK_PD1 GPIO_ACTIVE_LOW
&gpio3 RK_PA2 GPIO_ACTIVE_LOW>;
linux,keymap = <
0x00000002
0x00010003
0x00020004
0x0003001E
0x01000005
0x01010006
0x01020007
0x01030030
0x02000008
0x02