]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blobdiff - sound/soc/tegra-alt/tegra210_i2s_alt.c
ASoC: tegra-alt: Fix system suspend handling
[hercules2020/nv-tegra/linux-4.4.git] / sound / soc / tegra-alt / tegra210_i2s_alt.c
index 699c28a161e13426a688d5a8bf5f00305f1dcb58..49ae35cadd500df7fa69494cabcbb40768f9c74b 100644 (file)
@@ -294,7 +294,18 @@ static int tegra210_i2s_runtime_resume(struct device *dev)
 #ifdef CONFIG_PM_SLEEP
 static int tegra210_i2s_suspend(struct device *dev)
 {
-       return 0;
+       if (pm_runtime_status_suspended(dev))
+               return 0;
+
+       return tegra210_i2s_runtime_suspend(dev);
+}
+
+static int tegra210_i2s_resume(struct device *dev)
+{
+       if (pm_runtime_status_suspended(dev))
+               return 0;
+
+       return tegra210_i2s_runtime_resume(dev);
 }
 #endif
 
@@ -1227,7 +1238,7 @@ static int tegra210_i2s_platform_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tegra210_i2s_pm_ops = {
        SET_RUNTIME_PM_OPS(tegra210_i2s_runtime_suspend,
                           tegra210_i2s_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(tegra210_i2s_suspend, NULL)
+       SET_LATE_SYSTEM_SLEEP_PM_OPS(tegra210_i2s_suspend, tegra210_i2s_resume)
 };
 
 static struct platform_driver tegra210_i2s_driver = {