按照 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)
离线
already requested by
已经在别处被使用
离线
1_MyDriver.rar帮看下呗,这是设备树文件,我已经把用到的地方删掉了。
最近编辑记录 wangweigang0 (2021-02-03 14:49:17)
离线
pinctrl-0 = <&key_pins>;
删掉这一句试一试
离线
删掉也不行。直接打印这个。 中间的错误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'
离线
#define EBUSY 16 /* Device or resource busy */
https://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html
很可能是别处占用了
离线
帮看下1楼的问题,我照着之前的帖子改的。不知道为什么也不好使。这个-16应该是获取不到gpio导致的吧。
离线
楼主解决了吗? 我也遇到了相同的问题
离线
楼主解决了吗? 我也遇到了相同的问题
我之前使用的是PA0 PA1作为按键,折腾了好久之后发现,原来f1c100s PA1 PA2居然没有gpio中断。。。。所以不能使用gpio-keys。
离线