Re: [PATCH v6 18/18] video: tegra20: dsi: use set_backlight for backlight only

2024-04-19 Thread Thierry Reding
On Tue Jan 23, 2024 at 6:16 PM CET, Svyatoslav Ryhel wrote:
> From: Jonas Schwöbel 
>
> Shift the backlight set further to prevent visual glitches on
> panel init.
>
> Signed-off-by: Jonas Schwöbel 
> Signed-off-by: Svyatoslav Ryhel 
> ---
>  drivers/video/tegra20/tegra-dsi.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)

I vaguely recall that some devices may have had the panel and the
backlight hooked up to the same regulator or enable GPIO, so calling
panel_set_backlight() too late may cause the DSI panel to malfunction.

That said, I'm not familiar with panel_set_backlight(), so perhaps it
always only sets the brightness and the power may already be on earlier?

Ah... nevermind... I see that panel_enable_backlight() is called prior
to panel_set_backlight(), so this looks like it should be fine.

Reviewed-by: Thierry Reding 


signature.asc
Description: PGP signature


[PATCH v6 18/18] video: tegra20: dsi: use set_backlight for backlight only

2024-01-23 Thread Svyatoslav Ryhel
From: Jonas Schwöbel 

Shift the backlight set further to prevent visual glitches on
panel init.

Signed-off-by: Jonas Schwöbel 
Signed-off-by: Svyatoslav Ryhel 
---
 drivers/video/tegra20/tegra-dsi.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/video/tegra20/tegra-dsi.c 
b/drivers/video/tegra20/tegra-dsi.c
index 7d63557d1b..13dae37806 100644
--- a/drivers/video/tegra20/tegra-dsi.c
+++ b/drivers/video/tegra20/tegra-dsi.c
@@ -766,10 +766,6 @@ static int tegra_dsi_encoder_enable(struct udevice *dev)
if (ret)
return ret;
 
-   ret = panel_set_backlight(priv->panel, BACKLIGHT_DEFAULT);
-   if (ret)
-   return ret;
-
tegra_dsi_configure(dev, device->mode_flags);
 
tegra_dc_enable_controller(dev);
@@ -784,8 +780,10 @@ static int tegra_dsi_encoder_enable(struct udevice *dev)
 
 static int tegra_dsi_bridge_set_panel(struct udevice *dev, int percent)
 {
-   /* Is not used in tegra dc */
-   return 0;
+   struct tegra_dsi_priv *priv = dev_get_priv(dev);
+
+   /* Turn on/off backlight */
+   return panel_set_backlight(priv->panel, percent);
 }
 
 static int tegra_dsi_panel_timings(struct udevice *dev,
-- 
2.40.1