diff options
author | Philip, Avinash <avinashphilip@ti.com> | 2012-08-23 02:59:46 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2012-09-10 11:03:13 -0400 |
commit | c06fad9d28c95b024ea10455cf1397432b12848d (patch) | |
tree | bce6aa75bb13e74de89dd803720dd7b32924c4fe | |
parent | b817bf5c72774556345a9043c6b0c497cdcb7295 (diff) |
pwm: pwm-tiecap: Disable APWM mode after configure
APWM mode is enabled while configuring PWM device. This was done to
handle shadow & immediate mode update of period and compare registers.
However, leaving it enabled after configuring will cause APWM output on
PWM pin even before enabling PWM device.
Fix the same by disabling APWM mode after configuring if PWM device is
not running.
Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
-rw-r--r-- | drivers/pwm/pwm-tiecap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c index 0b66d0f25922..4b6688909fee 100644 --- a/drivers/pwm/pwm-tiecap.c +++ b/drivers/pwm/pwm-tiecap.c | |||
@@ -100,6 +100,13 @@ static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, | |||
100 | writel(period_cycles, pc->mmio_base + CAP3); | 100 | writel(period_cycles, pc->mmio_base + CAP3); |
101 | } | 101 | } |
102 | 102 | ||
103 | if (!test_bit(PWMF_ENABLED, &pwm->flags)) { | ||
104 | reg_val = readw(pc->mmio_base + ECCTL2); | ||
105 | /* Disable APWM mode to put APWM output Low */ | ||
106 | reg_val &= ~ECCTL2_APWM_MODE; | ||
107 | writew(reg_val, pc->mmio_base + ECCTL2); | ||
108 | } | ||
109 | |||
103 | pm_runtime_put_sync(pc->chip.dev); | 110 | pm_runtime_put_sync(pc->chip.dev); |
104 | return 0; | 111 | return 0; |
105 | } | 112 | } |