Liam Girdwood wrote:
I think one of the difficulties encountered here is that the device tree root for sound in this case is the SSI (Digital Audio Interface) controller and not the sound card as in ASoC. So maybe the problem is how do we represent an ASoC sound card in the device tree ?
Yes, that is a topic of concern.
If you look at the 8610 DTS, you'll see that the SSI (i2s) is effectively the master. In reality, I just modeled the board in the DTS. The SSI node, for example, lists the two DMA channels it needs. It also points to the codec that it's connected to. And the clock-frequency property is in the codec node because the oscillator is connected to the codec on the board.
In theory, would could probably get rid of the DMA node pointers if I can update the standard DMA driver to allow me to reserve two DMA channels. That's not an easy fix, though.
The sound card within ASoC is a compound device that is made up of the SSI, Codec and audio DMA engine components. The SSI/Codec/DMA components do not have to be the sound cards child devices wrt the driver model but do register with the ASoC core and are 'joined' with each other and the sound card driver to form a working audio device.
Yes, today I just walk the device tree looking for these connections implicitly. The code may be ugly, but the device tree is more streamlined.
Now I don't know the mechanics of adding an ASoC sound card to the device tree, but the device tree should be able to define an ASoC sound card and also represent the relationships between the sound card and the SSI/Codec/DMA components. The components should also be represented in the device tree. Parsing the device tree should probe() all the ASoC components and sound card. The ASoC core would then instantiated them as a sound device.
Another problem is that ASoC won't let me probe the DMA channels independently. That is, I cannot tell ASoC that I have a playback DMA and a capture DMA. ASoC does not recognize two DMA devices for a single SSI. If you can fix that, then I can turn the DMA driver into an OF driver.