Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: pwm_bl: Use pwm_get_args() where appropriate

The PWM framework has clarified the concept of reference PWM config (the
platform dependent config retrieved from the DT or the PWM lookup table)
and real PWM state.

Use pwm_get_args() when the PWM user wants to retrieve this reference
config and not the current state.

This is part of the rework allowing the PWM framework to support
hardware readout and expose real PWM state even when the PWM has just
been requested (before the user calls pwm_config/enable/disable()).

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

Boris Brezillon and committed by
Thierry Reding
6cb9644d 717c18f0

+9 -1
+9 -1
drivers/video/backlight/pwm_bl.c
··· 201 201 struct device_node *node = pdev->dev.of_node; 202 202 struct pwm_bl_data *pb; 203 203 int initial_blank = FB_BLANK_UNBLANK; 204 + struct pwm_args pargs; 204 205 int ret; 205 206 206 207 if (!data) { ··· 308 307 dev_dbg(&pdev->dev, "got pwm for backlight\n"); 309 308 310 309 /* 310 + * FIXME: pwm_apply_args() should be removed when switching to 311 + * the atomic PWM API. 312 + */ 313 + pwm_apply_args(pb->pwm); 314 + 315 + /* 311 316 * The DT case will set the pwm_period_ns field to 0 and store the 312 317 * period, parsed from the DT, in the PWM device. For the non-DT case, 313 318 * set the period from platform data if it has not already been set 314 319 * via the PWM lookup table. 315 320 */ 316 - pb->period = pwm_get_period(pb->pwm); 321 + pwm_get_args(pb->pwm, &pargs); 322 + pb->period = pargs.period; 317 323 if (!pb->period && (data->pwm_period_ns > 0)) 318 324 pb->period = data->pwm_period_ns; 319 325