ASoC: SOF: core: move check for runtime callbacks to core
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Wed, 4 Dec 2019 21:15:49 +0000 (15:15 -0600)
committerMark Brown <broonie@kernel.org>
Mon, 9 Dec 2019 18:38:20 +0000 (18:38 +0000)
For some platforms, the refcount is explicitly incremented
to prevent it from entering runtime suspend. This
should be be done during probe in the core instead
of being done in the PCM driver.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191204211556.12671-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/core.c
sound/soc/sof/pcm.c

index 6a7f342203e93b6ebdc9eba46a0905921c1b3f57..d8446fb9fdded8c72f05b34e79b97514ff443ff7 100644 (file)
@@ -355,6 +355,14 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
        dev_dbg(sdev->dev, "created machine %s\n",
                dev_name(&plat_data->pdev_mach->dev));
 
+       /*
+        * Some platforms in SOF, ex: BYT, may not have their platform PM
+        * callbacks set. Increment the usage count so as to
+        * prevent the device from entering runtime suspend.
+        */
+       if (!sof_ops(sdev)->runtime_suspend || !sof_ops(sdev)->runtime_resume)
+               pm_runtime_get_noresume(sdev->dev);
+
        if (plat_data->sof_probe_complete)
                plat_data->sof_probe_complete(sdev->dev);
 
index 9fd73ef08904c31c9fe2ded5d0ce6050ca898939..a9c47f6bf657f85b69d1ac16770559ba9c4bcf80 100644 (file)
@@ -741,14 +741,6 @@ static int sof_pcm_probe(struct snd_soc_component *component)
                return ret;
        }
 
-       /*
-        * Some platforms in SOF, ex: BYT, may not have their platform PM
-        * callbacks set. Increment the usage count so as to
-        * prevent the device from entering runtime suspend.
-        */
-       if (!sof_ops(sdev)->runtime_suspend || !sof_ops(sdev)->runtime_resume)
-               pm_runtime_get_noresume(sdev->dev);
-
        return ret;
 }