OSDN Git Service

ASoC: SOF: topology: parse comp_ext_tokens for all widgets
authorKeyon Jie <yang.jie@linux.intel.com>
Fri, 4 Sep 2020 13:27:32 +0000 (16:27 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 7 Sep 2020 14:16:36 +0000 (15:16 +0100)
Parse comp_ext_tokens in the common sof_widget_ready(), and the
swidget->comp_ext will be used to construct the COMP_NEW ipc in the
subsequent commits.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/topology.c

index 0ba0c39..7d1013e 100644 (file)
@@ -2401,6 +2401,16 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
                return ret;
        }
 
+       ret = sof_parse_tokens(scomp, &swidget->comp_ext, comp_ext_tokens,
+                              ARRAY_SIZE(comp_ext_tokens), tw->priv.array,
+                              le32_to_cpu(tw->priv.size));
+       if (ret != 0) {
+               dev_err(scomp->dev, "error: parsing comp_ext_tokens failed %d\n",
+                       ret);
+               kfree(swidget);
+               return ret;
+       }
+
        /* handle any special case widgets */
        switch (w->id) {
        case snd_soc_dapm_dai_in: