diff options
Diffstat (limited to 'include/sound/pcm_params.h')
-rw-r--r-- | include/sound/pcm_params.h | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 60b0e92e26f3..fb18aef77341 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
@@ -22,17 +22,17 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | extern int snd_pcm_hw_param_mask(snd_pcm_substream_t *pcm, snd_pcm_hw_params_t *params, | 25 | extern int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
26 | snd_pcm_hw_param_t var, const snd_mask_t *val); | 26 | snd_pcm_hw_param_t var, const struct snd_mask *val); |
27 | extern unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params, | 27 | extern unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params, |
28 | snd_pcm_hw_param_t var, int *dir); | 28 | snd_pcm_hw_param_t var, int *dir); |
29 | extern unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params, | 29 | extern unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params, |
30 | snd_pcm_hw_param_t var, int *dir); | 30 | snd_pcm_hw_param_t var, int *dir); |
31 | extern int _snd_pcm_hw_param_min(snd_pcm_hw_params_t *params, | 31 | extern int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params, |
32 | snd_pcm_hw_param_t var, unsigned int val, int dir); | 32 | snd_pcm_hw_param_t var, unsigned int val, int dir); |
33 | extern int _snd_pcm_hw_param_setinteger(snd_pcm_hw_params_t *params, | 33 | extern int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params, |
34 | snd_pcm_hw_param_t var); | 34 | snd_pcm_hw_param_t var); |
35 | extern int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, | 35 | extern int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params, |
36 | snd_pcm_hw_param_t var, unsigned int val, int dir); | 36 | snd_pcm_hw_param_t var, unsigned int val, int dir); |
37 | 37 | ||
38 | /* To share the same code we have alsa-lib */ | 38 | /* To share the same code we have alsa-lib */ |
@@ -71,20 +71,20 @@ INLINE unsigned int ld2(u_int32_t v) | |||
71 | 71 | ||
72 | INLINE size_t snd_mask_sizeof(void) | 72 | INLINE size_t snd_mask_sizeof(void) |
73 | { | 73 | { |
74 | return sizeof(snd_mask_t); | 74 | return sizeof(struct snd_mask); |
75 | } | 75 | } |
76 | 76 | ||
77 | INLINE void snd_mask_none(snd_mask_t *mask) | 77 | INLINE void snd_mask_none(struct snd_mask *mask) |
78 | { | 78 | { |
79 | memset(mask, 0, sizeof(*mask)); | 79 | memset(mask, 0, sizeof(*mask)); |
80 | } | 80 | } |
81 | 81 | ||
82 | INLINE void snd_mask_any(snd_mask_t *mask) | 82 | INLINE void snd_mask_any(struct snd_mask *mask) |
83 | { | 83 | { |
84 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 84 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
85 | } | 85 | } |
86 | 86 | ||
87 | INLINE int snd_mask_empty(const snd_mask_t *mask) | 87 | INLINE int snd_mask_empty(const struct snd_mask *mask) |
88 | { | 88 | { |
89 | int i; | 89 | int i; |
90 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 90 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
@@ -93,7 +93,7 @@ INLINE int snd_mask_empty(const snd_mask_t *mask) | |||
93 | return 1; | 93 | return 1; |
94 | } | 94 | } |
95 | 95 | ||
96 | INLINE unsigned int snd_mask_min(const snd_mask_t *mask) | 96 | INLINE unsigned int snd_mask_min(const struct snd_mask *mask) |
97 | { | 97 | { |
98 | int i; | 98 | int i; |
99 | assert(!snd_mask_empty(mask)); | 99 | assert(!snd_mask_empty(mask)); |
@@ -104,7 +104,7 @@ INLINE unsigned int snd_mask_min(const snd_mask_t *mask) | |||
104 | return 0; | 104 | return 0; |
105 | } | 105 | } |
106 | 106 | ||
107 | INLINE unsigned int snd_mask_max(const snd_mask_t *mask) | 107 | INLINE unsigned int snd_mask_max(const struct snd_mask *mask) |
108 | { | 108 | { |
109 | int i; | 109 | int i; |
110 | assert(!snd_mask_empty(mask)); | 110 | assert(!snd_mask_empty(mask)); |
@@ -115,19 +115,19 @@ INLINE unsigned int snd_mask_max(const snd_mask_t *mask) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | INLINE void snd_mask_set(snd_mask_t *mask, unsigned int val) | 118 | INLINE void snd_mask_set(struct snd_mask *mask, unsigned int val) |
119 | { | 119 | { |
120 | assert(val <= SNDRV_MASK_BITS); | 120 | assert(val <= SNDRV_MASK_BITS); |
121 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); | 121 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); |
122 | } | 122 | } |
123 | 123 | ||
124 | INLINE void snd_mask_reset(snd_mask_t *mask, unsigned int val) | 124 | INLINE void snd_mask_reset(struct snd_mask *mask, unsigned int val) |
125 | { | 125 | { |
126 | assert(val <= SNDRV_MASK_BITS); | 126 | assert(val <= SNDRV_MASK_BITS); |
127 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); | 127 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); |
128 | } | 128 | } |
129 | 129 | ||
130 | INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int to) | 130 | INLINE void snd_mask_set_range(struct snd_mask *mask, unsigned int from, unsigned int to) |
131 | { | 131 | { |
132 | unsigned int i; | 132 | unsigned int i; |
133 | assert(to <= SNDRV_MASK_BITS && from <= to); | 133 | assert(to <= SNDRV_MASK_BITS && from <= to); |
@@ -135,7 +135,7 @@ INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int | |||
135 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); | 135 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); |
136 | } | 136 | } |
137 | 137 | ||
138 | INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned int to) | 138 | INLINE void snd_mask_reset_range(struct snd_mask *mask, unsigned int from, unsigned int to) |
139 | { | 139 | { |
140 | unsigned int i; | 140 | unsigned int i; |
141 | assert(to <= SNDRV_MASK_BITS && from <= to); | 141 | assert(to <= SNDRV_MASK_BITS && from <= to); |
@@ -143,7 +143,7 @@ INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned i | |||
143 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); | 143 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); |
144 | } | 144 | } |
145 | 145 | ||
146 | INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val) | 146 | INLINE void snd_mask_leave(struct snd_mask *mask, unsigned int val) |
147 | { | 147 | { |
148 | unsigned int v; | 148 | unsigned int v; |
149 | assert(val <= SNDRV_MASK_BITS); | 149 | assert(val <= SNDRV_MASK_BITS); |
@@ -152,30 +152,30 @@ INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val) | |||
152 | mask->bits[MASK_OFS(val)] = v; | 152 | mask->bits[MASK_OFS(val)] = v; |
153 | } | 153 | } |
154 | 154 | ||
155 | INLINE void snd_mask_intersect(snd_mask_t *mask, const snd_mask_t *v) | 155 | INLINE void snd_mask_intersect(struct snd_mask *mask, const struct snd_mask *v) |
156 | { | 156 | { |
157 | int i; | 157 | int i; |
158 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 158 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
159 | mask->bits[i] &= v->bits[i]; | 159 | mask->bits[i] &= v->bits[i]; |
160 | } | 160 | } |
161 | 161 | ||
162 | INLINE int snd_mask_eq(const snd_mask_t *mask, const snd_mask_t *v) | 162 | INLINE int snd_mask_eq(const struct snd_mask *mask, const struct snd_mask *v) |
163 | { | 163 | { |
164 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 164 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
165 | } | 165 | } |
166 | 166 | ||
167 | INLINE void snd_mask_copy(snd_mask_t *mask, const snd_mask_t *v) | 167 | INLINE void snd_mask_copy(struct snd_mask *mask, const struct snd_mask *v) |
168 | { | 168 | { |
169 | *mask = *v; | 169 | *mask = *v; |
170 | } | 170 | } |
171 | 171 | ||
172 | INLINE int snd_mask_test(const snd_mask_t *mask, unsigned int val) | 172 | INLINE int snd_mask_test(const struct snd_mask *mask, unsigned int val) |
173 | { | 173 | { |
174 | assert(val <= SNDRV_MASK_BITS); | 174 | assert(val <= SNDRV_MASK_BITS); |
175 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); | 175 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); |
176 | } | 176 | } |
177 | 177 | ||
178 | INLINE int snd_mask_single(const snd_mask_t *mask) | 178 | INLINE int snd_mask_single(const struct snd_mask *mask) |
179 | { | 179 | { |
180 | int i, c = 0; | 180 | int i, c = 0; |
181 | assert(!snd_mask_empty(mask)); | 181 | assert(!snd_mask_empty(mask)); |
@@ -191,9 +191,9 @@ INLINE int snd_mask_single(const snd_mask_t *mask) | |||
191 | return 1; | 191 | return 1; |
192 | } | 192 | } |
193 | 193 | ||
194 | INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v) | 194 | INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) |
195 | { | 195 | { |
196 | snd_mask_t old; | 196 | struct snd_mask old; |
197 | assert(!snd_mask_empty(mask)); | 197 | assert(!snd_mask_empty(mask)); |
198 | snd_mask_copy(&old, mask); | 198 | snd_mask_copy(&old, mask); |
199 | snd_mask_intersect(mask, v); | 199 | snd_mask_intersect(mask, v); |
@@ -202,7 +202,7 @@ INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v) | |||
202 | return !snd_mask_eq(mask, &old); | 202 | return !snd_mask_eq(mask, &old); |
203 | } | 203 | } |
204 | 204 | ||
205 | INLINE int snd_mask_refine_first(snd_mask_t *mask) | 205 | INLINE int snd_mask_refine_first(struct snd_mask *mask) |
206 | { | 206 | { |
207 | assert(!snd_mask_empty(mask)); | 207 | assert(!snd_mask_empty(mask)); |
208 | if (snd_mask_single(mask)) | 208 | if (snd_mask_single(mask)) |
@@ -211,7 +211,7 @@ INLINE int snd_mask_refine_first(snd_mask_t *mask) | |||
211 | return 1; | 211 | return 1; |
212 | } | 212 | } |
213 | 213 | ||
214 | INLINE int snd_mask_refine_last(snd_mask_t *mask) | 214 | INLINE int snd_mask_refine_last(struct snd_mask *mask) |
215 | { | 215 | { |
216 | assert(!snd_mask_empty(mask)); | 216 | assert(!snd_mask_empty(mask)); |
217 | if (snd_mask_single(mask)) | 217 | if (snd_mask_single(mask)) |
@@ -220,7 +220,7 @@ INLINE int snd_mask_refine_last(snd_mask_t *mask) | |||
220 | return 1; | 220 | return 1; |
221 | } | 221 | } |
222 | 222 | ||
223 | INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val) | 223 | INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) |
224 | { | 224 | { |
225 | assert(!snd_mask_empty(mask)); | 225 | assert(!snd_mask_empty(mask)); |
226 | if (snd_mask_min(mask) >= val) | 226 | if (snd_mask_min(mask) >= val) |
@@ -231,7 +231,7 @@ INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val) | |||
231 | return 1; | 231 | return 1; |
232 | } | 232 | } |
233 | 233 | ||
234 | INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val) | 234 | INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) |
235 | { | 235 | { |
236 | assert(!snd_mask_empty(mask)); | 236 | assert(!snd_mask_empty(mask)); |
237 | if (snd_mask_max(mask) <= val) | 237 | if (snd_mask_max(mask) <= val) |
@@ -242,7 +242,7 @@ INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val) | |||
242 | return 1; | 242 | return 1; |
243 | } | 243 | } |
244 | 244 | ||
245 | INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val) | 245 | INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) |
246 | { | 246 | { |
247 | int changed; | 247 | int changed; |
248 | assert(!snd_mask_empty(mask)); | 248 | assert(!snd_mask_empty(mask)); |
@@ -253,13 +253,13 @@ INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val) | |||
253 | return changed; | 253 | return changed; |
254 | } | 254 | } |
255 | 255 | ||
256 | INLINE int snd_mask_value(const snd_mask_t *mask) | 256 | INLINE int snd_mask_value(const struct snd_mask *mask) |
257 | { | 257 | { |
258 | assert(!snd_mask_empty(mask)); | 258 | assert(!snd_mask_empty(mask)); |
259 | return snd_mask_min(mask); | 259 | return snd_mask_min(mask); |
260 | } | 260 | } |
261 | 261 | ||
262 | INLINE void snd_interval_any(snd_interval_t *i) | 262 | INLINE void snd_interval_any(struct snd_interval *i) |
263 | { | 263 | { |
264 | i->min = 0; | 264 | i->min = 0; |
265 | i->openmin = 0; | 265 | i->openmin = 0; |
@@ -269,42 +269,42 @@ INLINE void snd_interval_any(snd_interval_t *i) | |||
269 | i->empty = 0; | 269 | i->empty = 0; |
270 | } | 270 | } |
271 | 271 | ||
272 | INLINE void snd_interval_none(snd_interval_t *i) | 272 | INLINE void snd_interval_none(struct snd_interval *i) |
273 | { | 273 | { |
274 | i->empty = 1; | 274 | i->empty = 1; |
275 | } | 275 | } |
276 | 276 | ||
277 | INLINE int snd_interval_checkempty(const snd_interval_t *i) | 277 | INLINE int snd_interval_checkempty(const struct snd_interval *i) |
278 | { | 278 | { |
279 | return (i->min > i->max || | 279 | return (i->min > i->max || |
280 | (i->min == i->max && (i->openmin || i->openmax))); | 280 | (i->min == i->max && (i->openmin || i->openmax))); |
281 | } | 281 | } |
282 | 282 | ||
283 | INLINE int snd_interval_empty(const snd_interval_t *i) | 283 | INLINE int snd_interval_empty(const struct snd_interval *i) |
284 | { | 284 | { |
285 | return i->empty; | 285 | return i->empty; |
286 | } | 286 | } |
287 | 287 | ||
288 | INLINE int snd_interval_single(const snd_interval_t *i) | 288 | INLINE int snd_interval_single(const struct snd_interval *i) |
289 | { | 289 | { |
290 | assert(!snd_interval_empty(i)); | 290 | assert(!snd_interval_empty(i)); |
291 | return (i->min == i->max || | 291 | return (i->min == i->max || |
292 | (i->min + 1 == i->max && i->openmax)); | 292 | (i->min + 1 == i->max && i->openmax)); |
293 | } | 293 | } |
294 | 294 | ||
295 | INLINE int snd_interval_value(const snd_interval_t *i) | 295 | INLINE int snd_interval_value(const struct snd_interval *i) |
296 | { | 296 | { |
297 | assert(snd_interval_single(i)); | 297 | assert(snd_interval_single(i)); |
298 | return i->min; | 298 | return i->min; |
299 | } | 299 | } |
300 | 300 | ||
301 | INLINE int snd_interval_min(const snd_interval_t *i) | 301 | INLINE int snd_interval_min(const struct snd_interval *i) |
302 | { | 302 | { |
303 | assert(!snd_interval_empty(i)); | 303 | assert(!snd_interval_empty(i)); |
304 | return i->min; | 304 | return i->min; |
305 | } | 305 | } |
306 | 306 | ||
307 | INLINE int snd_interval_max(const snd_interval_t *i) | 307 | INLINE int snd_interval_max(const struct snd_interval *i) |
308 | { | 308 | { |
309 | unsigned int v; | 309 | unsigned int v; |
310 | assert(!snd_interval_empty(i)); | 310 | assert(!snd_interval_empty(i)); |
@@ -314,18 +314,18 @@ INLINE int snd_interval_max(const snd_interval_t *i) | |||
314 | return v; | 314 | return v; |
315 | } | 315 | } |
316 | 316 | ||
317 | INLINE int snd_interval_test(const snd_interval_t *i, unsigned int val) | 317 | INLINE int snd_interval_test(const struct snd_interval *i, unsigned int val) |
318 | { | 318 | { |
319 | return !((i->min > val || (i->min == val && i->openmin) || | 319 | return !((i->min > val || (i->min == val && i->openmin) || |
320 | i->max < val || (i->max == val && i->openmax))); | 320 | i->max < val || (i->max == val && i->openmax))); |
321 | } | 321 | } |
322 | 322 | ||
323 | INLINE void snd_interval_copy(snd_interval_t *d, const snd_interval_t *s) | 323 | INLINE void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) |
324 | { | 324 | { |
325 | *d = *s; | 325 | *d = *s; |
326 | } | 326 | } |
327 | 327 | ||
328 | INLINE int snd_interval_setinteger(snd_interval_t *i) | 328 | INLINE int snd_interval_setinteger(struct snd_interval *i) |
329 | { | 329 | { |
330 | if (i->integer) | 330 | if (i->integer) |
331 | return 0; | 331 | return 0; |
@@ -335,7 +335,7 @@ INLINE int snd_interval_setinteger(snd_interval_t *i) | |||
335 | return 1; | 335 | return 1; |
336 | } | 336 | } |
337 | 337 | ||
338 | INLINE int snd_interval_eq(const snd_interval_t *i1, const snd_interval_t *i2) | 338 | INLINE int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) |
339 | { | 339 | { |
340 | if (i1->empty) | 340 | if (i1->empty) |
341 | return i2->empty; | 341 | return i2->empty; |