1、增加pinctrl
LA.UM.9.15.2/kernel/msm-4.19/arch/arm64/boot/dts/qcom/sc12x-evk/scuba-pinctrl.dtsi
&soc {
tlmm: pinctrl@500000 {
...
gpio_key_1: gpio_key_1 {
mux {
pins = "gpio104";
function = "gpio";
};
config {
pins = "gpio104";
drive-strength = <2>;
bias-pull-up;
input-enable;
};
}
...
}
}
2、在gpio_keys节点下面增加按键
LA.UM.9.15.2/kernel/msm-4.19/arch/arm64/boot/dts/qcom/sc12x-evk/scuba.dtsi
&soc {
...
gpio_keys {
...
pinctrl-2 = <&gpio_key_1>;
key_1 {
label = "key_1";
gpios = <&tlmm 104 GPIO_ACTIVE_LOW>;
linux,input-type = <1>;
linux,code = <KEY_1>;
debounce-interval = <15>;
linux,can-disable;
}
}
}
3、编译
4、查看是否有按键事件
adb shell
getevent
查看是否有按键事件