[PATCH 1/4] pwm: omap-dmtimer: fix inaccurate period/duty_cycle calculation
Thierry Reding
thierry.reding at gmail.com
Fri Mar 4 07:17:48 PST 2016
On Fri, Jan 29, 2016 at 11:26:51PM -0500, David Rivshin (Allworx) wrote:
> From: David Rivshin <drivshin at allworx.com>
>
> Fix the calculation of load_value and match_value. Currently they
> are slightly too low, which produces a noticeably wrong PWM rate with
> sufficiently short periods (i.e. when 1/period approaches clk_rate/2).
>
> Example:
> clk_rate=32768Hz, period=122070ns, duty_cycle=61035ns (8192Hz/50% PWM)
> Correct values: load = 0xfffffffc, match = 0xfffffffd
> Current values: load = 0xfffffffa, match = 0xfffffffc
> effective PWM: period=183105ns, duty_cycle=91553ns (5461Hz/50% PWM)
>
> Fixes: 6604c6556db9 ("pwm: Add PWM driver for OMAP using dual-mode timers")
> Signed-off-by: David Rivshin <drivshin at allworx.com>
> ---
> drivers/pwm/pwm-omap-dmtimer.c | 27 ++++++++++++++++++++-------
> 1 file changed, 20 insertions(+), 7 deletions(-)
Applied, thanks.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160304/411a42e6/attachment.sig>
More information about the linux-arm-kernel
mailing list