Hi,all,
在使用am437x开发板,sdk版本:ti-processor-sdk-linux-am437x-evm-01.00.00.03
打算使用gpio模拟1 wire的驱动,编译了 w1-gpio.ko这个驱动,但在加载模块时出现错误信息
#insmod w1-gpio.ko [57.400063] of_get_named_gpiod_flags exited with status 0 [57.402945] of_get_named_gpiod_flags: can't parse gpios property of node '/onewire@0[1]'
使用gpio0_19作为模拟io, am437x-gp-evm.dts的修改如下
/ {model = "TI AM437x GP EVM";compatible = "ti,am437x-gp-evm","ti,am4372","ti,am43";........bb_one_wire: onewire@0 {compatible= "w1-gpio";#address-cells = <1>;#size-cell= <0>;status= "okay";/* Setup the pins */pinctrl-names= "default";pinctrl-0= <&bb_w1_pins>;/* Define the new one-wire master as based on w1-gpio* and using GPIO0_19*/gpios= <&gpio0 19 0>;};};&am43xx_pinmux {pinctrl-names = "default", "sleep";pinctrl-0 = <&clkout2_pin>;........../*gpio0_19 for onewire use*/bb_w1_pins: pinmux_bb_w1_pins {pinctrl-single,pins = <0x1a4 0x37>;};};
估计是这个device tree修改上的问题,请帮忙!
谢谢!
Roy
leo chen:
从提示的错误来看是
bb_one_wire: onewire 地方写的有问题有什么东西没扫到,你可以看看w1-gpio那个驱动文件都要求注明哪些参数或者看看有没有说明文档
RoyS:
回复 leo chen:
hi,chen:
驱动要求
w1-gpio devicetree bindingsRequired properties: – compatible: "w1-gpio" – gpios: one or two GPIO specs: – the first one is used as data I/O pin – the second one is optional. If specified, it is used as enable pin for an external pin pullup.
dts文件里这两个属性也加入了。
参考了其他dts文件中使用w1-gpio的参数,也是类似的。
如果从驱动代码中检查需要的参数,应该看那个函数?
谢谢!
Roy
nan wang2:
回复 RoyS:
您好,请问slave接的是什么?
leo chen:
回复 nan wang2:
温度传感器之类的吧