[PATCH] backlight: pwm_bl: re-add driver internal enabled tracking

Thierry Reding thierry.reding at gmail.com
Wed Nov 14 12:35:54 UTC 2018


On Fri, Nov 09, 2018 at 10:48:57AM +0100, Heiko Stuebner wrote:
> Commit e6bcca0890b9 ("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: e6bcca0890b9 ("backlight: pwm_bl: Switch to using "atomic" PWM API")
> Signed-off-by: Heiko Stuebner <heiko at sntech.de>
> ---
>  drivers/video/backlight/pwm_bl.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

Acked-by: Thierry Reding <thierry.reding at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20181114/86589cf5/attachment.sig>


More information about the dri-devel mailing list