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

Stephen Warren swarren at nvidia.com
Wed May 18 22:07:33 CEST 2011


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/)

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. 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!

-- 
nvpublic



More information about the Alsa-devel mailing list