[alsa-devel] [PATCH][RFC] ASoC: add default xlate on snd_soc_of_get_dai_name()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Oct 17 05:12:36 CEST 2013


Hi Lars

Thank you for checking patch

> > Current snd_soc_of_get_dai_name() needs .of_xlate_dai_name()
> > callback on each component drivers.
> > But required behavior on almost all these drivers is
> > just returns its indexed dai driver's name.
> > 
> > This patch adds this feature as default behavior.
> > .of_xlate_dai_name() can overwrite it.
> > 
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> 
> I'm not exactly sure if adding the dai_drv field to the component struct is
> the right approach. But it doesn't look to intrusive and could be removed
> again at some point, if it turns out there is a better way to do this.

Thank you

> > @@ -4609,12 +4610,19 @@ int snd_soc_of_get_dai_name(struct device_node *of_node,
> >  		if (pos->dev->of_node != args.np)
> >  			continue;
> >  
> > -		if (!pos->driver->of_xlate_dai_name) {
> > -			ret = -ENOSYS;
> > -			break;
> > +		if (pos->driver->of_xlate_dai_name) {
> > +			ret = pos->driver->of_xlate_dai_name(pos, &args, dai_name);
> > +		} else {
> > +			int id = args.args[0];
> 
> You should check that args.args_count is 1. And maybe also allow args_count
> to be 0 if the number of DAIs is 1.

I see
I will send v2 patch soon

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list