All of lore.kernel.org
 help / color / mirror / Atom feed
* ASoC "long name" generation, without enumerating all machine_is_xxx() calls
@ 2011-05-18 20:07 Stephen Warren
  2011-05-19 11:22 ` Liam Girdwood
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2011-05-18 20:07 UTC (permalink / raw)
  To: Liam Girdwood (lrg@ti.com); +Cc: alsa-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ASoC "long name" generation, without enumerating all machine_is_xxx() calls
  2011-05-18 20:07 ASoC "long name" generation, without enumerating all machine_is_xxx() calls Stephen Warren
@ 2011-05-19 11:22 ` Liam Girdwood
  0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2011-05-19 11:22 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel

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  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-19 11:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 20:07 ASoC "long name" generation, without enumerating all machine_is_xxx() calls Stephen Warren
2011-05-19 11:22 ` Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.