alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/8] ASoC: core: Add debug-print helper function
@ 2012-04-20  9:32 Ola Lilja
  2012-04-23 18:03 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Ola Lilja @ 2012-04-20  9:32 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, alsa-devel; +Cc: Ola Lilja, Linus Walleij

Adds a function getting the stream-name as a string for
a specific stream.

Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com>
---
 include/sound/soc.h |    1 +
 sound/soc/soc-pcm.c |    9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index bda0cd2..e89d309 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -345,6 +345,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform,
 int snd_soc_platform_write(struct snd_soc_platform *platform,
 					unsigned int reg, unsigned int val);
 int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
+const char *snd_soc_stream_str(struct snd_pcm_substream *substream);
 
 /* Utility functions to get clock rates from various things */
 int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 0ad8dca..6bec24f 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -705,3 +705,12 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 		cpu_dai->name);
 	return ret;
 }
+
+/* Get a string naming the direction of a stream */
+const char *snd_soc_stream_str(struct snd_pcm_substream *substream)
+{
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		return "Playback";
+	else
+		return "Capture";
+}
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-23 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-20  9:32 [PATCH 3/8] ASoC: core: Add debug-print helper function Ola Lilja
2012-04-23 18:03 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).