【设备树】驱动中获取其它设备树dts节点

在驱动程序中,通过示例代码展示了如何在bspkernelkernel5.4driverspowersupplyq2560x-charger.c中获取设备树中的""sprd,sc27xx-syscon""节点,并详细说明了如何获取其注册信息,以便后续操作该节点对应的寄存器。在enable函数中进行实际操作。" 114127160,8247673,Excel多列排序与子列合并技巧,"['数据处理', 'Excel技巧', '编程工具']
摘要由CSDN通过智能技术生成

示例:bsp\kernel\kernel5.4\drivers\power\supply\bq2560x-charger.c

1.定义    device_node  platform_device结构体指针

struct bq2560x_charger_info *info;	
struct device_node *regmap_np;
struct platform_device *regmap_pdev;

2. 获取dts中的"sprd,sc27xx-syscon" node

syscon@1800 {
                        compatible = "sprd,sc2731-syscon", "sprd,sc27xx-syscon";
                        reg = <0x1800>, <0x1ba0>, <0x1b98>;
                };
	regmap_np = of_find_compatible_node(NULL, NULL, "sprd,sc27xx-syscon");
	if (!regmap_np)
		regmap_np = of_find_compatible_node(NULL, NULL, "sprd,ump962x-syscon");

	if (regmap_np) {
		if (of_device_
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值