1 Wire device with universal overlay

I have been using a 1 wire overlay for pin P9.22 for a while and I just expanded my toy to use a couple of pwm pins. Instead of creating the overlay myself, I figured I would try the universal overlay. I am using universaln and have an init.d script to load it and all is well. The problem is, I haven’t solved the problem of getting P9.22 back to 1 Wire that I need.

I tried looking at my overlay and modifying the universal overlay to implement it, I guess I don’t understand enough to make that work.

Then I commented out all of the P9_22 and P9.22 stuff in the overlay, make worked successfully, but when I try to load my old P9_22 overlay I get the File Exists error so there seems to still be a conflict.

What is the preferred way to solve this problem?

Why don’t you adapt the 1-wire overlay? It should be easy to use a pin not connected to any PWMSS. Ie. use P9_11 or P8_07.

Because the universal overlay causes my one wire overlay to be rejected. The error is File Exists and dmesg points to the conflict with the slots entry that has the conflict. I am probably doing something wrons, even when I delete the P9_22 from the universal overlay and reapply it, it rejects my overlay.

I am working on this from two perspectives, i need to be able to get back to work :). I am building a non universal overlay that will include my one wire pin, the pwm pins I need, and others as I work out my application. I will use this until I figure out the universal overlay issue.

I have never written an overlay that uses two pins on the same device, I am working that out now.

Because the universal overlay causes my one wire overlay to be rejected. The error is File Exists and dmesg points to the conflict with the slots entry that has the conflict. I am probably doing something wrons, even when I delete the P9_22 from the universal overlay and reapply it, it rejects my overlay.

Because the pin is already configured. Every pin is configured when you use universal io. Plus the point of using universal io is so you do not have to configure the pin through an overlay. So learn how to use universal io + config-pin to configure the pin.

That’s correct, every pin is configured. And the load the driver for PWM, or SPI, or … but it is not configured to load the OneWire driver for the pin. All of the config-pin options are for standard drivers. The point is, if you want to use the pin to another device that is not a built in device then one needs to do something different.

That’s correct, every pin is configured. And the load the driver for PWM, or SPI, or … but it is not configured to load the OneWire driver for the pin. All of the config-pin options are for standard drivers. The point is, if you want to use the pin to another device that is not a built in device then one needs to do something different.

How was the pin configured before ? There is no one wire peripheral module, so it must have been configured as GPIO. As far as one-wire goes I have never used it before, but have read it is basically a modified I2C protocol(somehow ).

If I was able to look at the device tree file you use before. Perhaps I could offer assistance.

/dts-v1/;  
 /plugin/;  
 / {  
      compatible = "ti,beaglebone", "ti,beaglebone-black";  
      part-number = "BB-W1";  
      version = "00A0";  
       exclusive-use =  
            "P9.22",  
            "gpio0_2";  
      fragment@0 {  
         target = <&am33xx_pinmux>;  
         __overlay__ {  
                dallas_w1_pins: pinmux_dallas_w1_pins {  
                    pinctrl-single,pins = < 0x150 0x37 >; };  
         };  
      };  
      fragment@1 {  
         target = <&ocp>;  
         __overlay__ {  
               onewire@0 {  
                    compatible   = "w1-gpio";  
                    pinctrl-names  = "default";  
                    pinctrl-0    = <&dallas_w1_pins>;  
                    status     = "okay";  
                    gpios = <&gpio1 2 0>;  
               };  
      };  
      };  
 };  

Did you figure this out? I’m trying to solve the same problem.