Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@list.ru>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: ALSA devel <alsa-devel@alsa-project.org>,
	Lars-Peter Clausen <lars@metafoo.de>, Liam Girdwood <lrg@ti.com>,
	"Gabriel M. Beddingfield" <gabrbedd@gmail.com>,
	stsp@users.sourceforge.net
Subject: [PATCH] ASoC: define playback and capture streams in dummy codec
Date: Wed, 17 Apr 2013 16:34:06 +0400	[thread overview]
Message-ID: <20130417163406.4a3b339c@stas> (raw)
In-Reply-To: <20130412105943.GU9243@opensource.wolfsonmicro.com>

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

Hello.

This patch adds a playback and capture streams to the dummy codec DAI
configuration. Most permissive set of sampling rates and formats is used.

This patch is needed for playback and capturing on a codec-less systems,
as otherwise the PCM device nodes are not even created.

Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net>

[-- Attachment #2: 0001-ASoC-define-playback-and-capture-streams-in-dummy-co.patch --]
[-- Type: text/x-patch, Size: 1750 bytes --]

>From 9a498275e59c2c6ef933fe7d0cff79a13ba790ff Mon Sep 17 00:00:00 2001
From: Stas Sergeev <stsp@users.sourceforge.net>
Date: Thu, 11 Apr 2013 19:07:20 +0400
Subject: [PATCH] ASoC: define playback and capture streams in dummy codec

This patch adds a playback and capture streams to the dummy codec DAI
configuration. Most permissive set of sampling rates and formats is used.

This patch is needed for playback and capturing on a codec-less systems,
as otherwise the PCM device nodes are not even created.

Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net>
---
 sound/soc/soc-utils.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index fe4541d..4b3be6c 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -90,8 +90,33 @@ static struct snd_soc_platform_driver dummy_platform = {
 };
 
 static struct snd_soc_codec_driver dummy_codec;
+
+#define STUB_RATES	SNDRV_PCM_RATE_8000_192000
+#define STUB_FORMATS	(SNDRV_PCM_FMTBIT_S8 | \
+			SNDRV_PCM_FMTBIT_U8 | \
+			SNDRV_PCM_FMTBIT_S16_LE | \
+			SNDRV_PCM_FMTBIT_U16_LE | \
+			SNDRV_PCM_FMTBIT_S24_LE | \
+			SNDRV_PCM_FMTBIT_U24_LE | \
+			SNDRV_PCM_FMTBIT_S32_LE | \
+			SNDRV_PCM_FMTBIT_U32_LE | \
+			SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
 static struct snd_soc_dai_driver dummy_dai = {
 	.name = "snd-soc-dummy-dai",
+	.playback = {
+		.stream_name	= "Playback",
+		.channels_min	= 1,
+		.channels_max	= 384,
+		.rates		= STUB_RATES,
+		.formats	= STUB_FORMATS,
+	},
+	.capture = {
+		.stream_name	= "Capture",
+		.channels_min	= 1,
+		.channels_max	= 384,
+		.rates = STUB_RATES,
+		.formats = STUB_FORMATS,
+	 },
 };
 
 static int snd_soc_dummy_probe(struct platform_device *pdev)
-- 
1.7.11.7


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2013-04-17 12:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 10:53 [PATCH] ASoC: define playback and capture streams in dummy codec Stas Sergeev
2013-04-12 10:59 ` Mark Brown
2013-04-12 14:19   ` Stas Sergeev
2013-04-12 15:13     ` Gabriel M. Beddingfield
2013-04-12 15:20       ` Stas Sergeev
2013-04-12 15:24         ` Gabriel M. Beddingfield
2013-04-16 16:34           ` Stas Sergeev
2013-04-12 15:31         ` Lars-Peter Clausen
2013-04-12 16:37           ` Stas Sergeev
2013-04-12 16:55             ` Lars-Peter Clausen
2013-04-12 19:19               ` Stas Sergeev
2013-04-17 12:34   ` Stas Sergeev [this message]
2013-04-17 13:31     ` Mark Brown

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=20130417163406.4a3b339c@stas \
    --to=stsp@list.ru \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gabrbedd@gmail.com \
    --cc=lars@metafoo.de \
    --cc=lrg@ti.com \
    --cc=stsp@users.sourceforge.net \
    /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