alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Question on snd_soc_dai_link
@ 2007-05-25 21:55 Timur Tabi
  2007-05-28 12:19 ` Liam Girdwood
  0 siblings, 1 reply; 6+ messages in thread
From: Timur Tabi @ 2007-05-25 21:55 UTC (permalink / raw)
  To: Liam Girdwood, alsa-devel

I have a question about these DAI structs for ASoC.

Let's take eti_b1_wm8731.c as an example.  It contains this structure:

static struct snd_soc_dai_link eti_b1_dai = {
	.name = "WM8731",
	.stream_name = "WM8731",
	.cpu_dai = &at91_i2s_dai[1],
	.codec_dai = &wm8731_dai,
	.init = eti_b1_wm8731_init,
	.ops = &eti_b1_ops,
};

Notice that the .cpu_dai field is hard-coded to use the 2nd I2S device on the AT91.

The problem I'm having with this approach is that everything is hard-coded.  On PowerPC, 
this approach doesn't work well, because we have a "device tree" that dictates what 
devices are present on the SOC.

For a Freescale SOC that has two I2S devices (for example), both devices would be listed 
in the device tree, with the base address of the memory-mapped registers.  This means that 
a Freescale I2S driver would have its 'probe' function called (much like PCI does) each 
time the kernel processes an I2S node in the device tree.

This means that when the machine driver (which has the snd_soc_dai_link structure) loads, 
there's no guarantee that the I2S driver has also loaded and the probe functions have been 
called.  It gets even more complicated if only one I2S device has a codec connected to it, 
because then I need to kmalloc the snd_soc_cpu_dai structures and somehow tell the 
snd_soc_dai_link structure which one to use.

Has any thought been given to making these structures more dynamic and handling 
interdependencies among the drivers?  As it stands now, it looks like I'm going to have to 
hard-code everything in the drivers and break the device tree paradigm.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

end of thread, other threads:[~2007-05-29 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-25 21:55 Question on snd_soc_dai_link Timur Tabi
2007-05-28 12:19 ` Liam Girdwood
2007-05-29  1:36   ` Timur Tabi
2007-05-29 14:19     ` Liam Girdwood
2007-05-29 14:36       ` Timur Tabi
2007-05-29 14:51         ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).