On Fri, 2007-05-25 at 16:55 -0500, Timur Tabi wrote:
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.
Fwiw, ASoC was designed to only handle static DAI mappings between a codec and SoC CPU. This is because the audio codec was never intended to physically change DAI at runtime or be probed (most codecs don't support any device readback). The DAI mapping between CPU and codec was constant and always known to the machine driver.
Although, I can now see the need for a more dynamic approach for PowerPC based systems. Btw, I'm not very familiar with PowerPC, would you be able to point me at some example "device tree" initialisation code.
Liam