aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/pcm.h35
-rw-r--r--include/sound/pcm_params.h16
-rw-r--r--include/sound/soc-dapm.h6
3 files changed, 45 insertions, 12 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index e1bad113061..57e71fa33f7 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -507,6 +507,18 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
507void snd_pcm_vma_notify_data(void *client, void *data); 507void snd_pcm_vma_notify_data(void *client, void *data);
508int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); 508int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
509 509
510
511#ifdef CONFIG_SND_DEBUG
512void snd_pcm_debug_name(struct snd_pcm_substream *substream,
513 char *name, size_t len);
514#else
515static inline void
516snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
517{
518 *buf = 0;
519}
520#endif
521
510/* 522/*
511 * PCM library 523 * PCM library
512 */ 524 */
@@ -749,17 +761,18 @@ static inline const struct snd_interval *hw_param_interval_c(const struct snd_pc
749 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 761 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
750} 762}
751 763
752#define params_access(p) ((__force snd_pcm_access_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS))) 764#define params_channels(p) \
753#define params_format(p) ((__force snd_pcm_format_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT))) 765 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min)
754#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) 766#define params_rate(p) \
755#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min 767 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_RATE)->min)
756#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min 768#define params_period_size(p) \
757#define params_period_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min 769 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min)
758#define params_period_bytes(p) ((params_period_size(p)*snd_pcm_format_physical_width(params_format(p))*params_channels(p))/8) 770#define params_periods(p) \
759#define params_periods(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIODS)->min 771 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIODS)->min)
760#define params_buffer_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min 772#define params_buffer_size(p) \
761#define params_buffer_bytes(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min 773 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min)
762 774#define params_buffer_bytes(p) \
775 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min)
763 776
764int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v); 777int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
765void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); 778void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index 85cf1cf4f31..f494f1e3c90 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -337,5 +337,19 @@ static inline unsigned int sub(unsigned int a, unsigned int b)
337 return 0; 337 return 0;
338} 338}
339 339
340#endif /* __SOUND_PCM_PARAMS_H */ 340#define params_access(p) ((__force snd_pcm_access_t)\
341 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_ACCESS)))
342#define params_format(p) ((__force snd_pcm_format_t)\
343 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_FORMAT)))
344#define params_subformat(p) \
345 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_SUBFORMAT))
341 346
347static inline unsigned int
348params_period_bytes(const struct snd_pcm_hw_params *p)
349{
350 return (params_period_size(p) *
351 snd_pcm_format_physical_width(params_format(p)) *
352 params_channels(p)) / 8;
353}
354
355#endif /* __SOUND_PCM_PARAMS_H */
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index e09505c5a49..e0583b7769c 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -266,6 +266,12 @@
266 .get = snd_soc_dapm_get_enum_virt, \ 266 .get = snd_soc_dapm_get_enum_virt, \
267 .put = snd_soc_dapm_put_enum_virt, \ 267 .put = snd_soc_dapm_put_enum_virt, \
268 .private_value = (unsigned long)&xenum } 268 .private_value = (unsigned long)&xenum }
269#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \
270{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
271 .info = snd_soc_info_enum_double, \
272 .get = xget, \
273 .put = xput, \
274 .private_value = (unsigned long)&xenum }
269#define SOC_DAPM_VALUE_ENUM(xname, xenum) \ 275#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
270{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 276{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
271 .info = snd_soc_info_enum_double, \ 277 .info = snd_soc_info_enum_double, \