]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
backlight: gpio-backlight: Correct initial power state handling
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Wed, 31 Jul 2019 08:40:18 +0000 (11:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:36:18 +0000 (11:36 +0100)
commitf928dae977fdf58d8e6c8fa470ffd4926bfb48ae
tree13a9c9913e4a12a48e304aa804ff5143a1331960
parentd508b70eaa8d6d994c289b757c0ca0355d4dbe29
backlight: gpio-backlight: Correct initial power state handling

commit ec665b756e6f79c60078b00dbdabea3aa8a4b787 upstream.

The default-on property - or the def_value via legacy pdata) should be
handled as:
if it is 1, the backlight must be enabled (kept enabled)
if it is 0, the backlight must be disabled (kept disabled)

This only works for the case when default-on is set. If it is not set then
the brightness of the backlight is set to 0. Now if the backlight is
enabled by external driver (graphics) the backlight will stay disabled since
the brightness is configured as 0. The backlight will not turn on.

In order to minimize screen flickering during device boot:

The initial brightness should be set to 1.

If booted in non DT mode or no phandle link to the backlight node:
follow the def_value/default-on to select UNBLANK or POWERDOWN

If in DT boot we have phandle link then leave the GPIO in a state which the
bootloader left it and let the user of the backlight to configure it
further.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/backlight/gpio_backlight.c