Jump to content

Again More than one Wire pin


dan1234

Recommended Posts

Hello!
In this topic:

It was confirmed that more than 1 pin GPIO can be used for 1-wire bus. How can I edit or create my sun8i-h3-w1-gpio.dts for this?

Spoiler

/dts-v1/;

/plugin/;

 

/ {

        compatible = "allwinner,sun8i-h3";

 

        fragment@0 {

                target = <&pio>;

                __overlay__ {

                        w1_pins: w1_pins {

                                pins = "PD14";

                                function = "gpio_in";

                        };

                };

        };

 

        fragment@1 {

                target-path = "/";

                __overlay__ {

                        onewire@0 {

                                compatible = "w1-gpio";

                                pinctrl-names = "default";

                                pinctrl-0 = <&w1_pins>;

                                gpios = <&pio 3 14 0>; /* PD14 */

                                status = "okay";

                        };

                };

        };

};

Can anyone give an example?
Thank you in advance!

Edited by dan1234
Link to comment
Share on other sites

If I change sun8i-h3-w1-gpio.dts as follows:

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun8i-h3";

	fragment@0 {
		target = <&pio>;
		__overlay__ {
			w1_pins: w1_pins {
				pins = "PA20" ,"PA10";
				functions = "gpio_in";
			};
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			onewire@0 {
				compatible = "w1-gpio";
				pinctrl-names = "default";
				pinctrl-0 = <&w1_pins>;
				gpios = <&pio 0 20 0>, <&pio 0 10 0>;
				status = "okay";
			};
		};
	};
};

That as 1-wire bus works only the first pin (PA20) from the specified. The second pin (PA10) is not working as 1-wire bus.
What am I doing wrong?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines