按照 https://whycan.com/t_2393.html 帖子,在f1c200上添加个按键。启动失败,如下:
[ 1.327722] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin PE2 already requested by 1c20800.pinctrl:130; cannot claim for gpio-keys
[ 1.339344] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin-130 (gpio-keys) status -22
[ 1.346832] suniv-f1c100s-pinctrl 1c20800.pinctrl: could not request pin 130 (PE2) from group PE2 on device 1c20800.pinctrl
[ 1.358115] gpio-keys gpio-keys: Error applying setting, reverse things back
[ 1.365197] gpio-keys: probe of gpio-keys failed with error -22
按键是pe2。
设备树
dtsi添加
key_pins: key-pins {
pins = "PE2";
function = "gpio_in";
drive = <0>;
pull = <1>;
};
dts添加
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&key_pins>;
#address-cells = <1>;
#size-cells = <0>;
autorepeat;
button@0 {
label = "Key ENTER1";
linux,code = <KEY_ENTER>;
gpios = <&pio 4 2 GPIO_ACTIVE_LOW>; /* PE2 */
};
};
大神帮看看
最近编辑记录 wangweigang0 (2021-02-03 14:34:00)
离线
1_MyDriver.rar帮看下呗,这是设备树文件,我已经把用到的地方删掉了。
最近编辑记录 wangweigang0 (2021-02-03 14:49:17)
离线
删掉也不行。直接打印这个。 中间的错误2句。
[ 1.325136] hub 1-0:1.0: USB hub found
[ 1.329164] hub 1-0:1.0: 1 port detected
[ 1.335440] gpio-keys gpio-keys: failed to get gpio: -16
[ 1.340956] gpio-keys: probe of gpio-keys failed with error -16
[ 1.347878] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1.365371] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
离线
帮看下1楼的问题,我照着之前的帖子改的。不知道为什么也不好使。这个-16应该是获取不到gpio导致的吧。
离线