[alsa-devel] ASOC v2 driver structure

Jon Smirl jonsmirl at gmail.com
Sun Jan 27 17:45:25 CET 2008


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;
}



-- 
Jon Smirl
jonsmirl at gmail.com


More information about the Alsa-devel mailing list