pinctrl学习笔记—描述/获得引脚

  • Post author:
  • Post category:其他




查看单个引脚

在文件中定义引脚描述

~/drivers/pinctrl/pinctrl-starfive.c

static const struct pinctrl_pin_desc starfive_pins[] = {
   
	PINCTRL_PIN(PAD_GPIO(0), "GPIO[0]"),
	PINCTRL_PIN(PAD_GPIO(1), "GPIO[1]"),
	PINCTRL_PIN(PAD_GPIO(2), "GPIO[2]"),
	PINCTRL_PIN(PAD_GPIO(3), "GPIO[3]"),
	……
};


板卡调试

[root@fedora-starfive /]# cd /sys/kernel/debug/pinctrl/
[root@fedora-starfive pinctrl]# ls
11910000.pinctrl-pinctrl-starfive  pinctrl-handles
pinctrl-devices                    pinctrl-maps
[root@fedora-starfive pinctrl]# cd 11910000.pinctrl-pinctrl-starfive/
[root@fedora-starfive 11910000.pinctrl-pinctrl-starfive]# ls
gpio-ranges     pinconf-pins  pinmux-functions  pinmux-select
pinconf-groups  pingroups     pinmux-pins       pins
[root@fedora-starfive 11910000.pinctrl-pinctrl-starfive]# cat pins
registered pins: 206
pin 0 (GPIO[0]) 0:? 
pin 1 (GPIO[1]) 0:? 
pin 2 (GPIO[2]) 0:? 
pin 3 (GPIO[3]) 0:? 
pin 4 (GPIO[4]) 0:? 
pin 5 (GPIO[5]) 0:? 
pin 6 (GPIO[6]) 0:? 
pin 7 (GPIO[7]) 0:? 
pin 8 (GPIO[8]) 0:? 
pin 9 (GPIO[9]) 0:? 
pin 10 (GPIO[10]) 0:? 
pin 11 (GPIO[11]) 0:? 
pin 12 (GPIO[12]) 0:? 
pin 13 (GPIO[13]) 0:? 
pin 14 (GPIO[14]) 0:? 
pin 15 (GPIO[15]) 0:? 
pin 16 (GPIO[16]) 0:? 
pin 17 (GPIO[17]) 0:? 
pin 18 (GPIO[18]) 0:? 
pin 19 (GPIO[19]) 0:? 
pin 20 (GPIO[20]) 0:? 
pin 21 (GPIO[21]) 0:? 
pin 22 (GPIO[22]) 0:? 
pin 23 (GPIO[23]) 0:? 
pin 24 (GPIO[24]) 0:? 
pin 25 (GPIO[25]) 0:? 
pin 26 (GPIO[26]) 0:? 
pin 27 (GPIO[27]) 0:? 
pin 28 (GPIO[28]) 0:? 
pin 29 (GPIO[29]) 0:? 
pin 30 (GPIO[30]) 0:? 
pin 31 (GPIO[31]) 0:? 
pin 32 (GPIO[32]) 0:? 
pin 33 (GPIO[33]) 0:? 
pin 34 (GPIO[34]) 0:? 
pin 35 (GPIO[35]) 0:? 
pin 36 (GPIO[36]) 0:? 
pin 37 (GPIO[37]) 0:? 
pin 38 (GPIO[38]) 0:? 
pin 39 (GPIO[39]) 0:? 
pin 40 (GPIO[40]) 0:? 
pin 41 (GPIO[41]) 0:? 
pin 42 (GPIO[42]) 0:? 
pin 43 (GPIO[43]) 0:? 
pin 44 (GPIO[44]) 0:? 
pin 45 (GPIO[45]) 0:? 
pin 46 (GPIO[46]) 0:? 
pin 47 (GPIO[47]) 0:? 
pin 48 (GPIO[48]) 0:? 
pin 49 (GPIO[49]) 0:? 
pin 50 (GPIO[50]) 0:? 
pin 51 (GPIO[51]) 0:? 
pin 52 (GPIO[52]) 0:? 
pin 53 (GPIO[53]) 0:? 
pin 54 (GPIO[54]) 0:? 
pin 55 (GPIO[55]) 0:? 
pin 56 (GPIO[56]) 0:? 
pin 57 (GPIO[57]) 0:? 
pin 58 (GPIO[58]) 0:? 
pin 59 (GPIO[59]) 0:? 
pin 60 (GPIO[60]) 0:? 
pin 61 (GPIO[61]) 0:? 
pin 62 (GPIO[62]) 0:? 
pin 63 (GPIO[63]) 0:? 
pin 64 (FUNC_SHARE[0]) 0:11910000.pinctrl dout=0 doen=1
pin 65 (FUNC_SHARE[1]) 1:11910000.pinctrl dout=0 doen=1
pin 66 (FUNC_SHARE[2]) 2:11910000.pinctrl dout=0 doen=1
pin 67 (FUNC_SHARE[3]) 3:11910000.pinctrl dout=0 doen=1
pin 68 (FUNC_SHARE[4]) 4:11910000.pinctrl dout=0 doen=1
pin 69 (FUNC_SHARE[5]) 5:11910000.pinctrl dout=0 doen=1
pin 70 (FUNC_SHARE[6]) 6:11910000.pinctrl dout=0 doen=1
pin 71 (FUNC_SHARE[7]) 7:11910000.pinctrl dout=0 doen=1
pin 72 (FUNC_SHARE[8]) 8:11910000.pinctrl dout=0 doen=1
pin 73 (FUNC_SHARE[9]) 9:11910000.pinctrl dout=0 doen=1
pin 74 (FUNC_SHARE[10]) 10:11910000.pinctrl dout=0 doen



版权声明:本文为weixin_37854301原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。