Commit 661dfb7f authored by Fancy Fang's avatar Fancy Fang Committed by Thierry Reding

pwm: imx-tpm: force 'real_period' to be zero in suspend

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: default avatarFancy Fang <chen.fang@nxp.com>
Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: 738a1cfe ("pwm: Add i.MX TPM PWM driver support")
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 329db102
......@@ -397,6 +397,13 @@ static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev)
if (tpm->enable_count > 0)
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);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment