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

fbdev: ssd1307fb: 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
717c18f0 6bc24526

+10 -1
+10 -1
drivers/video/fbdev/ssd1307fb.c
··· 286 286 { 287 287 int ret; 288 288 u32 precharge, dclk, com_invdir, compins; 289 + struct pwm_args pargs; 289 290 290 291 if (par->device_info->need_pwm) { 291 292 par->pwm = pwm_get(&par->client->dev, NULL); ··· 295 294 return PTR_ERR(par->pwm); 296 295 } 297 296 298 - par->pwm_period = pwm_get_period(par->pwm); 297 + /* 298 + * FIXME: pwm_apply_args() should be removed when switching to 299 + * the atomic PWM API. 300 + */ 301 + pwm_apply_args(par->pwm); 302 + 303 + pwm_get_args(par->pwm, &pargs); 304 + 305 + par->pwm_period = pargs.period; 299 306 /* Enable the PWM */ 300 307 pwm_config(par->pwm, par->pwm_period / 2, par->pwm_period); 301 308 pwm_enable(par->pwm);