]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blobdiff - sound/soc/tegra-alt/tegra210_iqc_alt.c
ASoC: tegra-alt: Fix system suspend handling
[hercules2020/nv-tegra/linux-4.4.git] / sound / soc / tegra-alt / tegra210_iqc_alt.c
index 61d929833fcd3137d375212d04c835e24f53883e..514e045935aa00d0ace91124d294b321ba1c6e29 100644 (file)
@@ -80,7 +80,18 @@ static int tegra210_iqc_runtime_resume(struct device *dev)
 #ifdef CONFIG_PM_SLEEP
 static int tegra210_iqc_suspend(struct device *dev)
 {
-       return 0;
+       if (pm_runtime_status_suspended(dev))
+               return 0;
+
+       return tegra210_iqc_runtime_suspend(dev);
+}
+
+static int tegra210_iqc_resume(struct device *dev)
+{
+       if (pm_runtime_status_suspended(dev))
+               return 0;
+
+       return tegra210_iqc_runtime_resume(dev);
 }
 #endif
 
@@ -447,7 +458,7 @@ static int tegra210_iqc_platform_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tegra210_iqc_pm_ops = {
        SET_RUNTIME_PM_OPS(tegra210_iqc_runtime_suspend,
                           tegra210_iqc_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(tegra210_iqc_suspend, NULL)
+       SET_LATE_SYSTEM_SLEEP_PM_OPS(tegra210_iqc_suspend, tegra210_iqc_resume)
 };
 
 static struct platform_driver tegra210_iqc_driver = {