Merge "soc: Handle system suspend for LPI pinctrl"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
58c514f5dd
@@ -788,7 +788,44 @@ int lpi_pinctrl_runtime_suspend(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lpi_pinctrl_suspend(struct device *dev)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
dev_dbg(dev, "%s: system suspend\n", __func__);
|
||||||
|
|
||||||
|
if ((!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev))) {
|
||||||
|
ret = lpi_pinctrl_runtime_suspend(dev);
|
||||||
|
if (!ret) {
|
||||||
|
/*
|
||||||
|
* Synchronize runtime-pm and system-pm states:
|
||||||
|
* At this point, we are already suspended. If
|
||||||
|
* runtime-pm still thinks its active, then
|
||||||
|
* make sure its status is in sync with HW
|
||||||
|
* status. The three below calls let the
|
||||||
|
* runtime-pm know that we are suspended
|
||||||
|
* already without re-invoking the suspend
|
||||||
|
* callback
|
||||||
|
*/
|
||||||
|
pm_runtime_disable(dev);
|
||||||
|
pm_runtime_set_suspended(dev);
|
||||||
|
pm_runtime_enable(dev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int lpi_pinctrl_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops lpi_pinctrl_dev_pm_ops = {
|
static const struct dev_pm_ops lpi_pinctrl_dev_pm_ops = {
|
||||||
|
SET_SYSTEM_SLEEP_PM_OPS(
|
||||||
|
lpi_pinctrl_suspend,
|
||||||
|
lpi_pinctrl_resume
|
||||||
|
)
|
||||||
SET_RUNTIME_PM_OPS(
|
SET_RUNTIME_PM_OPS(
|
||||||
lpi_pinctrl_runtime_suspend,
|
lpi_pinctrl_runtime_suspend,
|
||||||
lpi_pinctrl_runtime_resume,
|
lpi_pinctrl_runtime_resume,
|
||||||
|
Reference in New Issue
Block a user