mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
[ARM] 5303/1: period_cycles should be greater than 1
If period_cycles is 0, prescale becomes silly. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
e4d2a5985a
commit
71a35d7566
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
|
|||
do_div(c, 1000000000);
|
||||
period_cycles = c;
|
||||
|
||||
if (period_cycles < 0)
|
||||
if (period_cycles < 1)
|
||||
period_cycles = 1;
|
||||
prescale = (period_cycles - 1) / 1024;
|
||||
pv = period_cycles / (prescale + 1) - 1;
|
||||
|
|
Loading…
Reference in a new issue