MLK-17089-4: ASoC: fsl_spdif: support suspend & resume for imx8
authorShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 6 Dec 2017 02:42:30 +0000 (10:42 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:50:16 +0000 (14:50 -0500)
Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. with this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
sound/soc/fsl/fsl_spdif.c

index c9a1bb5..8368f6a 100644 (file)
@@ -1472,31 +1472,6 @@ static int fsl_spdif_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int fsl_spdif_suspend(struct device *dev)
-{
-       struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
-
-       regmap_read(spdif_priv->regmap, REG_SPDIF_SRPC,
-                       &spdif_priv->regcache_srpc);
-
-       regcache_mark_dirty(spdif_priv->regmap);
-
-       return 0;
-}
-
-static int fsl_spdif_resume(struct device *dev)
-{
-       struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
-
-       regmap_update_bits(spdif_priv->regmap, REG_SPDIF_SRPC,
-                       SRPC_CLKSRC_SEL_MASK | SRPC_GAINSEL_MASK,
-                       spdif_priv->regcache_srpc);
-
-       return regcache_sync(spdif_priv->regmap);
-}
-#endif /* CONFIG_PM_SLEEP */
-
 #ifdef CONFIG_PM
 static int fsl_spdif_runtime_resume(struct device *dev)
 {
@@ -1581,7 +1556,7 @@ static int fsl_spdif_runtime_suspend(struct device *dev)
 #endif
 
 static const struct dev_pm_ops fsl_spdif_pm = {
-       SET_SYSTEM_SLEEP_PM_OPS(fsl_spdif_suspend, fsl_spdif_resume)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
        SET_RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume,
                           NULL)
 };