Thomas Zimmermann 43837e
From 33a5471f8da976bf271a1ebbd6b9d163cb0cb6aa Mon Sep 17 00:00:00 2001
Thomas Zimmermann 43837e
From: Marek Vasut <marex@denx.de>
Thomas Zimmermann 43837e
Date: Tue, 21 Sep 2021 19:35:06 +0200
Thomas Zimmermann 43837e
Subject: video: backlight: Drop maximum brightness override for brightness
Thomas Zimmermann 43837e
 zero
Thomas Zimmermann 43837e
MIME-Version: 1.0
Thomas Zimmermann 43837e
Content-Type: text/plain; charset=UTF-8
Thomas Zimmermann 43837e
Content-Transfer-Encoding: 8bit
Thomas Zimmermann 43837e
Git-commit: 33a5471f8da976bf271a1ebbd6b9d163cb0cb6aa
Thomas Zimmermann 43837e
Patch-mainline: v5.16-rc1
Thomas Zimmermann 43837e
References: bsc#1129770
Thomas Zimmermann 43837e
Thomas Zimmermann 43837e
The note in c2adda27d202f ("video: backlight: Add of_find_backlight helper
Thomas Zimmermann 43837e
in backlight.c") says that gpio-backlight uses brightness as power state.
Thomas Zimmermann 43837e
This has been fixed since in ec665b756e6f7 ("backlight: gpio-backlight:
Thomas Zimmermann 43837e
Correct initial power state handling") and other backlight drivers do not
Thomas Zimmermann 43837e
require this workaround. Drop the workaround.
Thomas Zimmermann 43837e
Thomas Zimmermann 43837e
This fixes the case where e.g. pwm-backlight can perfectly well be set to
Thomas Zimmermann 43837e
brightness 0 on boot in DT, which without this patch leads to the display
Thomas Zimmermann 43837e
brightness to be max instead of off.
Thomas Zimmermann 43837e
Thomas Zimmermann 43837e
Fixes: c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c")
Thomas Zimmermann 43837e
Cc: <stable@vger.kernel.org> # 5.4+
Thomas Zimmermann 43837e
Cc: <stable@vger.kernel.org> # 4.19.x: ec665b756e6f7: backlight: gpio-backlight: Correct initial power state handling
Thomas Zimmermann 43837e
Signed-off-by: Marek Vasut <marex@denx.de>
Thomas Zimmermann 43837e
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Thomas Zimmermann 43837e
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Thomas Zimmermann 43837e
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Thomas Zimmermann 43837e
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Thomas Zimmermann 43837e
---
Thomas Zimmermann 43837e
 drivers/video/backlight/backlight.c | 6 ------
Thomas Zimmermann 43837e
 1 file changed, 6 deletions(-)
Thomas Zimmermann 43837e
Thomas Zimmermann 43837e
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
Thomas Zimmermann 43837e
index 537fe1b376ad7..fc990e576340b 100644
Thomas Zimmermann 43837e
--- a/drivers/video/backlight/backlight.c
Thomas Zimmermann 43837e
+++ b/drivers/video/backlight/backlight.c
Thomas Zimmermann 43837e
@@ -688,12 +688,6 @@ static struct backlight_device *of_find_backlight(struct device *dev)
Thomas Zimmermann 43837e
 			of_node_put(np);
Thomas Zimmermann 43837e
 			if (!bd)
Thomas Zimmermann 43837e
 				return ERR_PTR(-EPROBE_DEFER);
Thomas Zimmermann 43837e
-			/*
Thomas Zimmermann 43837e
-			 * Note: gpio_backlight uses brightness as
Thomas Zimmermann 43837e
-			 * power state during probe
Thomas Zimmermann 43837e
-			 */
Thomas Zimmermann 43837e
-			if (!bd->props.brightness)
Thomas Zimmermann 43837e
-				bd->props.brightness = bd->props.max_brightness;
Thomas Zimmermann 43837e
 		}
Thomas Zimmermann 43837e
 	}
Thomas Zimmermann 43837e
 
Thomas Zimmermann 43837e
-- 
Thomas Zimmermann 43837e
2.36.0
Thomas Zimmermann 43837e