summaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa/pwm.c
diff options
context:
space:
mode:
authorroelkluin <roel.kluin@gmail.com>2008-10-15 00:28:51 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-17 16:44:47 +0400
commit71a35d75661271d20ff0098817070f6545e90cbe (patch)
treee20db9c4cac82528a6b0fbc7770aa349bc7a1bf8 /arch/arm/mach-pxa/pwm.c
parente4d2a5985af957d2c0da61fb978d0c414b92a562 (diff)
downloadlinux-71a35d75661271d20ff0098817070f6545e90cbe.tar.xz
[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>
Diffstat (limited to 'arch/arm/mach-pxa/pwm.c')
-rw-r--r--arch/arm/mach-pxa/pwm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/pwm.c b/arch/arm/mach-pxa/pwm.c
index 316cd986da5c..74e2ead8cee8 100644
--- a/arch/arm/mach-pxa/pwm.c
+++ b/arch/arm/mach-pxa/pwm.c
@@ -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;