Commit 71a35d75 authored by roelkluin's avatar roelkluin Committed by Russell King

[ARM] 5303/1: period_cycles should be greater than 1

If period_cycles is 0, prescale becomes silly.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent e4d2a598
...@@ -60,7 +60,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) ...@@ -60,7 +60,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
do_div(c, 1000000000); do_div(c, 1000000000);
period_cycles = c; period_cycles = c;
if (period_cycles < 0) if (period_cycles < 1)
period_cycles = 1; period_cycles = 1;
prescale = (period_cycles - 1) / 1024; prescale = (period_cycles - 1) / 1024;
pv = period_cycles / (prescale + 1) - 1; pv = period_cycles / (prescale + 1) - 1;
......
Markdown is supported
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