Skip to content
Commit 7b0883f3 authored by David Rivshin's avatar David Rivshin Committed by Thierry Reding
Browse files

pwm: omap-dmtimer: Round load and match values rather than truncate



When converting period and duty_cycle from nanoseconds to fclk cycles,
the error introduced by the integer division can be appreciable, especially
in the case of slow fclk or short period. Use DIV_ROUND_CLOSEST_ULL() so
that the error is kept to +/- 0.5 clock cycles.

Fixes: 6604c655 ("pwm: Add PWM driver for OMAP using dual-mode timers")
Signed-off-by: default avatarDavid Rivshin <drivshin@allworx.com>
Acked-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent cd378881
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment