From: Marek Vasut <marex@denx.de> Date: 2021-07-08 09:11:08
The note in c2adda27d202f ("video: backlight: Add of_find_backlight helper
in backlight.c") says that gpio-backlight uses brightness as power state.
Other backlight drivers do not, so limit this workaround to gpio-backlight.
This fixes the case where e.g. pwm-backlight can perfectly well be set to
brightness 0 on boot in DT, which without this patch leads to the display
brightness to be max instead of off.
Fixes: c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Thompson <redacted>
Cc: Meghana Madhyastha <redacted>
Cc: Noralf Trønnes <redacted>
Cc: Sean Paul <redacted>
Cc: Thierry Reding <redacted>
---
drivers/video/backlight/backlight.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
From: Daniel Thompson <hidden> Date: 2021-07-09 11:03:20
On Thu, Jul 08, 2021 at 11:10:58AM +0200, Marek Vasut wrote:
The note in c2adda27d202f ("video: backlight: Add of_find_backlight helper
in backlight.c") says that gpio-backlight uses brightness as power state.
Other backlight drivers do not, so limit this workaround to gpio-backlight.
This fixes the case where e.g. pwm-backlight can perfectly well be set to
brightness 0 on boot in DT, which without this patch leads to the display
brightness to be max instead of off.
Fixes: c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Thompson <redacted>
Cc: Meghana Madhyastha <redacted>
Cc: Noralf Trønnes <redacted>
Cc: Sean Paul <redacted>
Cc: Thierry Reding <redacted>
I have to admit that this patch really does makes it clear just how
nasty the hack in of_find_backlight() currently is.
Moreover I think it is also be obsolete. gpio-backlight power mode
handling was pretty broken when this code was introduced. It was fixed
in 2019 by ec665b756e6f ("backlight: gpio backlight: Correct initial
power state handling") by trying to match the behaviour of PWM
backlight. The new code always sets the brightness to 1 so I think we
can just remove the hack from of_find_backlight() since I think it is
unreachable.
Daniel.
From: Marek Vasut <marex@denx.de> Date: 2021-07-09 13:19:53
On 7/9/21 1:03 PM, Daniel Thompson wrote:
On Thu, Jul 08, 2021 at 11:10:58AM +0200, Marek Vasut wrote:
quoted
The note in c2adda27d202f ("video: backlight: Add of_find_backlight helper
in backlight.c") says that gpio-backlight uses brightness as power state.
Other backlight drivers do not, so limit this workaround to gpio-backlight.
This fixes the case where e.g. pwm-backlight can perfectly well be set to
brightness 0 on boot in DT, which without this patch leads to the display
brightness to be max instead of off.
Fixes: c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Thompson <redacted>
Cc: Meghana Madhyastha <redacted>
Cc: Noralf Trønnes <redacted>
Cc: Sean Paul <redacted>
Cc: Thierry Reding <redacted>
I have to admit that this patch really does makes it clear just how
nasty the hack in of_find_backlight() currently is.
Moreover I think it is also be obsolete. gpio-backlight power mode
handling was pretty broken when this code was introduced. It was fixed
in 2019 by ec665b756e6f ("backlight: gpio backlight: Correct initial
power state handling") by trying to match the behaviour of PWM
backlight. The new code always sets the brightness to 1 so I think we
can just remove the hack from of_find_backlight() since I think it is
unreachable.
I assume by "new code" you mean the fixed gpio-backlight driver ?
Dropping the whole code after the Note: is fine by me.
On Thu, Jul 08, 2021 at 11:10:58AM +0200, Marek Vasut wrote:
quoted
The note in c2adda27d202f ("video: backlight: Add of_find_backlight
helper
in backlight.c") says that gpio-backlight uses brightness as power
state.
Other backlight drivers do not, so limit this workaround to
gpio-backlight.
This fixes the case where e.g. pwm-backlight can perfectly well be
set to
brightness 0 on boot in DT, which without this patch leads to the
display
brightness to be max instead of off.
Fixes: c2adda27d202f ("video: backlight: Add of_find_backlight helper
in backlight.c")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Thompson <redacted>
Cc: Meghana Madhyastha <redacted>
Cc: Noralf Trønnes <redacted>
Cc: Sean Paul <redacted>
Cc: Thierry Reding <redacted>
I have to admit that this patch really does makes it clear just how
nasty the hack in of_find_backlight() currently is.
Moreover I think it is also be obsolete. gpio-backlight power mode
handling was pretty broken when this code was introduced. It was fixed
in 2019 by ec665b756e6f ("backlight: gpio backlight: Correct initial
power state handling") by trying to match the behaviour of PWM
backlight. The new code always sets the brightness to 1 so I think we
can just remove the hack from of_find_backlight() since I think it is
unreachable.
I assume by "new code" you mean the fixed gpio-backlight driver ?
Dropping the whole code after the Note: is fine by me.
I haven't actually tested it, but when I saw the patch that Daniel
points to, it looked like this work around could be removed.
I haven't got time to tests it, but I will ack a patch that removes the
hack.
Noralf.