From 9c70a96f6af43bc9a18258008004a0a50bce3486 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 1 Nov 2018 13:13:58 -0500 Subject: [PATCH] ASoC: SOF: topology: add pm-get/put around topology load Make sure all the individual IPCs to configure the DSP based on topology info take place with the DSP already in D0 on startup. Suggested-by: Liam Girdwood Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/topology.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 02ef68d64a8092..1ed249e582fb5e 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2463,6 +2463,13 @@ int snd_sof_load_topology(struct snd_sof_dev *sdev, const char *file) return ret; } + ret = pm_runtime_get_sync(sdev->dev); + if (ret < 0) { + dev_err(sdev->dev, "error: topology load pm_runtime_get_sync failed with %d\n", + ret); + return ret; + } + hdr = (struct snd_soc_tplg_hdr *)fw->data; ret = snd_soc_tplg_component_load(sdev->component, &sof_tplg_ops, fw, @@ -2473,6 +2480,11 @@ int snd_sof_load_topology(struct snd_sof_dev *sdev, const char *file) ret = -EINVAL; } + ret = pm_runtime_put(sdev->dev); + if (ret < 0) + dev_err(sdev->dev, "error: topology load pm_runtime_put failed with %d\n", + ret); + release_firmware(fw); return ret; }