From 8bc65caeeb5229759cd190c6d5921f34218b02a9 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Sun, 16 Dec 2018 14:25:03 +0800 Subject: [PATCH] ASoC:SOF:pm fix DAI config during resume fix the place to duplicate the dai_config, previous code replace the dai_config of capture with playback, for they are the same dai name. Signed-off-by: Zhu Yingjiang --- sound/soc/sof/topology.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 79bf2b255c9bc9..17e258e2ebd19a 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2161,6 +2161,12 @@ static int sof_link_hda_process(struct snd_sof_dev *sdev, config->hda.link_dma_ch = slot; + /* Set the DAI config here since both DAI name and direction must + * be matched, this is important for playback and capture with the + * same DAI name. + */ + dai->dai_config = kmemdup(config, size, GFP_KERNEL); + /* send message to DSP */ ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, size, &reply, @@ -2250,18 +2256,6 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index, } } - /* set config for all DAI's with name matching the link name */ - ret = sof_set_dai_config(sdev, size, link, config); - if (ret < 0) { - if (link->dpcm_playback) - dev_err(sdev->dev, "error: failed to save DAI config for playback HDA%d\n", - config->dai_index); - - if (link->dpcm_capture) - dev_err(sdev->dev, "error: failed to save DAI config for capture HDA%d\n", - config->dai_index); - } - return ret; }