Device trees and audio codecs

Segher Boessenkool segher at kernel.crashing.org
Mon Oct 22 05:14:44 EST 2007


> I'm working on ALSA ASoC support for a codec chip on my mpc5200 based
> target hardware.

What is ASoC?

> Under ASoC the device drivers for the codec chips are platform
> independent.  In the current ASoC model there are three device
> drivers: i2s (or spi, etc), the generic codec, and a platform specific
> 'fabric' driver.  Some codecs are linked to both i2c and i2s.

The i2s driver is simply for data transport, the codec driver does,
well, what codecs do; and what is the fabric driver for?  Just to
know which output ports are which, etc.?

> The fabric driver corresponds to the 'layout-id' in the Apple model.
> It tells how to configure the generic codec driver for the specific
> configuration needed by the actual platform hardware.

The apple layout-id selects one of several tables with *lots* of info.
I think you want a subset of that only.

> My target hardware has a codec that is linked to both i2s and i2c. How
> should it be represented?

Since the codec is addressable on i2c, and not on i2s, it should be
a child node of the i2c bus it sits on; and then you put a property
in the codec node pointing to the i2s bus node it is connected to.
Multiple of those (or multiple entries) if it is connected to more
than one i2s bus.  "i2s-parent" might be a good name for such a prop.

> Apple has three entries. One for i2s, one for the codec, and one for
> soundchip. What is the soundchip entry, does it correspond to real
> hardware?
>
> /proc/device-tree/pci at f2000000/mac-io at 17/i2s at 0/i2s-a at 10000:

This is one of the i2s channels on the macio.  Dunno why they put
all those platform-XXX entries in here, (most of) these don't
logically belong here.

> /proc/device-tree/pci at f2000000/mac-io at 17/i2s at 0/i2s-a at 10000/sound:

The codec.  I guess Apple puts this here for their weirdo platform-do
stuff; don't imitate this :-)

> /proc/device-tree/pci at f2000000/mac-io at 17/i2c at 18000/i2c-bus at 0/codec at 6a:

The codec.  _Do_ put it here in your tree :-)


Segher




More information about the Linuxppc-dev mailing list