[alsa-devel] [RFC][ASoC] New device/driver arch

Liam Girdwood lg at opensource.wolfsonmicro.com
Thu Jun 14 19:40:32 CEST 2007

I'd like to gather some feedback on some changes I've been making to
ASoC recently. The changes were made to fit in better with the PPC
device tree and to help with easier porting to new platforms. They were
also introduced to make dealing with device probe errors (e.g. I2C probe
failure) a little easier.

The largest change is the introduction of an ASoC bus device. All
component drivers (that is, codec, codec DAI, CPU DAI, and DMA PCM
drivers) register with this bus. This should simplify device
registration and hopefully better fit in with the PPC model. A component
driver now typically consists of the standard driver ops and a set of
ASoC/ALSA ops to configure audio.

The new soc.h shows this here :-


Example component drivers are here :-





WM8753 Codec


Another major change is that there is no more snd_dai_link (structure
that connected codec <--> CPU). This has been replaced by an ASoC PCM
device that describes each PCM device in the machine. This new ASoC PCM
device has it's own driver and registers with the bus (like the others).
This allows an ASoC PCM driver to be defined like :-

static struct snd_soc_device_driver hifi_pcm_drv = {
	.driver	= {
		.name	= "mainstone-hifi-pcm",
		.owner	= THIS_MODULE,
		.probe	= hifi_pcm_probe,
		.remove = hifi_pcm_remove,
	.components	= {
		.cpu_dai 	= pxa2xx_i2s,
		.codec		= wm8753_codec,
		.codec_dai	= wm8753_hifi_dai,
		.platform	= pxa2xx_pcm,

This now shows each component within the driver structure.

The snd_soc_machine driver has changed and can now contain numerous ASoC
PCM devices. It is now a platform driver.

Example machine driver for Mainstone with WM8753 is here :-


The machine driver now also does the I2C/SPI probing (instead of the
codec) and also does any codec IO (to better support multiple

Fwiw, I've not tested any of this code atm. I plan to start this
tomorrow on pxa2xx and i.MX31 and would like to get some feedback before
porting remaining platforms and codecs over.


More information about the Alsa-devel mailing list