Due to the use of the Tegra DC backlight feature by the HTC ONE X,
backlight requests MUST NOT be made during probe or earlier. This is
because it creates a loop, as the backlight is a DC child.

To mitigate this issue, backlight requests can be made later, once the
backlight is actively used.

Signed-off-by: Svyatoslav Ryhel <[email protected]>
---
 drivers/video/endeavoru-panel.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/video/endeavoru-panel.c b/drivers/video/endeavoru-panel.c
index d4ba4d8b6da..90f838ecc20 100644
--- a/drivers/video/endeavoru-panel.c
+++ b/drivers/video/endeavoru-panel.c
@@ -117,6 +117,18 @@ static int endeavoru_panel_set_backlight(struct udevice 
*dev, int percent)
        struct endeavoru_panel_priv *priv = dev_get_priv(dev);
        int ret;
 
+       /*
+        * Due to the use of the Tegra DC backlight feature, backlight
+        * requests MUST NOT be made during probe or earlier. This is
+        * because it creates a loop, as the backlight is a DC child.
+        */
+       ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev,
+                                          "backlight", &priv->backlight);
+       if (ret) {
+               log_err("cannot get backlight: ret = %d\n", ret);
+               return ret;
+       }
+
        ret = backlight_enable(priv->backlight);
        if (ret)
                return ret;
@@ -136,13 +148,6 @@ static int endeavoru_panel_of_to_plat(struct udevice *dev)
        struct endeavoru_panel_priv *priv = dev_get_priv(dev);
        int ret;
 
-       ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev,
-                                          "backlight", &priv->backlight);
-       if (ret) {
-               log_err("cannot get backlight: ret = %d\n", ret);
-               return ret;
-       }
-
        ret = uclass_get_device_by_phandle(UCLASS_REGULATOR, dev,
                                           "vdd-supply", &priv->vdd);
        if (ret) {
-- 
2.43.0

Reply via email to