aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-18 07:53:29 -0400
committerTakashi Iwai <tiwai@suse.de>2012-07-18 07:53:29 -0400
commitf0913cd16e8a6608cf9558ccbe8fdf4d428ca3de (patch)
treed6ea8cc44a9d55d29d38605165a09cf69ff9a536 /include/sound
parent61eab000f3536f080eab43fd5eed3fd817ded76e (diff)
parent59b1f084abd8690ffe68c67758ad08bbcb7d1af0 (diff)
Merge branch 'topic/misc' into for-next
Generic updates for sound 3.6
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/pcm.h3
-rw-r--r--include/sound/pcm_params.h2
-rw-r--r--include/sound/tlv.h29
3 files changed, 25 insertions, 9 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 0d1112815be3..e91e6047ca6f 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -810,7 +810,7 @@ int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_pa
810int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, 810int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
811 unsigned int cond, 811 unsigned int cond,
812 snd_pcm_hw_param_t var, 812 snd_pcm_hw_param_t var,
813 struct snd_pcm_hw_constraint_list *l); 813 const struct snd_pcm_hw_constraint_list *l);
814int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 814int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
815 unsigned int cond, 815 unsigned int cond,
816 snd_pcm_hw_param_t var, 816 snd_pcm_hw_param_t var,
@@ -893,6 +893,7 @@ extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
893 893
894int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); 894int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime);
895unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); 895unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate);
896unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit);
896 897
897static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, 898static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
898 struct snd_dma_buffer *bufp) 899 struct snd_dma_buffer *bufp)
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index f494f1e3c900..37ae12e0ab06 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -22,6 +22,8 @@
22 * 22 *
23 */ 23 */
24 24
25#include <sound/pcm.h>
26
25int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, 27int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm,
26 struct snd_pcm_hw_params *params, 28 struct snd_pcm_hw_params *params,
27 snd_pcm_hw_param_t var, int *dir); 29 snd_pcm_hw_param_t var, int *dir);
diff --git a/include/sound/tlv.h b/include/sound/tlv.h
index 7067e2dfb0b9..a64d8fe3f855 100644
--- a/include/sound/tlv.h
+++ b/include/sound/tlv.h
@@ -38,21 +38,31 @@
38#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ 38#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */
39#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ 39#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */
40 40
41#define TLV_ITEM(type, ...) \
42 (type), TLV_LENGTH(__VA_ARGS__), __VA_ARGS__
43#define TLV_LENGTH(...) \
44 ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ }))
45
46#define TLV_CONTAINER_ITEM(...) \
47 TLV_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__)
48#define DECLARE_TLV_CONTAINER(name, ...) \
49 unsigned int name[] = { TLV_CONTAINER_ITEM(__VA_ARGS__) }
50
41#define TLV_DB_SCALE_MASK 0xffff 51#define TLV_DB_SCALE_MASK 0xffff
42#define TLV_DB_SCALE_MUTE 0x10000 52#define TLV_DB_SCALE_MUTE 0x10000
43#define TLV_DB_SCALE_ITEM(min, step, mute) \ 53#define TLV_DB_SCALE_ITEM(min, step, mute) \
44 SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ 54 TLV_ITEM(SNDRV_CTL_TLVT_DB_SCALE, \
45 (min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0) 55 (min), \
56 ((step) & TLV_DB_SCALE_MASK) | \
57 ((mute) ? TLV_DB_SCALE_MUTE : 0))
46#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ 58#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
47 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } 59 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) }
48 60
49/* dB scale specified with min/max values instead of step */ 61/* dB scale specified with min/max values instead of step */
50#define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \ 62#define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \
51 SNDRV_CTL_TLVT_DB_MINMAX, 2 * sizeof(unsigned int), \ 63 TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB))
52 (min_dB), (max_dB)
53#define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ 64#define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
54 SNDRV_CTL_TLVT_DB_MINMAX_MUTE, 2 * sizeof(unsigned int), \ 65 TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX_MUTE, (min_dB), (max_dB))
55 (min_dB), (max_dB)
56#define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \ 66#define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \
57 unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) } 67 unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) }
58#define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \ 68#define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \
@@ -60,13 +70,16 @@
60 70
61/* linear volume between min_dB and max_dB (.01dB unit) */ 71/* linear volume between min_dB and max_dB (.01dB unit) */
62#define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ 72#define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \
63 SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ 73 TLV_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB))
64 (min_dB), (max_dB)
65#define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \ 74#define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \
66 unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) } 75 unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) }
67 76
68/* dB range container */ 77/* dB range container */
69/* Each item is: <min> <max> <TLV> */ 78/* Each item is: <min> <max> <TLV> */
79#define TLV_DB_RANGE_ITEM(...) \
80 TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__)
81#define DECLARE_TLV_DB_RANGE(name, ...) \
82 unsigned int name[] = { TLV_DB_RANGE_ITEM(__VA_ARGS__) }
70/* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */ 83/* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */
71#define TLV_DB_RANGE_HEAD(num) \ 84#define TLV_DB_RANGE_HEAD(num) \
72 SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int) 85 SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int)