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"; +}