Skip to content

Commit 1aad779

Browse files
elilolabroonie
authored andcommitted
ALSA: pcm: Add debug-print helper function
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>
1 parent 656baae commit 1aad779

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎include/sound/pcm.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,4 +1073,15 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
10731073

10741074
const char *snd_pcm_format_name(snd_pcm_format_t format);
10751075

1076+
/**
1077+
* Get a string naming the direction of a stream
1078+
*/
1079+
static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
1080+
{
1081+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
1082+
return "Playback";
1083+
else
1084+
return "Capture";
1085+
}
1086+
10761087
#endif /* __SOUND_PCM_H */

0 commit comments

Comments
 (0)