aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-06-19 11:35:08 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-08-07 12:11:10 +0200
commit5ef881bbecc72862fa379cb286a50f2781db4cec (patch)
tree0e8085710f8d21a1485801466f0779ce71ce7ae2 /arch/arm/plat-mxc
parent494f22dddc6308b9c35984118ff4cb1681ad8e48 (diff)
MXC: pwm driver fixes
- fix off-by-one error in divider calculation - disable pwm in pwm_disable Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r--arch/arm/plat-mxc/pwm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
index ae34198a79d..42dd17b89ff 100644
--- a/arch/arm/plat-mxc/pwm.c
+++ b/arch/arm/plat-mxc/pwm.c
@@ -72,7 +72,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR);
writel(period_cycles, pwm->mmio_base + MX3_PWMPR);
- writel(MX3_PWMCR_PRESCALER(prescale - 1) |
+ writel(MX3_PWMCR_PRESCALER(prescale) |
MX3_PWMCR_CLKSRC_IPG_HIGH | MX3_PWMCR_EN,
pwm->mmio_base + MX3_PWMCR);
} else if (cpu_is_mx1() || cpu_is_mx21()) {
@@ -118,6 +118,8 @@ EXPORT_SYMBOL(pwm_enable);
void pwm_disable(struct pwm_device *pwm)
{
+ writel(0, pwm->mmio_base + MX3_PWMCR);
+
if (pwm->clk_enabled) {
clk_disable(pwm->clk);
pwm->clk_enabled = 0;