1 1
dan1234

Again More than one Wire pin

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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1