ALSA: pcm: Add debug-print helper function
authorOla Lilja <ola.o.lilja@stericsson.com>
Thu, 24 May 2012 13:26:03 +0000 (15:26 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 3 Jun 2012 12:06:38 +0000 (13:06 +0100)
Adds a function getting the stream-name as a string for
a specific stream.

Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/pcm.h

index 0d1112815be3be6ea96a5ec1768382bb70aea571..a55d5db7eb5a835e659ce63cd88d403313f7a296 100644 (file)
@@ -1073,4 +1073,15 @@ 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);
 
+/**
+ * Get a string naming the direction of a stream
+ */
+static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
+{
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               return "Playback";
+       else
+               return "Capture";
+}
+
 #endif /* __SOUND_PCM_H */