Skip to content
Commit 4c09e20b authored by Artur Weber's avatar Artur Weber Committed by Lee Jones
Browse files

backlight: lp855x: Initialize PWM state on first brightness change

As pointed out by Uwe Kleine-König[1], the changes introduced in
commit c1ff7da0 ("video: backlight: lp855x: Get PWM for PWM mode
during probe") caused the PWM state set up by the bootloader to be
re-set when the driver is probed. This differs from the behavior from
before that patch, where the PWM state would be initialized on the
first brightness change.

Fix this by moving the PWM state initialization into the PWM control
function. Add a new variable, needs_pwm_init, to the device info struct
to allow us to check whether we need the initialization, or whether it
has already been done.

[1] https://lore.kernel.org/lkml/20230614083953.e4kkweddjz7wztby@pengutronix.de/



Fixes: c1ff7da0 ("video: backlight: lp855x: Get PWM for PWM mode during probe")
Signed-off-by: default avatarArtur Weber <aweber.kernel@gmail.com>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20230714121440.7717-2-aweber.kernel@gmail.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent 1bb5187b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment