Skip to content

Commit 15d4dbd

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: imx27: Fix clock handling in pwm_imx27_apply()
pwm_imx27_apply() enables the clocks if the previous PWM state was disabled. Given that the clocks are supposed to be left on iff the PWM is running, the decision to disable the clocks at the end of the function must not depend on the previous state. Without this fix the enable count of the two affected clocks increases by one whenever ->apply() changes from one disabled state to another. Fixes: bd88d31 ("pwm: imx27: Unconditionally write state to hardware") Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 2c25b07 commit 15d4dbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-imx27.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm,
289289

290290
writel(cr, imx->mmio_base + MX3_PWMCR);
291291

292-
if (!state->enabled && cstate.enabled)
292+
if (!state->enabled)
293293
pwm_imx27_clk_disable_unprepare(chip);
294294

295295
return 0;

0 commit comments

Comments
 (0)