[alsa-devel] Question on snd_soc_dai_link

Timur Tabi timur at freescale.com
Tue May 29 03:36:52 CEST 2007

Liam Girdwood wrote:

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

On PowerPC, the mapping *is* static, but unknown until boot time.  OK, maybe that's not what you meant by static.

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

On PowerPC, the device tree contains information about the board that cannot be obtained via probing the hardware.  Well, sometimes it contains information that *could* be obtained by probing, but that information is there only for probing.  The idea is that we can use a device tree to store device-specific information (like the I2C bus address) instead of passing command-line parameters to the device drivers.

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

All of the device trees are in arch/powerpc/boot/dts/.  A detailed description of the layout can be found in booting_without_of.txt.

In summary, the device tree is a hierarchy of "nodes", where each node lists a device (usually some controller on the SOC or some peripheral on the board), its address (e.g. the base address of the device's memory mapped registers), and a bunch of properties that the driver needs to initialize and communicate with the device.

I have not yet figured out how to represent the codec in the device tree.  In this particular case, the problem is unusual in that there is no I2C bus connected, so there's no way to control the codec, and so there's not much need for a node.

More information about the Alsa-devel mailing list