* [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* Re: [PATCH 01/11] sound: core: Add debug-print helper function
2012-05-08 13:56 [PATCH 01/11] sound: core: Add debug-print helper function Ola Lilja
@ 2012-05-08 14:08 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-05-08 14:08 UTC (permalink / raw)
To: Ola Lilja; +Cc: tiwai, alsa-devel, Liam Girdwood, Linus Walleij
[-- Attachment #1.1: Type: text/plain, Size: 1668 bytes --]
On Tue, May 08, 2012 at 03:56:25PM +0200, Ola Lilja wrote:
> Adds a function getting the stream-name as a string for
> a specific stream.
Adding Takashi as this is an ALSA core thing. Always CC maintainers on
patches and always try to use subject lines matching the standard for
the subsystem. Not cutting any text for his benefit.
>
> 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";
> +}
This needs to be exported for modular builds, or perhaps just made a
static inline in the header.
>
> /*
> * ENTRY functions
> --
> 1.7.8.3
>
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [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.