[alsa-devel] [PATCH][ASoC v2] Update Freescale MPC8610HPCD fabric driver to support multiple codecs

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Jun 13 20:59:42 CEST 2008

On Fri, Jun 13, 2008 at 12:59:44PM -0400, Jon Smirl wrote:

> In the PowerPC world the ssi drivers are loaded based on the device
> tree. When the ssi driver loads it gets passed in it's device tree
> node and can see what codecs are on its bus.
> Codecs get loaded two ways, if they are i2c based the i2c subsystem
> loaded them. That's because of the PowerPC rule that the controlling
> bus should load the driver. If it is an AC97/HDA codec, the ssi code
> needs to trigger the loading since the AC97/HDA bus is the controlling
> bus.

This is no different to any other system.

> After the codec is loaded it may need parameters from the device tree.
> My though was to have two mechanisms. First a very simple one where
> the SSI driver just copies the parameters from the device tree into
> the codec. That removes the need for platform specific code from the
> codec driver.  The simple copy should be enough for AC97/HDA.

> In the second case the SSI would have a call out into the fabric code.
> If the simple copy isn't enough the fabric code can do whatever
> complicated things it needs to do. This is the case in my hardware,
> the fabric driver needs to set up the external clock chip.

I'm not seeing much substantial difference between the two cases here:
in both of them you look at the system and load a machine driver, it's
just that in the first case the machine driver happens to be a generic
one that gets more of what it needs from the device tree.

> The basic concept is that there is one SSI driver per device and a
> single global fabric driver. So anything that needs to be done on a
> per ssi case needs to go into the ssi driver. Making the soc
> structures and attaching the codec is a per ssi task, so the code

Remember that if there's more than one SSI<->codec link they may not be
independant of each other.  For example, a six channel DAC could be
connected to three stereo I2S ports on the SoC with shared clock
signals.  You can also get codec<->codec links (for example, separate
ADC and DAC parts or Bluetooth devices) which bypass the SoC entirely.

It may be that you just intend to wrap all these cases up in your "or
load a machine driver" case, I'm not clear.

> should go into the ssi driver. There's on a single, global fabric
> driver, that's why Timur had to add a loop initializing the ssi
> drivers.

There's one machine driver per system in V1, but one of the intentions
going forward is to remove that limitation.  IIRC it may already be
possible to have more than one SoC card in V2 but I don't know if anyone
actually did that yet.

More information about the Alsa-devel mailing list