Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1379250
| From | Boris Brezillon <boris.brezillon@free-electrons.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v5 08/24] fbdev: ssd1307fb: use pwm_get_args() where appropriate |
| Date | 2016-04-14 21:30 +0200 |
| Message-ID | <rnV7I-77H-41@gated-at.bofh.it> (permalink) |
| References | <rnUY1-71M-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
drivers/video/fbdev/ssd1307fb.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index fa34808..652f688 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -286,6 +286,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
{
int ret;
u32 precharge, dclk, com_invdir, compins;
+ struct pwm_args pargs;
if (par->device_info->need_pwm) {
par->pwm = pwm_get(&par->client->dev, NULL);
@@ -294,7 +295,15 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
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 */
pwm_config(par->pwm, par->pwm_period / 2, par->pwm_period);
pwm_enable(par->pwm);
--
2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v5 00/24] pwm: add support for atomic update Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 02/24] pwm: use pwm_get/set_xxx() helpers where appropriate Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
Re: [PATCH v5 02/24] pwm: use pwm_get/set_xxx() helpers where appropriate Joachim Eastwood <manabian@gmail.com> - 2016-04-14 21:30 +0200
[PATCH v5 05/24] input: misc: max77693: use pwm_get_args() where appropriate Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 18/24] pwm: introduce the pwm_state concept Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 08/24] fbdev: ssd1307fb: use pwm_get_args() where appropriate Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 16/24] ARM: explicitly apply PWM config extracted from pwm_args Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
Re: [PATCH v5 16/24] ARM: explicitly apply PWM config extracted from pwm_args Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-04-15 10:20 +0200
[PATCH v5 15/24] drm: i915: explicitly apply PWM config extracted from pwm_args Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 03/24] clk: pwm: use pwm_get_args() where appropriate Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 17/24] pwm: keep PWM state in sync with hardware state Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 20/24] pwm: add the PWM initial state retrieval infra Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
[PATCH v5 21/24] pwm: add the core infrastructure to allow atomic update Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-14 21:30 +0200
csiph-web