]> git.baikalelectronics.ru Git - kernel.git/commit
backlight: pwm_bl: Re-add driver internal enabled tracking
authorHeiko Stuebner <heiko@sntech.de>
Fri, 9 Nov 2018 09:48:57 +0000 (10:48 +0100)
committerLee Jones <lee.jones@linaro.org>
Tue, 27 Nov 2018 12:10:51 +0000 (12:10 +0000)
commit22ebcbd2b14ca8cb3e3fc18fc68263204c37c4b7
treee4174f69235037d15ff9529599d884c1b2d692cc
parentf630c74755763954e46ada22cb887770a3c4fdd4
backlight: pwm_bl: Re-add driver internal enabled tracking

Commit eb118d77251a ("backlight: pwm_bl: Switch to using "atomic" PWM API")
removed the driver internal enabled tracking in favor of simply checking
the pwm state.

This can lead to issues as all of gpio-, regulator- and pwm-state are used
to determine the initial state and the bootloader or kernel can leave them
in an inconsistent state at boot.

In my case on rk3399-kevin, the pwm backlight is build as module and the
kernel disables the supply regulator as unused while keeping the pwm running
thus pwm_bl calling pwm_backlight_power_off() during probe and creating an
unmatched regulator-disable call, as it never got enabled from the pwm-bl
before.

To prevent these consistency issues, reintroduce the driver-internal
tracking of the enabled state.

Fixes: eb118d77251a ("backlight: pwm_bl: Switch to using "atomic" PWM API")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/pwm_bl.c