linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] pwm: omap-dmtimer: fix period/duty_cycle calculation
@ 2016-01-30  4:26 David Rivshin (Allworx)
  2016-01-30  4:26 ` [PATCH 1/4] pwm: omap-dmtimer: fix inaccurate " David Rivshin (Allworx)
                   ` (5 more replies)
  0 siblings, 6 replies; 30+ messages in thread
From: David Rivshin (Allworx) @ 2016-01-30  4:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: David Rivshin <drivshin@allworx.com>

When using a short PWM period (approaching the min of 2/clk_rate),
pwm-omap-dmtimer does not produce accurate results. In the worst case a
requested period of 2/clk_rate would result in a real period of 4/clk_rate
instead. This is a series includes a fix for that problem, as well as
other related improvements, and is based on the current linux-pwm/for-next
tip.

I have tested on a Sitara AM335x platform, using a scope to verify the
output with a variety of periods and duty cycles. This includes a PWM
rate up clk_rate/2 with 50% duty cycle (e.g. generating fclk/2) with
both 32768Hz and 24MHz fclks. I do not have an OMAP4 board to test with,
although appropriate sections in the the reference manuals appear
substantially the same, so I believe the changes are equally correct
there.

Note that the OMAP4 TRMs do effectively state that the maximum PWM
rate is clk_rate/4, so at very fast PWM rates the behavior may not be
as reliable as I observed with Sitara. Although I suspect that it's
the same module and will also work, at least under some circumstances.
If anyone with OMAP4 hardware and a scope is so inclined, I would be
curious to know the results.

David Rivshin (4):
  pwm: omap-dmtimer: fix inaccurate period/duty_cycle calculation
  pwm: omap-dmtimer: add sanity checking for load and match values
  pwm: omap-dmtimer: round load and match values rather than truncate
  pwm: omap-dmtimer: add dev_dbg() message for effective period and duty
    cycle

 drivers/pwm/pwm-omap-dmtimer.c | 71 ++++++++++++++++++++++++++++++++----------
 1 file changed, 55 insertions(+), 16 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2016-03-08 23:23 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-30  4:26 [PATCH 0/4] pwm: omap-dmtimer: fix period/duty_cycle calculation David Rivshin (Allworx)
2016-01-30  4:26 ` [PATCH 1/4] pwm: omap-dmtimer: fix inaccurate " David Rivshin (Allworx)
2016-02-03 10:23   ` Neil Armstrong
2016-02-15 20:24     ` Adam Ford
2016-03-04 15:17   ` Thierry Reding
2016-01-30  4:26 ` [PATCH 2/4] pwm: omap-dmtimer: add sanity checking for load and match values David Rivshin (Allworx)
2016-02-01 18:35   ` David Rivshin (Allworx)
2016-02-03 10:24     ` Neil Armstrong
2016-01-30  4:26 ` [PATCH 3/4] pwm: omap-dmtimer: round load and match values rather than truncate David Rivshin (Allworx)
2016-02-03 10:24   ` Neil Armstrong
2016-03-04 15:18   ` Thierry Reding
2016-01-30  4:26 ` [PATCH 4/4] pwm: omap-dmtimer: add dev_dbg() message for effective period and duty cycle David Rivshin (Allworx)
2016-01-30 14:51   ` Neil Armstrong
2016-02-01 18:22     ` David Rivshin (Allworx)
2016-02-01 18:59       ` Tony Lindgren
2016-02-02 16:23         ` Thierry Reding
2016-02-02 23:44           ` David Rivshin (Allworx)
2016-02-03 14:14             ` Thierry Reding
2016-02-05 19:51               ` David Rivshin (Allworx)
2016-02-09 12:49                 ` Neil Armstrong
2016-01-30 14:52 ` [PATCH 0/4] pwm: omap-dmtimer: fix period/duty_cycle calculation Neil Armstrong
2016-02-01 20:14   ` David Rivshin (Allworx)
2016-02-27  1:31 ` David Rivshin (Allworx)
2016-03-04 15:19   ` Thierry Reding
2016-03-04 16:27     ` David Rivshin (Allworx)
     [not found]       ` <CAHCN7xJYi8VCe8ue_QuYmqTEo-8GPSPiwzM2F_631mMUrwajSA@mail.gmail.com>
2016-03-04 20:01         ` David Rivshin (Allworx)
2016-03-04 20:03           ` Adam Ford
2016-03-04 21:18       ` Thierry Reding
2016-03-04 23:20         ` David Rivshin (Allworx)
2016-03-08 23:23           ` Adam Ford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).