]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers: video: simple_panel: make simple panel independent of backlight
authorNikhil M Jain <n-jain1@ti.com>
Tue, 31 Jan 2023 10:05:16 +0000 (15:35 +0530)
committerAnatolij Gustschin <agust@denx.de>
Sat, 4 Feb 2023 17:16:00 +0000 (18:16 +0100)
This patch updates the necessary Kconfigs to make simple panel
driver independent of backlight driver  and compiling backlight
related code in simple-panel driver conditionally to when user
has set CONFIG_BACKLIGHT.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/video/simple_panel.c

index c8f7022ea63d20ae45840aa5022f8ee0dea5ca54..91c91ee75d88df5df119bec6c61b5f8f1ac88b68 100644 (file)
@@ -63,12 +63,15 @@ static int simple_panel_of_to_plat(struct udevice *dev)
                                return ret;
                }
        }
+
        ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev,
-                                          "backlight", &priv->backlight);
+                                                  "backlight", &priv->backlight);
        if (ret) {
                debug("%s: Cannot get backlight: ret=%d\n", __func__, ret);
-               return log_ret(ret);
+               if (ret != -ENOENT)
+                       return log_ret(ret);
        }
+
        ret = gpio_request_by_name(dev, "enable-gpios", 0, &priv->enable,
                                   GPIOD_IS_OUT);
        if (ret) {