}
 }
 
-/* set config for all DAI's with name matching the link name */
+/*
+ * Send IPC and set the same config for all DAIs with name matching the link
+ * name. Note that the function can only be used for the case that all DAIs
+ * have a common DAI config for now.
+ */
 static int sof_set_dai_config(struct snd_sof_dev *sdev, u32 size,
                              struct snd_soc_dai_link *link,
                              struct sof_ipc_dai_config *config)
                        continue;
 
                if (strcmp(link->name, dai->name) == 0) {
+                       struct sof_ipc_reply reply;
+                       int ret;
+
+                       /* send message to DSP */
+                       ret = sof_ipc_tx_message(sdev->ipc,
+                                                config->hdr.cmd, config, size,
+                                                &reply, sizeof(reply));
+
+                       if (ret < 0) {
+                               dev_err(sdev->dev, "error: failed to set DAI config for %s index %d\n",
+                                       dai->name, config->dai_index);
+                               return ret;
+                       }
                        dai->dai_config = kmemdup(config, size, GFP_KERNEL);
                        if (!dai->dai_config)
                                return -ENOMEM;
 {
        struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
        struct snd_soc_tplg_private *private = &cfg->priv;
-       struct sof_ipc_reply reply;
        u32 size = sizeof(*config);
        int ret;
 
                return -EINVAL;
        }
 
-       /* send message to DSP */
-       ret = sof_ipc_tx_message(sdev->ipc,
-                                config->hdr.cmd, config, size, &reply,
-                                sizeof(reply));
-
-       if (ret < 0) {
-               dev_err(scomp->dev, "error: failed to set DAI config for SSP%d\n",
-                       config->dai_index);
-               return ret;
-       }
-
        /* set config for all DAI's with name matching the link name */
        ret = sof_set_dai_config(sdev, size, link, config);
        if (ret < 0)
 {
        struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
        struct snd_soc_tplg_private *private = &cfg->priv;
-       struct sof_ipc_reply reply;
        u32 size = sizeof(*config);
        int ret;
 
                return -EINVAL;
        }
 
-       /* send message to DSP */
-       ret = sof_ipc_tx_message(sdev->ipc,
-                                config->hdr.cmd, config, size, &reply,
-                                sizeof(reply));
-
-       if (ret < 0) {
-               dev_err(scomp->dev, "error: failed to set DAI config for SAI%d\n",
-                       config->dai_index);
-               return ret;
-       }
-
        /* set config for all DAI's with name matching the link name */
        ret = sof_set_dai_config(sdev, size, link, config);
        if (ret < 0)
 {
        struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
        struct snd_soc_tplg_private *private = &cfg->priv;
-       struct sof_ipc_reply reply;
        u32 size = sizeof(*config);
        int ret;
 
                return -EINVAL;
        }
 
-       /* send message to DSP */
-       ret = sof_ipc_tx_message(sdev->ipc,
-                                config->hdr.cmd, config, size, &reply,
-                                sizeof(reply));
-       if (ret < 0) {
-               dev_err(scomp->dev, "error: failed to set DAI config for ESAI%d\n",
-                       config->dai_index);
-               return ret;
-       }
-
        /* set config for all DAI's with name matching the link name */
        ret = sof_set_dai_config(sdev, size, link, config);
        if (ret < 0)
 {
        struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
        struct snd_soc_tplg_private *private = &cfg->priv;
-       struct sof_ipc_reply reply;
        struct sof_ipc_fw_ready *ready = &sdev->fw_ready;
        struct sof_ipc_fw_version *v = &ready->version;
        size_t size = sizeof(*config);
        if (SOF_ABI_VER(v->major, v->minor, v->micro) < SOF_ABI_VER(3, 0, 1))
                config->dmic.fifo_bits_b = config->dmic.fifo_bits;
 
-       /* send message to DSP */
-       ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, size,
-                                &reply, sizeof(reply));
-
-       if (ret < 0) {
-               dev_err(scomp->dev,
-                       "error: failed to set DAI config for DMIC%d\n",
-                       config->dai_index);
-               goto err;
-       }
-
        /* set config for all DAI's with name matching the link name */
        ret = sof_set_dai_config(sdev, size, link, config);
        if (ret < 0)
 {
        struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
        struct snd_soc_tplg_private *private = &cfg->priv;
-       struct sof_ipc_reply reply;
        u32 size = sizeof(*config);
        int ret;
 
        /* init IPC */
        config->hdr.size = size;
 
-       dev_dbg(scomp->dev, "ALH config rate %d channels %d\n",
-               config->alh.rate, config->alh.channels);
-
-       /* send message to DSP */
-       ret = sof_ipc_tx_message(sdev->ipc,
-                                config->hdr.cmd, config, size, &reply,
-                                sizeof(reply));
-
-       if (ret < 0) {
-               dev_err(scomp->dev, "error: failed to set DAI config for ALH %d\n",
-                       config->dai_index);
-               return ret;
-       }
-
        /* set config for all DAI's with name matching the link name */
        ret = sof_set_dai_config(sdev, size, link, config);
        if (ret < 0)