Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: atmel-hlcdc: Fix clock imbalance related to suspend support

The suspend callback disables the periph clock when the PWM is enabled
and resume reenables this clock if the PWM was disabled before. Judging
from the code comment it's suspend that is wrong here. Fix accordingly.

Fixes: f9bb9da7c09d ("pwm: atmel-hlcdc: Implement the suspend/resume hooks")
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://lore.kernel.org/r/b51ea92b0a45eff3dc83b08adefd43d930df996c.1706269232.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

+1 -1
+1 -1
drivers/pwm/pwm-atmel-hlcdc.c
··· 185 185 struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); 186 186 187 187 /* Keep the periph clock enabled if the PWM is still running. */ 188 - if (pwm_is_enabled(&atmel->chip.pwms[0])) 188 + if (!pwm_is_enabled(&atmel->chip.pwms[0])) 189 189 clk_disable_unprepare(atmel->hlcdc->periph_clk); 190 190 191 191 return 0;