[alsa-devel] ASOC v2 driver structure
I'm trying to write an asoc v2 driver for my powerpc based SOC (mpc5200) hardware. We have two audio devices on the board, a WM8580 and a TAS5504. How do you do this with asoc v2? The card is created in snd_soc_machine_create(); there seems to be an assumption of a single card per machine.
Or are you supposed to mix the different devices into a single pcm driver? What would happen in pxa2xx-pcm.c if more than one of these were defined?
static int pxa2xx_pcm_probe(struct device *dev) { struct snd_soc_platform *platform = to_snd_soc_platform(dev); int ret; platform->pcm_ops = &pxa2xx_pcm_ops; platform->pcm_new = pxa2xx_pcm_new, platform->pcm_free = pxa2xx_pcm_free_dma_buffers, #if defined(CONFIG_SND_PXA2XX_SOC_I2S) ret = snd_soc_platform_add_dai(platform, &pxa2xx_i2s, 1); if (ret < 0) return ret; #endif #if defined(CONFIG_SND_PXA2XX_SOC_AC97) ret = snd_soc_platform_add_dai(platform, pxa2xx_ac97, 3); if (ret < 0) return ret; #endif #if defined(CONFIG_SND_PXA2XX_SOC_SSP) ret = snd_soc_platform_add_dai(platform, pxa2xx_ssp, 3); if (ret < 0) return ret; #endif ret = snd_soc_register_platform(platform); return ret; }
On 1/27/08, Jon Smirl jonsmirl@gmail.com wrote:
I'm trying to write an asoc v2 driver for my powerpc based SOC (mpc5200) hardware. We have two audio devices on the board, a WM8580 and a TAS5504. How do you do this with asoc v2? The card is created in snd_soc_machine_create(); there seems to be an assumption of a single card per machine.
Or are you supposed to mix the different devices into a single pcm driver? What would happen in pxa2xx-pcm.c if more than one of these were defined?
I guess I'm supposed to have multiple platform drivers - one per I2C/AC97/SSC channel?
On Sun, 2008-01-27 at 14:15 -0500, Jon Smirl wrote:
On 1/27/08, Jon Smirl jonsmirl@gmail.com wrote:
I'm trying to write an asoc v2 driver for my powerpc based SOC (mpc5200) hardware. We have two audio devices on the board, a WM8580 and a TAS5504. How do you do this with asoc v2? The card is created in snd_soc_machine_create(); there seems to be an assumption of a single card per machine.
This was the initial assumption in v1. To be honest we were only catering for single codec devices. In v2 we are allowing multiple cards - struct machine is being refactored atm to make this more obvious.
Or are you supposed to mix the different devices into a single pcm driver? What would happen in pxa2xx-pcm.c if more than one of these were defined?
I guess I'm supposed to have multiple platform drivers - one per I2C/AC97/SSC channel?
You could do this or create two cards (machines). I've kept platform as the DMA + all the interfaces (as some devices have more than one interface in operation e.g. AC97 for HiFi and I2S/PCM for voice).
Liam
Privacy & Confidentiality Notice ------------------------------------------------- This message and any attachments contain privileged and confidential information that is intended solely for the person(s) to whom it is addressed. If you are not an intended recipient you must not: read; copy; distribute; discuss; take any action in or make any reliance upon the contents of this message; nor open or read any attachment. If you have received this message in error, please notify us as soon as possible on the following telephone number and destroy this message including any attachments. Thank you. ------------------------------------------------- Wolfson Microelectronics plc Tel: +44 (0)131 272 7000 Fax: +44 (0)131 272 7001 Web: www.wolfsonmicro.com
Registered in Scotland
Company number SC089839
Registered office:
Westfield House, 26 Westfield Road, Edinburgh, EH11 2QB, UK
On 1/28/08, Liam Girdwood liam.girdwood@wolfsonmicro.com wrote:
On Sun, 2008-01-27 at 14:15 -0500, Jon Smirl wrote:
On 1/27/08, Jon Smirl jonsmirl@gmail.com wrote:
I'm trying to write an asoc v2 driver for my powerpc based SOC (mpc5200) hardware. We have two audio devices on the board, a WM8580 and a TAS5504. How do you do this with asoc v2? The card is created in snd_soc_machine_create(); there seems to be an assumption of a single card per machine.
This was the initial assumption in v1. To be honest we were only catering for single codec devices. In v2 we are allowing multiple cards
- struct machine is being refactored atm to make this more obvious.
What about the Efika? It has SOC audio with a STAC9766 but it also has a PCI slot.
Or are you supposed to mix the different devices into a single pcm driver? What would happen in pxa2xx-pcm.c if more than one of these were defined?
I guess I'm supposed to have multiple platform drivers - one per I2C/AC97/SSC channel?
You could do this or create two cards (machines). I've kept platform as the DMA + all the interfaces (as some devices have more than one interface in operation e.g. AC97 for HiFi and I2S/PCM for voice).
Liam
Privacy & Confidentiality Notice
This message and any attachments contain privileged and confidential information that is intended solely for the person(s) to whom it is addressed. If you are not an intended recipient you must not: read; copy; distribute; discuss; take any action in or make any reliance upon the contents of this message; nor open or read any attachment. If you have received this message in error, please notify us as soon as possible on the following telephone number and destroy this message including any attachments. Thank you.
Wolfson Microelectronics plc Tel: +44 (0)131 272 7000 Fax: +44 (0)131 272 7001 Web: www.wolfsonmicro.com
Registered in Scotland
Company number SC089839
Registered office:
Westfield House, 26 Westfield Road, Edinburgh, EH11 2QB, UK
On Mon, 2008-01-28 at 09:14 -0500, Jon Smirl wrote:
On 1/28/08, Liam Girdwood liam.girdwood@wolfsonmicro.com wrote:
On Sun, 2008-01-27 at 14:15 -0500, Jon Smirl wrote:
On 1/27/08, Jon Smirl jonsmirl@gmail.com wrote:
I'm trying to write an asoc v2 driver for my powerpc based SOC (mpc5200) hardware. We have two audio devices on the board, a WM8580 and a TAS5504. How do you do this with asoc v2? The card is created in snd_soc_machine_create(); there seems to be an assumption of a single card per machine.
This was the initial assumption in v1. To be honest we were only catering for single codec devices. In v2 we are allowing multiple cards
- struct machine is being refactored atm to make this more obvious.
What about the Efika? It has SOC audio with a STAC9766 but it also has a PCI slot.
You can use a regular PCI audio driver and an ASoC driver on the same device (they are both snd_cards).
Liam
On 1/28/08, Liam Girdwood liam.girdwood@wolfsonmicro.com wrote:
On Sun, 2008-01-27 at 14:15 -0500, Jon Smirl wrote:
On 1/27/08, Jon Smirl jonsmirl@gmail.com wrote:
I'm trying to write an asoc v2 driver for my powerpc based SOC (mpc5200) hardware. We have two audio devices on the board, a WM8580 and a TAS5504. How do you do this with asoc v2? The card is created in snd_soc_machine_create(); there seems to be an assumption of a single card per machine.
This was the initial assumption in v1. To be honest we were only catering for single codec devices. In v2 we are allowing multiple cards
- struct machine is being refactored atm to make this more obvious.
Another problem is how the drivers for the i2s/ac97 channels get loaded. In the pxa270 the machine driver loads the i2s/ac97 driver and it is hooked to the asoc bus. But in the powerpc world drivers for these channels load via the device tree and they get hooked to the of_platform_bus. Some of these assumptions in how machines are created need to be changed to support these drivers on the of_platform_bus.
Or are you supposed to mix the different devices into a single pcm driver? What would happen in pxa2xx-pcm.c if more than one of these were defined?
I guess I'm supposed to have multiple platform drivers - one per I2C/AC97/SSC channel?
You could do this or create two cards (machines). I've kept platform as the DMA + all the interfaces (as some devices have more than one interface in operation e.g. AC97 for HiFi and I2S/PCM for voice).
Liam
Privacy & Confidentiality Notice
This message and any attachments contain privileged and confidential information that is intended solely for the person(s) to whom it is addressed. If you are not an intended recipient you must not: read; copy; distribute; discuss; take any action in or make any reliance upon the contents of this message; nor open or read any attachment. If you have received this message in error, please notify us as soon as possible on the following telephone number and destroy this message including any attachments. Thank you.
Wolfson Microelectronics plc Tel: +44 (0)131 272 7000 Fax: +44 (0)131 272 7001 Web: www.wolfsonmicro.com
Registered in Scotland
Company number SC089839
Registered office:
Westfield House, 26 Westfield Road, Edinburgh, EH11 2QB, UK
On Mon, Jan 28, 2008 at 11:03:06AM -0500, Jon Smirl wrote:
Another problem is how the drivers for the i2s/ac97 channels get loaded. In the pxa270 the machine driver loads the i2s/ac97 driver and it is hooked to the asoc bus. But in the powerpc world drivers for these channels load via the device tree and they get hooked to the of_platform_bus. Some of these assumptions in how machines are created need to be changed to support these drivers on the of_platform_bus.
As discussed in the thread about Timur's patches this is something that's going to be possible before v2 is submitted - it will be possible to register all the components of an ASoC machine asynchronously with the core taking responsibility for ensuring that everything is in place before registering each machine as a card with ALSA.
This requirement is not unique to PowerPC - for example, more modern ARM systems that use the platform bus more want it too (I've actually been looking at this today for the modernised PXA support that's pending for 2.6.25).
participants (4)
-
Jon Smirl
-
Liam Girdwood
-
Liam Girdwood
-
Mark Brown