All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander <subaparts@yandex.ru>
To: alsa-devel@alsa-project.org
Subject: New SoC layer codec registration problem
Date: Thu, 28 Oct 2010 13:12:20 +0400	[thread overview]
Message-ID: <1288257140.2098.41.camel@r60e> (raw)

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.

             reply	other threads:[~2010-10-28  9:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28  9:12 Alexander [this message]
2010-10-28 14:07 ` New SoC layer codec registration problem Victor Rodriguez
2010-10-28 15:51   ` Alexander
2010-10-28 18:33     ` Mark Brown
2010-10-28 22:24       ` Alexander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288257140.2098.41.camel@r60e \
    --to=subaparts@yandex.ru \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.