Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;