mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
pwm: imx-tpm: force 'real_period' to be zero in suspend
[ Upstream commit661dfb7f46] During suspend, all the tpm registers will lose values. So the 'real_period' value of struct 'imx_tpm_pwm_chip' should be forced to be zero to force the period update code can be executed after system resume back. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Fixes:738a1cfec2("pwm: Add i.MX TPM PWM driver support") Signed-off-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
29ddfd5460
commit
c8fa254b77
@@ -399,6 +399,13 @@ static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev)
|
|||||||
if (tpm->enable_count > 0)
|
if (tpm->enable_count > 0)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force 'real_period' to be zero to force period update code
|
||||||
|
* can be executed after system resume back, since suspend causes
|
||||||
|
* the period related registers to become their reset values.
|
||||||
|
*/
|
||||||
|
tpm->real_period = 0;
|
||||||
|
|
||||||
clk_disable_unprepare(tpm->clk);
|
clk_disable_unprepare(tpm->clk);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user