From: Lars-Peter Clausen <lars@metafoo.de>
To: "Gabriel M. Beddingfield" <gabrbedd@gmail.com>
Cc: ALSA devel <alsa-devel@alsa-project.org>,
Steve Chen <schen@mvista.com>, Stas Sergeev <stsp@list.ru>
Subject: Re: [PATCH] asoc: add dummy codec
Date: Thu, 11 Apr 2013 20:02:33 +0200 [thread overview]
Message-ID: <5166FAB9.9010506@metafoo.de> (raw)
In-Reply-To: <5166DB38.1010706@gmail.com>
On 04/11/2013 05:48 PM, Gabriel M. Beddingfield wrote:
> 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:
Either you want a dummy or you want one with specific requirements. For the
former case use the dummy codec, for the later case add a proper driver.
Putting these kinds of things in your board file is in my opinion a bad habit.
- Lars
>
> 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
>
next prev parent reply other threads:[~2013-04-11 18:00 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
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 [this message]
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=5166FAB9.9010506@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=gabrbedd@gmail.com \
--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 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.