Commit 095fc30c authored by Winkler, Tomas's avatar Winkler, Tomas Committed by Jarkko Sakkinen

tpm/tpm_crb: enter the low power state upon device suspend

This fix enables a platform to enter the idle state (suspend-to-idle)

The driver needs to request explicitly go_idle upon completion
from the pm suspend handler.
The runtime pm is disabled on suspend during prepare state by calling
pm_runtime_get_noresume, hence we cannot relay on runtime pm to leave
the device in low power state. Symmetrically cmdReady is called
upon resume.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Tested-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Siged-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
parent 4bf4b4ed
...@@ -502,10 +502,33 @@ static int crb_pm_runtime_resume(struct device *dev) ...@@ -502,10 +502,33 @@ static int crb_pm_runtime_resume(struct device *dev)
return crb_cmd_ready(dev, priv); return crb_cmd_ready(dev, priv);
} }
static int crb_pm_suspend(struct device *dev)
{
int ret;
ret = tpm_pm_suspend(dev);
if (ret)
return ret;
return crb_pm_runtime_suspend(dev);
}
static int crb_pm_resume(struct device *dev)
{
int ret;
ret = crb_pm_runtime_resume(dev);
if (ret)
return ret;
return tpm_pm_resume(dev);
}
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
static const struct dev_pm_ops crb_pm = { static const struct dev_pm_ops crb_pm = {
SET_SYSTEM_SLEEP_PM_OPS(tpm_pm_suspend, tpm_pm_resume) SET_SYSTEM_SLEEP_PM_OPS(crb_pm_suspend, crb_pm_resume)
SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL) SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)
}; };
......
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