您尚未登录。

楼主 #1 2021-02-03 14:33:30

wangweigang0
会员
注册时间: 2020-08-07
已发帖子: 17
积分: 47

f1c200s添加keyboard_gpio失败

按照 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)

离线

楼主 #3 2021-02-03 14:47:31

wangweigang0
会员
注册时间: 2020-08-07
已发帖子: 17
积分: 47

Re: f1c200s添加keyboard_gpio失败

1_MyDriver.rar帮看下呗,这是设备树文件,我已经把用到的地方删掉了。

最近编辑记录 wangweigang0 (2021-02-03 14:49:17)

离线

楼主 #5 2021-02-03 15:07:44

wangweigang0
会员
注册时间: 2020-08-07
已发帖子: 17
积分: 47

Re: f1c200s添加keyboard_gpio失败

删掉也不行。直接打印这个。 中间的错误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'

离线

楼主 #7 2021-02-03 15:16:22

wangweigang0
会员
注册时间: 2020-08-07
已发帖子: 17
积分: 47

Re: f1c200s添加keyboard_gpio失败

帮看下1楼的问题,我照着之前的帖子改的。不知道为什么也不好使。这个-16应该是获取不到gpio导致的吧。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn