From: Ranjani Sridharan Date: Wed, 4 Dec 2019 21:15:49 +0000 (-0600) Subject: ASoC: SOF: core: move check for runtime callbacks to core X-Git-Tag: v5.15~2585^2~265^2~294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c583f526ee9df5c6693f54ac272b7e103b5f1d2;p=platform%2Fkernel%2Flinux-starfive.git ASoC: SOF: core: move check for runtime callbacks to core 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 Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20191204211556.12671-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 6a7f342..d8446fb 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -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); diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 9fd73ef..a9c47f6 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -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; }