aBUGSworstnightmare
Posts: 6005
Joined: Tue Jun 30, 2015 1:35 pm

Re: Customizing i2c-pwm-pca9685a-overlay

Tue Nov 22, 2022 12:04 pm

PhilE wrote:
Tue Nov 22, 2022 8:45 am
You can simplify the overlay without changing its behaviour by replacing the on/off pairs of fragments with literal assignments:

Code: Select all

...
		addr = <&pca>,"reg:0";

		sellvds_low = <&sellvds>,"default-state=off";
		sellvds_high = <&sellvds>,"default-state=on";
		aux0_low = <&aux0>,"default-state=off";
		aux0_high = <&aux0>,"default-state=on";
		aux1_low = <&aux1>,"default-state=off";
		aux1_high = <&aux1>,"default-state=on";
		aux2_low = <&aux2>,"default-state=off";
		aux2_high = <&aux2>,"default-state=on";
		aux3_low = <&aux3>,"default-state=off";
		aux3_high = <&aux3>,"default-state=on";
	};
};
..
Thanks for letting me know! Didn't consider that as I had a similar approach as with gpio-hog in mind.
PhilE wrote:
Tue Nov 22, 2022 8:45 am
...
And I presume you know that the "=1"s in your overlay usage are unnecessary? Using a parameter name with no value is equivalent to assigning 1, which is converted to "okay" if it's a status property. So your usage example could just be:

Code: Select all

dtoverlay=i2c-pwm-pca9685a-new,sellvds_high,aux0_high,aux2_high
Yes, I know! But that's chickenway again ... better safe than sorry (as it shouldn't harm but doesn't look nice as well)

Return to “Device Tree”