前言
一些使用技巧
-
查看设备支持的pinctrl
ls /sys/kernel/debug/pinctrl/
-
查看pinctrl中支持的引脚、组、function
cat /sys/kernel/debug/pinctrl/20e0000.iomuxc/pins cat /sys/kernel/debug/pinctrl/20e0000.iomuxc/pingroups cat /sys/kernel/debug/pinctrl/20e0000.iomuxc/pinmux-functions
1. pinctrl init driver
1.1 device tree
1.2 driver init
2. pinctrl driver
2.1 pinctrl driver probe
-
imx6ul_pinctrl_probe
static int (struct platform_device *pdev) { const struct of_device_id *match; struct imx_pinctrl_soc_info *pinctrl_info; /* 从of_device_id 中取出私有data */ match = of_match_device(imx6ul_pinctrl_of_match, &pdev->dev); if (!match) return -ENODEV; pinctrl_info = (struct imx_pinctrl_soc_info *) match->data; return imx_pinctrl_probe(pdev, pinctrl_info); }
私有的数据中定义了设备支持引脚信息
-
imx_pinctrl_probe
-
imx_pinctrl_probe_dt
dtb反编译出来设备树如下