提交 717c18f0 编写于 作者: B Boris Brezillon 提交者: Thierry Reding

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: NBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 6bc24526
...@@ -286,6 +286,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par) ...@@ -286,6 +286,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
{ {
int ret; int ret;
u32 precharge, dclk, com_invdir, compins; u32 precharge, dclk, com_invdir, compins;
struct pwm_args pargs;
if (par->device_info->need_pwm) { if (par->device_info->need_pwm) {
par->pwm = pwm_get(&par->client->dev, NULL); par->pwm = pwm_get(&par->client->dev, NULL);
...@@ -294,7 +295,15 @@ static int ssd1307fb_init(struct ssd1307fb_par *par) ...@@ -294,7 +295,15 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
return PTR_ERR(par->pwm); return PTR_ERR(par->pwm);
} }
par->pwm_period = pwm_get_period(par->pwm); /*
* FIXME: pwm_apply_args() should be removed when switching to
* the atomic PWM API.
*/
pwm_apply_args(par->pwm);
pwm_get_args(par->pwm, &pargs);
par->pwm_period = pargs.period;
/* Enable the PWM */ /* Enable the PWM */
pwm_config(par->pwm, par->pwm_period / 2, par->pwm_period); pwm_config(par->pwm, par->pwm_period / 2, par->pwm_period);
pwm_enable(par->pwm); pwm_enable(par->pwm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册