]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: omap-dmtimer: Add sanity checking for load and match values
authorDavid Rivshin <drivshin@allworx.com>
Sat, 30 Jan 2016 04:26:52 +0000 (23:26 -0500)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 23 Mar 2016 16:11:46 +0000 (17:11 +0100)
commit82011f11ae6ba025eadb7dbc5a9460f3f13266f5
treea8753c450bfb1c1124ee7f32b6a74d17a58b9529
parentce9a821b537be076a3b67d403d4b42a43b6b8674
pwm: omap-dmtimer: Add sanity checking for load and match values

Add sanity checking to ensure that we do not program load or match values
that are out of range if a user requests period or duty_cycle values which
are not achievable. The match value cannot be less than the load value (but
can be equal), and neither can be 0xffffffff. This means that there must be
at least one fclk cycle between load and match, and another between match
and overflow.

Fixes: 387f97a2f206 ("pwm: Add PWM driver for OMAP using dual-mode timers")
Signed-off-by: David Rivshin <drivshin@allworx.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
[thierry.reding@gmail.com: minor coding style cleanups]
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-omap-dmtimer.c