[PATCH v2 1/2] backlight: pwm_bl: Configure pwm only once per backlight toggle

Lee Jones lee at kernel.org
Fri Jan 20 17:07:06 UTC 2023


On Fri, 20 Jan 2023, Uwe Kleine-König wrote:

> When the function pwm_backlight_update_status() was called with
> brightness > 0, pwm_get_state() was called twice (once directly and once
> in compute_duty_cycle). Also pwm_apply_state() was called twice (once in
> pwm_backlight_power_on() and once directly).
> 
> Optimize this to do both calls only once.
> 
> Note that with this affects the order of regulator and PWM setup. It's
> not expected to have a relevant effect on hardware. The rationale for
> this is that the regulator (and the GPIO) are reasonable to switch in
> pwm_backlight_power_on()/pwm_backlight_power_off() but the PWM has
> nothing to do with power. (The post_pwm_on_delay and pwm_off_delay are
> still there though.)
> 
> Reviewed-by: Daniel Thompson <daniel.thompson at linaro.org>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>  drivers/video/backlight/pwm_bl.c | 28 ++++++++++------------------
>  1 file changed, 10 insertions(+), 18 deletions(-)

Applied, thanks

-- 
Lee Jones [李琼斯]


More information about the dri-devel mailing list