[alsa-devel] [PATCH 1/4 v6] ASoC: add .of_xlate_dai_name callback on struct snd_soc_dai_driver
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Mon Feb 18 02:45:34 CET 2013
Hi Mark, Stephen
Sorry, this is self response, but...
> ASoC sound driver requires CPU/CODEC drivers for probing,
> and each CPU/CODEC has some DAI on it.
> Then, "dai name matching" have been used to identify
> CPU-CODEC DAI pair on ASoC.
>
> But, the "dai port number matching" is now required from DeviceTree.
> The solution of this issue is to replace the dai port number into dai name,
> and it needs some kind of .of_xlate function on each driver.
>
> This patch adds .of_xlate_dai_name callback interface
> on struct snd_soc_dai_driver,
> very basic/common snd_soc_common_of_xlate_dai_name()
> which replace the dai port number into dai name,
> and snd_soc_of_get_port_dai_name() which is using .of_xlate_dai_name.
>
> Then, #sound-dai-cells which enables DAI specifier is required
> on CPU/CODEC device tree properties.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
(snip)
> +const char *snd_soc_common_of_xlate_dai_name(struct snd_soc_dai *dai,
> + const struct of_phandle_args *args)
> +{
> + if (dai->id != args->args[0])
> + return NULL;
> +
> + return dai->driver->name;
> +}
> +EXPORT_SYMBOL_GPL(snd_soc_common_of_xlate_dai_name);
I used *common* for this function name,
but *simple* or *basic* seems better name ?
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list