[alsa-devel] ASoC "long name" generation, without enumerating all machine_is_xxx() calls

Liam Girdwood lrg at ti.com
Thu May 19 13:22:45 CEST 2011


On 18/05/11 21:07, Stephen Warren wrote:
> Liam,
> 
> I have a question about your recent "long name" change:
> 
> commit 22de71ba03311cdc1063757c50a1488cb90a1fca
> ASoC: core - allow ASoC more flexible machine name
> 
> The question is: How to generate the long name. The only example I could
> find of this was:
> 
> +	if (machine_is_omap_4430sdp())
> +		snd_soc_sdp4430.name = "SDP4430";
> +	else if (machine_is_omap4_panda())
> +		snd_soc_sdp4430.name = "Panda"
> 
> (from http://patchwork.ozlabs.org/patch/67831/)
>

This is up to you. :)  In our case the Panda and SPD4430 are different physical machines that share roughly 95% the same audio architecture and we use the extra naming here just to tell alsa userspace that we have different flavours of the same card. i.e. The panda does not have the Handsfree speaker so we have to use a different alsa init file and/or UCM configuration.

> But, I don't really want to call machine_is_xxx for every single machine
> the tegra-wm8903 driver can support; upstream there are 5 so far, and
> more similar derivatives downstream. 

We are only doing this as both machines are a little different wrt userspace.

That said, I suppose the code is
> already switching on machine_is_xxx to pick the correct dapm_route map,
> so I could just assign the name there, and fold multiple identical
> machines onto a single name.
> 
> It looks like the kernel doesn't have any kind of machine_name() API;
> the code in e.g. arch/arm/kernel/setup.c that prints the machine name at
> boot stores it in a static that's only exposed through syss/similar file.
> 
> Thanks for any hints!
>

Ok, this sounds like a good idea to add a small call here to get the machine name. It would certainly simplify the above code where there are differences between machines that use the same driver.

Liam  



More information about the Alsa-devel mailing list