Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Gabriel M. Beddingfield" <gabrbedd@gmail.com>
To: Stas Sergeev <stsp@list.ru>
Cc: ALSA devel <alsa-devel@alsa-project.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Steve Chen <schen@mvista.com>
Subject: Re: [PATCH] asoc: add dummy codec
Date: Thu, 11 Apr 2013 08:48:08 -0700	[thread overview]
Message-ID: <5166DB38.1010706@gmail.com> (raw)
In-Reply-To: <5166D295.2070400@list.ru>

On 04/11/2013 08:11 AM, Stas Sergeev wrote:
>> There is already a dummy codec driver.
>>
>> Please take a look at sound/soc/soc-utils.c
>>
>> - Lars
> Lars, indeed, this codec is present in a git kernel and
> it wasn't in mine android kernel.
> But, that driver is too dummy to even work at all.
> 
> The attached patch adds a playback stream for the dummy
> codec. Would it be possible to apply this?

No... not like that.

Instead, wouldn't it be better to extend it by defining some platform data?  Maybe something like:

diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index fe4541d..9d22718 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -96,9 +96,14 @@ static struct snd_soc_dai_driver dummy_dai = {
 
 static int snd_soc_dummy_probe(struct platform_device *pdev)
 {
+       struct snd_soc_dummy_dai_pdata *pdata = dev_get_platdata(&pdev->dev);
        int ret;
 
-       ret = snd_soc_register_codec(&pdev->dev, &dummy_codec, &dummy_dai, 1);
+       if (pdata->n_dai > 0)
+               ret = snd_soc_register_codec(&pdev->dev, &dummy_codec,
+                                            &pdata->dai, &pdata->n_dai);
+       else
+               ret = snd_soc_register_codec(&pdev->dev, &dummy_codec, &dummy_dai, 1);
        if (ret < 0)
                return ret;
 

...then you can define whatever kind of DAI you want in the machine driver.

-gabriel

  reply	other threads:[~2013-04-11 15:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 10:36 [PATCH] asoc: add dummy codec Stas Sergeev
2013-04-11 10:41 ` Lars-Peter Clausen
2013-04-11 13:57   ` Stas Sergeev
2013-04-11 14:21     ` Lars-Peter Clausen
2013-04-11 14:33       ` Stas Sergeev
2013-04-11 15:11   ` Stas Sergeev
2013-04-11 15:48     ` Gabriel M. Beddingfield [this message]
2013-04-11 16:03       ` Stas Sergeev
2013-04-11 16:13         ` Gabriel M. Beddingfield
2013-04-11 16:44           ` Stas Sergeev
2013-04-11 18:02       ` Lars-Peter Clausen
2013-04-12  2:58         ` Gabriel M. Beddingfield
2013-04-12  2:50       ` Gabriel M. Beddingfield
2013-04-12  9:09         ` Stas Sergeev
2013-04-11 17:58     ` Lars-Peter Clausen

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=5166DB38.1010706@gmail.com \
    --to=gabrbedd@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lars@metafoo.de \
    --cc=schen@mvista.com \
    --cc=stsp@list.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox