Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c906a3ec authored by Ulf Hansson's avatar Ulf Hansson Committed by Vinod Koul
Browse files

dma: ste_dma40: Fixup system suspend/resume



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: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 123e4ca1
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -2945,7 +2945,11 @@ static int dma40_suspend(struct device *dev)
{
	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);
@@ -2958,11 +2962,14 @@ static int dma40_resume(struct device *dev)
	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 pm_runtime_force_resume(dev);
}
#endif

#ifdef CONFIG_PM