[alsa-devel] New SoC layer codec registration problem

Alexander subaparts at yandex.ru
Thu Oct 28 11:12:20 CEST 2010


I'm trying to implement new SoC codec in linux-next-20101025 kernel.

Part of the code:
---
#if defined(CONFIG_SPI_MASTER)
static int __devinit cs4271_spi_probe(struct spi_device *spi)
{
	struct cs4271_private *cs4271;
	int ret;

	cs4271 = kzalloc(sizeof *cs4271, GFP_KERNEL);
	if (!cs4271)
		return -ENOMEM;

	spi_set_drvdata(spi, cs4271);
	cs4271->control_data = spi;
	cs4271->bus_type = SND_SOC_SPI;

	ret = snd_soc_register_codec(&spi->dev, &soc_codec_dev_cs4271,
				     &cs4271_dai, 1);
	if (ret < 0)
		kfree(cs4271);
	return ret;
}

static int __devexit cs4271_spi_remove(struct spi_device *spi)
{
	snd_soc_unregister_codec(&spi->dev);
	kfree(spi_get_drvdata(spi));
	return 0;
}

static struct spi_driver cs4271_spi_driver = {
	.driver = {
		.name	= "cs4271-codec",
		.owner	= THIS_MODULE,
	},
	.probe		= cs4271_spi_probe,
	.remove		= __devexit_p(cs4271_spi_remove),
};
#endif /* defined(CONFIG_SPI_MASTER) */
---

So, codec name I expect is "cs4271-codec", but codec registered with
name "spi0.0"

Here is boot log:
---
Jan  1 00:00:04 miniCio user.debug kernel: cs4271-codec spi0.0: codec
register spi0.0
Jan  1 00:00:04 miniCio user.debug kernel: cs4271-codec spi0.0: dai
register spi0.0 #1
Jan  1 00:00:04 miniCio user.debug kernel: Registered DAI 'cs4271-hifi'
Jan  1 00:00:04 miniCio user.debug kernel: Registered codec 'spi0.0'
Jan  1 00:00:04 miniCio user.info kernel: Codec driver for CS4271
registered
Jan  1 00:00:04 miniCio user.debug kernel: ep93xx-pcm-audio
ep93xx-pcm-audio: platform register ep93xx-pcm-audio
Jan  1 00:00:04 miniCio user.debug kernel: Registered platform
'ep93xx-pcm-audio'
Jan  1 00:00:04 miniCio user.debug kernel: ep93xx-i2s ep93xx-i2s: dai
register ep93xx-i2s
Jan  1 00:00:04 miniCio user.debug kernel: Registered DAI 'ep93xx-i2s'
Jan  1 00:00:04 miniCio user.debug kernel: soc-audio soc-audio: binding
CS4271 at idx 0
Jan  1 00:00:04 miniCio user.debug kernel: soc-audio soc-audio: CODEC
cs4271-codec not registered
Jan  1 00:00:04 miniCio user.debug kernel: soc-audio soc-audio:
Registered card 'EDB93XX'
Jan  1 00:00:04 miniCio user.info kernel: EDB93xx Machine ALSA Driver
Jan  1 00:00:04 miniCio user.info kernel: ALSA device list:
Jan  1 00:00:04 miniCio user.info kernel:   No soundcards found.
---

What am I doing wrong?

Alexander.





More information about the Alsa-devel mailing list