Make sure to handle register context save/restore when needed from
system PM callbacks.
Previously we solely trusted the device to reside in in-active state
while the system suspend callback were invoked, which is just too
optimistic.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
{
struct platform_device *pdev = to_platform_device(dev);
struct d40_base *base = platform_get_drvdata(pdev);
- int ret = 0;
+ int ret;
+
+ ret = pm_runtime_force_suspend(dev);
+ if (ret)
+ return ret;
if (base->lcpa_regulator)
ret = regulator_disable(base->lcpa_regulator);
struct d40_base *base = platform_get_drvdata(pdev);
int ret = 0;
- if (base->lcpa_regulator)
+ if (base->lcpa_regulator) {
ret = regulator_enable(base->lcpa_regulator);
+ if (ret)
+ return ret;
+ }
- return ret;
+ return pm_runtime_force_resume(dev);
}
#endif