Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] ARM: dts: omap3-pandora: usb_host_5v disabled after boot due to
  no consumer
- [Low] ARM: dts: omap3-pandora: deprecated fixed-regulator-* node names
  on new nodes
- [Low] ARM: dts: omap3-pandora: twl_gpio inserted between bluetooth
  comment and mcbsp3
- [Low] ARM: dts: omap3-pandora: dead startup-delay-us on GPIO-less
  lcd_5v regulator
--

commit f12a2f12a91cab92b448c35782704537aa5d9f32
Author: H. Nikolaus Schaller <[email protected]>

ARM: dts: omap3-pandora: Model LCD power enable dependencies

This commit adds fixed-regulator nodes aux_5v and lcd_5v to model the LCD
and USB host 5V power supply enable dependencies across OpenPandora board
revisions, and enables ti,use-regen on twl_gpio.

> diff --git a/arch/arm/boot/dts/ti/omap/omap3-pandora-common.dtsi 
> b/arch/arm/boot/dts/ti/omap/omap3-pandora-common.dtsi
> index 2097ec15c6513..f25fc4f8ad042 100644
> --- a/arch/arm/boot/dts/ti/omap/omap3-pandora-common.dtsi
> +++ b/arch/arm/boot/dts/ti/omap/omap3-pandora-common.dtsi
> @@ -31,6 +31,28 @@ hfclk_26m: oscillator {
>               clock-frequency = <26000000>;
>       };
>  
> +     /* Shared 5V rail for headphone amplifier, early LCD and USB */
> +     aux_5v: fixed-regulator-5v {
> +             compatible = "regulator-fixed"; /* TPS61029DRC */
> +             regulator-name = "aux_5v";
> +             regulator-min-microvolt = <5000000>;
> +             regulator-max-microvolt = <5000000>;
> +             startup-delay-us = <5000>;
> +             enable-active-high;
> +             gpio = <&twl_gpio 20 GPIO_ACTIVE_HIGH>; /* REGEN */
> +             vin-supply = <&vaux1>; /* logical enable dependency */
> +     };
> +
> +     /* LCD_5V: switched shared 5V on rev 5a, separate supply on rev 6d */
> +     lcd_5v: fixed-regulator-lcd-5v {

[Severity: Low]
Documentation/devicetree/bindings/regulator/fixed-regulator.yaml marks node
names not matching ^regulator(-[0-9]+v[0-9]+|-[0-9a-z-]+)?$ as deprecated.
Should these new nodes be named regulator-5v (or regulator-aux-5v) and
regulator-lcd-5v so they do not add dtbs_check warnings?

> +             compatible = "regulator-fixed";
> +             regulator-name = "lcd_5v";
> +             regulator-min-microvolt = <5000000>;
> +             regulator-max-microvolt = <5000000>;
> +             startup-delay-us = <5000>;
> +             vin-supply = <&aux_5v>; /* logical enable dependency */
> +     };

[Severity: Low]
Does startup-delay-us on lcd_5v have any effect when the node has no enable
GPIO?

In reg_fixed_voltage_probe(), a regulator-fixed node without a gpio property
registers with fixed_voltage_ops (which has no .is_enabled callback) and
rdev->ena_pin set to NULL.  _regulator_is_enabled() therefore always returns
1, causing _regulator_enable() to skip _regulator_do_enable() where
desc.enable_time (startup-delay-us) is applied.  Since lcd_5v controls no
hardware resource of its own, lcd could reference aux_5v directly in
vcc-supply, or startup-delay-us could be dropped from lcd_5v.

Also, the commit message mentions "patch 17", which will lose its meaning in
git history once committed.

[ ... ]

> @@ -212,15 +234,13 @@ hsusb2_phy: hsusb2-phy-pins {
>               #phy-cells = <0>;
>       };
>  
> -     /* HS USB Host VBUS supply
> -      * disabling this regulator causes current leakage, and LCD flicker
> -      * on earlier (CC) board revisions, so keep it always on */
> +     /* HS USB Host VBUS supply */
>       usb_host_5v: fixed-regulator-usb_host_5v {
> +             vin-supply = <&aux_5v>;
>               compatible = "regulator-fixed";
>               regulator-name = "usb_host_5v";
>               regulator-min-microvolt = <5000000>;
>               regulator-max-microvolt = <5000000>;
> -             regulator-always-on;
>               regulator-boot-on;
>               enable-active-high;
>               gpio = <&gpio6 4 GPIO_ACTIVE_HIGH>;     /* GPIO_164 */

[Severity: High]
Won't removing regulator-always-on from usb_host_5v cause
regulator_late_cleanup() to disable USB Host VBUS 30 seconds after boot?

Nothing in the device tree references &usb_host_5v (hsusb2_phy only has
vcc-supply = <&vaux2>), so rdev->use_count stays at 0.  When
regulator_late_cleanup() runs, it sees !c->always_on and rdev->use_count == 0
and calls _regulator_do_disable(rdev), turning off GPIO 164 with no consumer
to re-enable it and reintroducing the current leakage and LCD flicker on CC
boards noted in the removed comment.

In addition, set_machine_constraints() enables rdev->supply (aux_5v, and
transitively vaux1) at boot when boot_on is set, but regulator_late_cleanup()
calls _regulator_do_disable() directly without disabling rdev->supply,
permanently leaking that enable reference on aux_5v and vaux1.

[ ... ]

> @@ -711,6 +731,10 @@ &mcbsp2 {
>  };
>  
>  /* bluetooth */
> +&twl_gpio {
> +     ti,use-regen;
> +};
> +
>  &mcbsp3 {
>  };

[Severity: Low]
This isn't a bug, but inserting &twl_gpio here separates the /* bluetooth */
comment from the &mcbsp3 node it describes.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=14

Reply via email to