All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] sound: core: Add debug-print helper function
@ 2012-05-08 13:56 Ola Lilja
  2012-05-08 14:08 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Ola Lilja @ 2012-05-08 13:56 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/pcm.h |    2 ++
 sound/core/pcm.c    |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 0d11128..8a153e6 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1073,4 +1073,6 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
 
 const char *snd_pcm_format_name(snd_pcm_format_t format);
 
+const char *snd_pcm_stream_str(struct snd_pcm_substream *substream);
+
 #endif /* __SOUND_PCM_H */
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 1a3070b..9e83f00 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -1187,6 +1187,16 @@ static void snd_pcm_proc_done(void)
 #define snd_pcm_proc_done()
 #endif /* CONFIG_PROC_FS */
 
+/**
+ * Get a string naming the direction of a stream
+ */
+const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
+{
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		return "Playback";
+	else
+		return "Capture";
+}
 
 /*
  *  ENTRY functions
-- 
1.7.8.3

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

end of thread, other threads:[~2012-05-08 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-08 13:56 [PATCH 01/11] sound: core: Add debug-print helper function Ola Lilja
2012-05-08 14:08 ` Mark Brown

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.