On 1/9/23 04:54, Shawn Guo wrote:
[...]
+ backlight = <&backlight>;
+ power-supply = <®_panel_vcc>;
+ /* Disabled by default, unless display board plugged in. */
+ status = "disabled";
+ };
+
+ reg_panel_vcc: regulator-panel-vcc {
+ compatible = "regulator-fixed";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_panel_vcc_reg>;
+ regulator-name = "PANEL_VCC";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio3 6 0>;
GPIO_ACTIVE_HIGH?
No, the 0 is correct and you're not the first one to wonder about this
oddity.
I understand that the polarity is ignored by Linux Kernel. But it
shouldn't prevent us from describing the polarity cell with defines
for better readability.
I'm always looking for the pattern below when reviewing the device tree.
regulator-xxx {
compatible = "regulator-fixed";
...
gpio = <&gpio3 6 GPIO_ACTIVE_HIGH>;
enable-active-high;
}
Or for low polarity:
regulator-xxx {
compatible = "regulator-fixed";
...
gpio = <&gpio3 6 GPIO_ACTIVE_LOW>;
}
The polarity define is helpful for me to validate whether
`enable-active-high` property should present.
Maybe the best thing we can do to resolve this is to ask GPIO maintainer
Linus what is the preferred way of describing this in DT -- whether with
valid GPIO flags which are ignored or with 0 instead of GPIO flags ?