From 7653d557606c7cae921557a6a0ebb7c510e458eb Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 13 Aug 2007 17:38:54 +0200 Subject: [ALSA] pcm: merge rates[] from pcm_misc.c and pcm_native.c Merge the rates[] arrays from pcm_misc.c and pcm_native.c because they are both the same. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- include/sound/pcm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound/pcm.h') diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 73334e0f823..2d5dee2fcb6 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -922,6 +922,8 @@ snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream, snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, void __user **bufs, snd_pcm_uframes_t frames); +extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates; + int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, -- cgit v1.2.3 From 918f3a0e8cf67b5db966516f255eaf24d814fac0 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 13 Aug 2007 17:40:54 +0200 Subject: [ALSA] pcm: add snd_pcm_rate_to_rate_bit() helper Add a snd_pcm_rate_to_rate_bit() function to factor out common code used by several drivers. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- include/sound/pcm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound/pcm.h') diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 2d5dee2fcb6..27f8ef48b5e 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -925,6 +925,7 @@ snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates; int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); +unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, struct snd_dma_buffer *bufp) -- cgit v1.2.3 From b9f09a485937d9c3fb524b2fa140fee1d94856d0 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 11 Sep 2007 00:33:48 +0200 Subject: [ALSA] Fix 'discards qualifiers' compile warnings in pcm.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed cast messes in pcm.h. include/sound/pcm.h: In function ‘hw_param_interval_c’: include/sound/pcm.h:800: warning: passing argument 1 of ‘hw_param_interval’ discards qualifiers from pointer target type Simply redefine the inline functions again for const pointers. Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- include/sound/pcm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/sound/pcm.h') diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 27f8ef48b5e..76b34b5841e 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -791,13 +791,13 @@ static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *p static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var) { - return (const struct snd_mask *)hw_param_mask((struct snd_pcm_hw_params*) params, var); + return ¶ms->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; } static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var) { - return (const struct snd_interval *)hw_param_interval((struct snd_pcm_hw_params*) params, var); + return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; } #define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) -- cgit v1.2.3 From 503fc85a3b15b0e939ad9672e376ffc9c4840591 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 11 Sep 2007 00:35:06 +0200 Subject: [ALSA] Kill useless volatile in pcm.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The volatile prefix is just useless there. Let's kill them, and then gcc will be happier, too. sound/acore/pcm.c:867: warning: passing argument 1 of ‘__constant_c_and_count_memset’ discards qualifiers from pointer target type Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- include/sound/pcm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/sound/pcm.h') diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 76b34b5841e..805d7207f08 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -301,8 +301,8 @@ struct snd_pcm_runtime { union snd_pcm_sync_id sync; /* hardware synchronization ID */ /* -- mmap -- */ - volatile struct snd_pcm_mmap_status *status; - volatile struct snd_pcm_mmap_control *control; + struct snd_pcm_mmap_status *status; + struct snd_pcm_mmap_control *control; /* -- locking / scheduling -- */ wait_queue_head_t sleep; -- cgit v1.2.3 From c1017a4cdb68ae5368fbc9ee42c77f1f5dca8916 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 15 Oct 2007 09:50:19 +0200 Subject: [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz Signed-off-by: Jaroslav Kysela --- include/sound/pcm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sound/pcm.h') diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 805d7207f08..5e9cc460075 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -3,7 +3,7 @@ /* * Digital Audio (PCM) abstract layer - * Copyright (c) by Jaroslav Kysela + * Copyright (c) by Jaroslav Kysela * Abramo Bagnara * * -- cgit v1.2.3