中级会员
- 积分
- 336
- 金钱
- 336
- 注册时间
- 2010-12-2
- 在线时间
- 39 小时
|
本帖最后由 夏天的风 于 2022-5-16 20:41 编辑
按教程,设备树设置如下:gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&key_pins_a>;
autorepeat;
key0 {
label = "GPIO Key UP";
linux,code = <KEY_UP>;
gpios = <&gpiog 3 GPIO_ACTIVE_LOW>;
};
key1 {
label = "GPIO Key DOWN";
linux,code = <KEY_DOWN>;
gpios = <&gpioh 7 GPIO_ACTIVE_LOW>;
};
wkup {
label = "GPIO Key Enter";
linux,code = <KEY_ENTER>;
gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>;
};
};
编译设备树,重新加载内核和设备树,出现错误:
[ 2.908754] gpio-keys gpio-keys: failed to get gpio: -22
[ 2.915697] gpio-keys: probe of gpio-keys failed with error -22
解决方法:
1.查看官方关于gpio-keys 的格式,去除pinctrl-0 = <&key_pins_a>; 即可。因为pincrtl和驱动中的IO申请冲突
仅此给遇到同样问题的道友
|
|