38 pinctrl(四)pinctrl driver

前言

一些使用技巧

  • 查看设备支持的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反编译出来设备树如下

posted @   人民广场的二道贩子  阅读(91)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示