ASoC: soc-core: have legacy_dai_naming at snd_soc_register_dai()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 5 Nov 2019 06:47:09 +0000 (15:47 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 5 Nov 2019 23:50:43 +0000 (23:50 +0000)
ALSA SoC has 2 functions.
snd_soc_register_dai()  is used from topology
snd_soc_register_dais() is used from snd_soc_add_component()

In general, people think like _dai() is called from _dais()
with for loop. But in reality, these are very similar
but different implementation.
We shouldn't have duplicated and confusing implementation.

snd_soc_register_dai() is now used from topology.
But to reduce duplicated code, it should be used from _dais(), too.
To prepare it, this patch adds missing parameter legacy_dai_naming
to snd_soc_register_dai().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87tv7i251u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h
sound/soc/soc-core.c
sound/soc/soc-topology.c

index daa0e100ecd93988c3f7de18fabee8862916c2a6..766fa81494c31dc684e15aaf36dcde469f136940 100644 (file)
@@ -1327,7 +1327,8 @@ struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card,
                                               const char *stream_name);
 
 int snd_soc_register_dai(struct snd_soc_component *component,
-       struct snd_soc_dai_driver *dai_drv);
+                        struct snd_soc_dai_driver *dai_drv,
+                        bool legacy_dai_naming);
 void snd_soc_unregister_dai(struct snd_soc_dai *dai);
 
 struct snd_soc_dai *snd_soc_find_dai(
index 38199cd7ce97fdacafa6febd0ae3c43bebb9cc74..6f4933f13b0883681d9860178ab89e874b7e134a 100644 (file)
@@ -2604,7 +2604,8 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_dai);
  * will be freed in the component cleanup.
  */
 int snd_soc_register_dai(struct snd_soc_component *component,
-       struct snd_soc_dai_driver *dai_drv)
+                        struct snd_soc_dai_driver *dai_drv,
+                        bool legacy_dai_naming)
 {
        struct snd_soc_dapm_context *dapm =
                snd_soc_component_get_dapm(component);
@@ -2618,7 +2619,7 @@ int snd_soc_register_dai(struct snd_soc_component *component,
        }
 
        lockdep_assert_held(&client_mutex);
-       dai = soc_add_dai(component, dai_drv, false);
+       dai = soc_add_dai(component, dai_drv, legacy_dai_naming);
        if (!dai)
                return -ENOMEM;
 
index 0fd032914a318b39d46f89ac8af1435de11ebba1..b6e145627ab4a9148089143e4854be3bdd8a713d 100644 (file)
@@ -1842,7 +1842,7 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,
        list_add(&dai_drv->dobj.list, &tplg->comp->dobj_list);
 
        /* register the DAI to the component */
-       return snd_soc_register_dai(tplg->comp, dai_drv);
+       return snd_soc_register_dai(tplg->comp, dai_drv, false);
 }
 
 static void set_link_flags(struct snd_soc_dai_link *link,