diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 07:59:38 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:17:43 -0500 |
commit | 877211f5e1b1196179ba1290e8e1a3dc00427c55 (patch) | |
tree | 9964e0e46043cee6c76a614ac35ab982faba7f99 /sound/core/pcm_lib.c | |
parent | 24c1f93188b4438c7f30df5b4cd78340cdb28daf (diff) |
[ALSA] Remove xxx_t typedefs: PCM
Modules: PCM Midlevel
Remove xxx_t typedefs from the core PCM codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r-- | sound/core/pcm_lib.c | 320 |
1 files changed, 159 insertions, 161 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 3dbf9bf2ac16..c58ec67d1cbf 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -39,9 +39,9 @@ | |||
39 | * | 39 | * |
40 | * when runtime->silence_size >= runtime->boundary - fill processed area with silence immediately | 40 | * when runtime->silence_size >= runtime->boundary - fill processed area with silence immediately |
41 | */ | 41 | */ |
42 | void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr) | 42 | void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr) |
43 | { | 43 | { |
44 | snd_pcm_runtime_t *runtime = substream->runtime; | 44 | struct snd_pcm_runtime *runtime = substream->runtime; |
45 | snd_pcm_uframes_t frames, ofs, transfer; | 45 | snd_pcm_uframes_t frames, ofs, transfer; |
46 | 46 | ||
47 | if (runtime->silence_size < runtime->boundary) { | 47 | if (runtime->silence_size < runtime->boundary) { |
@@ -128,7 +128,7 @@ void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t | |||
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | static void xrun(snd_pcm_substream_t *substream) | 131 | static void xrun(struct snd_pcm_substream *substream) |
132 | { | 132 | { |
133 | snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); | 133 | snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); |
134 | #ifdef CONFIG_SND_DEBUG | 134 | #ifdef CONFIG_SND_DEBUG |
@@ -143,8 +143,8 @@ static void xrun(snd_pcm_substream_t *substream) | |||
143 | #endif | 143 | #endif |
144 | } | 144 | } |
145 | 145 | ||
146 | static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(snd_pcm_substream_t *substream, | 146 | static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(struct snd_pcm_substream *substream, |
147 | snd_pcm_runtime_t *runtime) | 147 | struct snd_pcm_runtime *runtime) |
148 | { | 148 | { |
149 | snd_pcm_uframes_t pos; | 149 | snd_pcm_uframes_t pos; |
150 | 150 | ||
@@ -162,8 +162,8 @@ static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(snd_pcm_substream_t *s | |||
162 | return pos; | 162 | return pos; |
163 | } | 163 | } |
164 | 164 | ||
165 | static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream, | 165 | static inline int snd_pcm_update_hw_ptr_post(struct snd_pcm_substream *substream, |
166 | snd_pcm_runtime_t *runtime) | 166 | struct snd_pcm_runtime *runtime) |
167 | { | 167 | { |
168 | snd_pcm_uframes_t avail; | 168 | snd_pcm_uframes_t avail; |
169 | 169 | ||
@@ -185,9 +185,9 @@ static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream, | |||
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
187 | 187 | ||
188 | static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream) | 188 | static inline int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) |
189 | { | 189 | { |
190 | snd_pcm_runtime_t *runtime = substream->runtime; | 190 | struct snd_pcm_runtime *runtime = substream->runtime; |
191 | snd_pcm_uframes_t pos; | 191 | snd_pcm_uframes_t pos; |
192 | snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt; | 192 | snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt; |
193 | snd_pcm_sframes_t delta; | 193 | snd_pcm_sframes_t delta; |
@@ -232,9 +232,9 @@ static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream | |||
232 | } | 232 | } |
233 | 233 | ||
234 | /* CAUTION: call it with irq disabled */ | 234 | /* CAUTION: call it with irq disabled */ |
235 | int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream) | 235 | int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) |
236 | { | 236 | { |
237 | snd_pcm_runtime_t *runtime = substream->runtime; | 237 | struct snd_pcm_runtime *runtime = substream->runtime; |
238 | snd_pcm_uframes_t pos; | 238 | snd_pcm_uframes_t pos; |
239 | snd_pcm_uframes_t old_hw_ptr, new_hw_ptr; | 239 | snd_pcm_uframes_t old_hw_ptr, new_hw_ptr; |
240 | snd_pcm_sframes_t delta; | 240 | snd_pcm_sframes_t delta; |
@@ -281,10 +281,10 @@ int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream) | |||
281 | * | 281 | * |
282 | * Sets the given PCM operators to the pcm instance. | 282 | * Sets the given PCM operators to the pcm instance. |
283 | */ | 283 | */ |
284 | void snd_pcm_set_ops(snd_pcm_t *pcm, int direction, snd_pcm_ops_t *ops) | 284 | void snd_pcm_set_ops(struct snd_pcm *pcm, int direction, struct snd_pcm_ops *ops) |
285 | { | 285 | { |
286 | snd_pcm_str_t *stream = &pcm->streams[direction]; | 286 | struct snd_pcm_str *stream = &pcm->streams[direction]; |
287 | snd_pcm_substream_t *substream; | 287 | struct snd_pcm_substream *substream; |
288 | 288 | ||
289 | for (substream = stream->substream; substream != NULL; substream = substream->next) | 289 | for (substream = stream->substream; substream != NULL; substream = substream->next) |
290 | substream->ops = ops; | 290 | substream->ops = ops; |
@@ -297,9 +297,9 @@ void snd_pcm_set_ops(snd_pcm_t *pcm, int direction, snd_pcm_ops_t *ops) | |||
297 | * | 297 | * |
298 | * Sets the PCM sync identifier for the card. | 298 | * Sets the PCM sync identifier for the card. |
299 | */ | 299 | */ |
300 | void snd_pcm_set_sync(snd_pcm_substream_t * substream) | 300 | void snd_pcm_set_sync(struct snd_pcm_substream *substream) |
301 | { | 301 | { |
302 | snd_pcm_runtime_t *runtime = substream->runtime; | 302 | struct snd_pcm_runtime *runtime = substream->runtime; |
303 | 303 | ||
304 | runtime->sync.id32[0] = substream->pcm->card->number; | 304 | runtime->sync.id32[0] = substream->pcm->card->number; |
305 | runtime->sync.id32[1] = -1; | 305 | runtime->sync.id32[1] = -1; |
@@ -370,7 +370,7 @@ static inline unsigned int muldiv32(unsigned int a, unsigned int b, | |||
370 | return n; | 370 | return n; |
371 | } | 371 | } |
372 | 372 | ||
373 | static int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin) | 373 | static int snd_interval_refine_min(struct snd_interval *i, unsigned int min, int openmin) |
374 | { | 374 | { |
375 | int changed = 0; | 375 | int changed = 0; |
376 | assert(!snd_interval_empty(i)); | 376 | assert(!snd_interval_empty(i)); |
@@ -395,7 +395,7 @@ static int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int open | |||
395 | return changed; | 395 | return changed; |
396 | } | 396 | } |
397 | 397 | ||
398 | static int snd_interval_refine_max(snd_interval_t *i, unsigned int max, int openmax) | 398 | static int snd_interval_refine_max(struct snd_interval *i, unsigned int max, int openmax) |
399 | { | 399 | { |
400 | int changed = 0; | 400 | int changed = 0; |
401 | assert(!snd_interval_empty(i)); | 401 | assert(!snd_interval_empty(i)); |
@@ -431,7 +431,7 @@ static int snd_interval_refine_max(snd_interval_t *i, unsigned int max, int open | |||
431 | * | 431 | * |
432 | * Returns non-zero if the value is changed, zero if not changed. | 432 | * Returns non-zero if the value is changed, zero if not changed. |
433 | */ | 433 | */ |
434 | int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v) | 434 | int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v) |
435 | { | 435 | { |
436 | int changed = 0; | 436 | int changed = 0; |
437 | assert(!snd_interval_empty(i)); | 437 | assert(!snd_interval_empty(i)); |
@@ -473,7 +473,7 @@ int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v) | |||
473 | return changed; | 473 | return changed; |
474 | } | 474 | } |
475 | 475 | ||
476 | static int snd_interval_refine_first(snd_interval_t *i) | 476 | static int snd_interval_refine_first(struct snd_interval *i) |
477 | { | 477 | { |
478 | assert(!snd_interval_empty(i)); | 478 | assert(!snd_interval_empty(i)); |
479 | if (snd_interval_single(i)) | 479 | if (snd_interval_single(i)) |
@@ -485,7 +485,7 @@ static int snd_interval_refine_first(snd_interval_t *i) | |||
485 | return 1; | 485 | return 1; |
486 | } | 486 | } |
487 | 487 | ||
488 | static int snd_interval_refine_last(snd_interval_t *i) | 488 | static int snd_interval_refine_last(struct snd_interval *i) |
489 | { | 489 | { |
490 | assert(!snd_interval_empty(i)); | 490 | assert(!snd_interval_empty(i)); |
491 | if (snd_interval_single(i)) | 491 | if (snd_interval_single(i)) |
@@ -497,9 +497,9 @@ static int snd_interval_refine_last(snd_interval_t *i) | |||
497 | return 1; | 497 | return 1; |
498 | } | 498 | } |
499 | 499 | ||
500 | static int snd_interval_refine_set(snd_interval_t *i, unsigned int val) | 500 | static int snd_interval_refine_set(struct snd_interval *i, unsigned int val) |
501 | { | 501 | { |
502 | snd_interval_t t; | 502 | struct snd_interval t; |
503 | t.empty = 0; | 503 | t.empty = 0; |
504 | t.min = t.max = val; | 504 | t.min = t.max = val; |
505 | t.openmin = t.openmax = 0; | 505 | t.openmin = t.openmax = 0; |
@@ -507,7 +507,7 @@ static int snd_interval_refine_set(snd_interval_t *i, unsigned int val) | |||
507 | return snd_interval_refine(i, &t); | 507 | return snd_interval_refine(i, &t); |
508 | } | 508 | } |
509 | 509 | ||
510 | void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c) | 510 | void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c) |
511 | { | 511 | { |
512 | if (a->empty || b->empty) { | 512 | if (a->empty || b->empty) { |
513 | snd_interval_none(c); | 513 | snd_interval_none(c); |
@@ -531,7 +531,7 @@ void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_inte | |||
531 | * | 531 | * |
532 | * Returns non-zero if the value is changed, zero if not changed. | 532 | * Returns non-zero if the value is changed, zero if not changed. |
533 | */ | 533 | */ |
534 | void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c) | 534 | void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c) |
535 | { | 535 | { |
536 | unsigned int r; | 536 | unsigned int r; |
537 | if (a->empty || b->empty) { | 537 | if (a->empty || b->empty) { |
@@ -566,8 +566,8 @@ void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_inte | |||
566 | * | 566 | * |
567 | * Returns non-zero if the value is changed, zero if not changed. | 567 | * Returns non-zero if the value is changed, zero if not changed. |
568 | */ | 568 | */ |
569 | void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, | 569 | void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, |
570 | unsigned int k, snd_interval_t *c) | 570 | unsigned int k, struct snd_interval *c) |
571 | { | 571 | { |
572 | unsigned int r; | 572 | unsigned int r; |
573 | if (a->empty || b->empty) { | 573 | if (a->empty || b->empty) { |
@@ -597,8 +597,8 @@ void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, | |||
597 | * | 597 | * |
598 | * Returns non-zero if the value is changed, zero if not changed. | 598 | * Returns non-zero if the value is changed, zero if not changed. |
599 | */ | 599 | */ |
600 | void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, | 600 | void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, |
601 | const snd_interval_t *b, snd_interval_t *c) | 601 | const struct snd_interval *b, struct snd_interval *c) |
602 | { | 602 | { |
603 | unsigned int r; | 603 | unsigned int r; |
604 | if (a->empty || b->empty) { | 604 | if (a->empty || b->empty) { |
@@ -636,13 +636,13 @@ void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, | |||
636 | * | 636 | * |
637 | * Returns non-zero if the value is changed, zero if not changed. | 637 | * Returns non-zero if the value is changed, zero if not changed. |
638 | */ | 638 | */ |
639 | int snd_interval_ratnum(snd_interval_t *i, | 639 | int snd_interval_ratnum(struct snd_interval *i, |
640 | unsigned int rats_count, ratnum_t *rats, | 640 | unsigned int rats_count, struct snd_ratnum *rats, |
641 | unsigned int *nump, unsigned int *denp) | 641 | unsigned int *nump, unsigned int *denp) |
642 | { | 642 | { |
643 | unsigned int best_num, best_diff, best_den; | 643 | unsigned int best_num, best_diff, best_den; |
644 | unsigned int k; | 644 | unsigned int k; |
645 | snd_interval_t t; | 645 | struct snd_interval t; |
646 | int err; | 646 | int err; |
647 | 647 | ||
648 | best_num = best_den = best_diff = 0; | 648 | best_num = best_den = best_diff = 0; |
@@ -731,20 +731,20 @@ int snd_interval_ratnum(snd_interval_t *i, | |||
731 | /** | 731 | /** |
732 | * snd_interval_ratden - refine the interval value | 732 | * snd_interval_ratden - refine the interval value |
733 | * @i: interval to refine | 733 | * @i: interval to refine |
734 | * @rats_count: number of ratden_t | 734 | * @rats_count: number of struct ratden |
735 | * @rats: ratden_t array | 735 | * @rats: struct ratden array |
736 | * @nump: pointer to store the resultant numerator | 736 | * @nump: pointer to store the resultant numerator |
737 | * @denp: pointer to store the resultant denominator | 737 | * @denp: pointer to store the resultant denominator |
738 | * | 738 | * |
739 | * Returns non-zero if the value is changed, zero if not changed. | 739 | * Returns non-zero if the value is changed, zero if not changed. |
740 | */ | 740 | */ |
741 | static int snd_interval_ratden(snd_interval_t *i, | 741 | static int snd_interval_ratden(struct snd_interval *i, |
742 | unsigned int rats_count, ratden_t *rats, | 742 | unsigned int rats_count, struct snd_ratden *rats, |
743 | unsigned int *nump, unsigned int *denp) | 743 | unsigned int *nump, unsigned int *denp) |
744 | { | 744 | { |
745 | unsigned int best_num, best_diff, best_den; | 745 | unsigned int best_num, best_diff, best_den; |
746 | unsigned int k; | 746 | unsigned int k; |
747 | snd_interval_t t; | 747 | struct snd_interval t; |
748 | int err; | 748 | int err; |
749 | 749 | ||
750 | best_num = best_den = best_diff = 0; | 750 | best_num = best_den = best_diff = 0; |
@@ -837,7 +837,7 @@ static int snd_interval_ratden(snd_interval_t *i, | |||
837 | * | 837 | * |
838 | * Returns non-zero if the value is changed, zero if not changed. | 838 | * Returns non-zero if the value is changed, zero if not changed. |
839 | */ | 839 | */ |
840 | int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask) | 840 | int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) |
841 | { | 841 | { |
842 | unsigned int k; | 842 | unsigned int k; |
843 | int changed = 0; | 843 | int changed = 0; |
@@ -878,7 +878,7 @@ int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, | |||
878 | return changed; | 878 | return changed; |
879 | } | 879 | } |
880 | 880 | ||
881 | static int snd_interval_step(snd_interval_t *i, unsigned int min, unsigned int step) | 881 | static int snd_interval_step(struct snd_interval *i, unsigned int min, unsigned int step) |
882 | { | 882 | { |
883 | unsigned int n; | 883 | unsigned int n; |
884 | int changed = 0; | 884 | int changed = 0; |
@@ -912,18 +912,18 @@ static int snd_interval_step(snd_interval_t *i, unsigned int min, unsigned int s | |||
912 | * | 912 | * |
913 | * Returns zero if successful, or a negative error code on failure. | 913 | * Returns zero if successful, or a negative error code on failure. |
914 | */ | 914 | */ |
915 | int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, unsigned int cond, | 915 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, |
916 | int var, | 916 | int var, |
917 | snd_pcm_hw_rule_func_t func, void *private, | 917 | snd_pcm_hw_rule_func_t func, void *private, |
918 | int dep, ...) | 918 | int dep, ...) |
919 | { | 919 | { |
920 | snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; | 920 | struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; |
921 | snd_pcm_hw_rule_t *c; | 921 | struct snd_pcm_hw_rule *c; |
922 | unsigned int k; | 922 | unsigned int k; |
923 | va_list args; | 923 | va_list args; |
924 | va_start(args, dep); | 924 | va_start(args, dep); |
925 | if (constrs->rules_num >= constrs->rules_all) { | 925 | if (constrs->rules_num >= constrs->rules_all) { |
926 | snd_pcm_hw_rule_t *new; | 926 | struct snd_pcm_hw_rule *new; |
927 | unsigned int new_rules = constrs->rules_all + 16; | 927 | unsigned int new_rules = constrs->rules_all + 16; |
928 | new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); | 928 | new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL); |
929 | if (!new) | 929 | if (!new) |
@@ -962,11 +962,11 @@ int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, unsigned int cond, | |||
962 | * | 962 | * |
963 | * Apply the constraint of the given bitmap mask to a mask parameter. | 963 | * Apply the constraint of the given bitmap mask to a mask parameter. |
964 | */ | 964 | */ |
965 | int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 965 | int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
966 | u_int32_t mask) | 966 | u_int32_t mask) |
967 | { | 967 | { |
968 | snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; | 968 | struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; |
969 | snd_mask_t *maskp = constrs_mask(constrs, var); | 969 | struct snd_mask *maskp = constrs_mask(constrs, var); |
970 | *maskp->bits &= mask; | 970 | *maskp->bits &= mask; |
971 | memset(maskp->bits + 1, 0, (SNDRV_MASK_MAX-32) / 8); /* clear rest */ | 971 | memset(maskp->bits + 1, 0, (SNDRV_MASK_MAX-32) / 8); /* clear rest */ |
972 | if (*maskp->bits == 0) | 972 | if (*maskp->bits == 0) |
@@ -982,11 +982,11 @@ int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t va | |||
982 | * | 982 | * |
983 | * Apply the constraint of the given bitmap mask to a mask parameter. | 983 | * Apply the constraint of the given bitmap mask to a mask parameter. |
984 | */ | 984 | */ |
985 | int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 985 | int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
986 | u_int64_t mask) | 986 | u_int64_t mask) |
987 | { | 987 | { |
988 | snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; | 988 | struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; |
989 | snd_mask_t *maskp = constrs_mask(constrs, var); | 989 | struct snd_mask *maskp = constrs_mask(constrs, var); |
990 | maskp->bits[0] &= (u_int32_t)mask; | 990 | maskp->bits[0] &= (u_int32_t)mask; |
991 | maskp->bits[1] &= (u_int32_t)(mask >> 32); | 991 | maskp->bits[1] &= (u_int32_t)(mask >> 32); |
992 | memset(maskp->bits + 2, 0, (SNDRV_MASK_MAX-64) / 8); /* clear rest */ | 992 | memset(maskp->bits + 2, 0, (SNDRV_MASK_MAX-64) / 8); /* clear rest */ |
@@ -1002,9 +1002,9 @@ int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t | |||
1002 | * | 1002 | * |
1003 | * Apply the constraint of integer to an interval parameter. | 1003 | * Apply the constraint of integer to an interval parameter. |
1004 | */ | 1004 | */ |
1005 | int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var) | 1005 | int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var) |
1006 | { | 1006 | { |
1007 | snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; | 1007 | struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; |
1008 | return snd_interval_setinteger(constrs_interval(constrs, var)); | 1008 | return snd_interval_setinteger(constrs_interval(constrs, var)); |
1009 | } | 1009 | } |
1010 | 1010 | ||
@@ -1017,11 +1017,11 @@ int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t | |||
1017 | * | 1017 | * |
1018 | * Apply the min/max range constraint to an interval parameter. | 1018 | * Apply the min/max range constraint to an interval parameter. |
1019 | */ | 1019 | */ |
1020 | int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 1020 | int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
1021 | unsigned int min, unsigned int max) | 1021 | unsigned int min, unsigned int max) |
1022 | { | 1022 | { |
1023 | snd_pcm_hw_constraints_t *constrs = &runtime->hw_constraints; | 1023 | struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; |
1024 | snd_interval_t t; | 1024 | struct snd_interval t; |
1025 | t.min = min; | 1025 | t.min = min; |
1026 | t.max = max; | 1026 | t.max = max; |
1027 | t.openmin = t.openmax = 0; | 1027 | t.openmin = t.openmax = 0; |
@@ -1029,10 +1029,10 @@ int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t | |||
1029 | return snd_interval_refine(constrs_interval(constrs, var), &t); | 1029 | return snd_interval_refine(constrs_interval(constrs, var), &t); |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static int snd_pcm_hw_rule_list(snd_pcm_hw_params_t *params, | 1032 | static int snd_pcm_hw_rule_list(struct snd_pcm_hw_params *params, |
1033 | snd_pcm_hw_rule_t *rule) | 1033 | struct snd_pcm_hw_rule *rule) |
1034 | { | 1034 | { |
1035 | snd_pcm_hw_constraint_list_t *list = rule->private; | 1035 | struct snd_pcm_hw_constraint_list *list = rule->private; |
1036 | return snd_interval_list(hw_param_interval(params, rule->var), list->count, list->list, list->mask); | 1036 | return snd_interval_list(hw_param_interval(params, rule->var), list->count, list->list, list->mask); |
1037 | } | 1037 | } |
1038 | 1038 | ||
@@ -1046,20 +1046,20 @@ static int snd_pcm_hw_rule_list(snd_pcm_hw_params_t *params, | |||
1046 | * | 1046 | * |
1047 | * Apply the list of constraints to an interval parameter. | 1047 | * Apply the list of constraints to an interval parameter. |
1048 | */ | 1048 | */ |
1049 | int snd_pcm_hw_constraint_list(snd_pcm_runtime_t *runtime, | 1049 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, |
1050 | unsigned int cond, | 1050 | unsigned int cond, |
1051 | snd_pcm_hw_param_t var, | 1051 | snd_pcm_hw_param_t var, |
1052 | snd_pcm_hw_constraint_list_t *l) | 1052 | struct snd_pcm_hw_constraint_list *l) |
1053 | { | 1053 | { |
1054 | return snd_pcm_hw_rule_add(runtime, cond, var, | 1054 | return snd_pcm_hw_rule_add(runtime, cond, var, |
1055 | snd_pcm_hw_rule_list, l, | 1055 | snd_pcm_hw_rule_list, l, |
1056 | var, -1); | 1056 | var, -1); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | static int snd_pcm_hw_rule_ratnums(snd_pcm_hw_params_t *params, | 1059 | static int snd_pcm_hw_rule_ratnums(struct snd_pcm_hw_params *params, |
1060 | snd_pcm_hw_rule_t *rule) | 1060 | struct snd_pcm_hw_rule *rule) |
1061 | { | 1061 | { |
1062 | snd_pcm_hw_constraint_ratnums_t *r = rule->private; | 1062 | struct snd_pcm_hw_constraint_ratnums *r = rule->private; |
1063 | unsigned int num = 0, den = 0; | 1063 | unsigned int num = 0, den = 0; |
1064 | int err; | 1064 | int err; |
1065 | err = snd_interval_ratnum(hw_param_interval(params, rule->var), | 1065 | err = snd_interval_ratnum(hw_param_interval(params, rule->var), |
@@ -1076,22 +1076,22 @@ static int snd_pcm_hw_rule_ratnums(snd_pcm_hw_params_t *params, | |||
1076 | * @runtime: PCM runtime instance | 1076 | * @runtime: PCM runtime instance |
1077 | * @cond: condition bits | 1077 | * @cond: condition bits |
1078 | * @var: hw_params variable to apply the ratnums constraint | 1078 | * @var: hw_params variable to apply the ratnums constraint |
1079 | * @r: ratnums_t constriants | 1079 | * @r: struct snd_ratnums constriants |
1080 | */ | 1080 | */ |
1081 | int snd_pcm_hw_constraint_ratnums(snd_pcm_runtime_t *runtime, | 1081 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, |
1082 | unsigned int cond, | 1082 | unsigned int cond, |
1083 | snd_pcm_hw_param_t var, | 1083 | snd_pcm_hw_param_t var, |
1084 | snd_pcm_hw_constraint_ratnums_t *r) | 1084 | struct snd_pcm_hw_constraint_ratnums *r) |
1085 | { | 1085 | { |
1086 | return snd_pcm_hw_rule_add(runtime, cond, var, | 1086 | return snd_pcm_hw_rule_add(runtime, cond, var, |
1087 | snd_pcm_hw_rule_ratnums, r, | 1087 | snd_pcm_hw_rule_ratnums, r, |
1088 | var, -1); | 1088 | var, -1); |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | static int snd_pcm_hw_rule_ratdens(snd_pcm_hw_params_t *params, | 1091 | static int snd_pcm_hw_rule_ratdens(struct snd_pcm_hw_params *params, |
1092 | snd_pcm_hw_rule_t *rule) | 1092 | struct snd_pcm_hw_rule *rule) |
1093 | { | 1093 | { |
1094 | snd_pcm_hw_constraint_ratdens_t *r = rule->private; | 1094 | struct snd_pcm_hw_constraint_ratdens *r = rule->private; |
1095 | unsigned int num = 0, den = 0; | 1095 | unsigned int num = 0, den = 0; |
1096 | int err = snd_interval_ratden(hw_param_interval(params, rule->var), | 1096 | int err = snd_interval_ratden(hw_param_interval(params, rule->var), |
1097 | r->nrats, r->rats, &num, &den); | 1097 | r->nrats, r->rats, &num, &den); |
@@ -1107,25 +1107,25 @@ static int snd_pcm_hw_rule_ratdens(snd_pcm_hw_params_t *params, | |||
1107 | * @runtime: PCM runtime instance | 1107 | * @runtime: PCM runtime instance |
1108 | * @cond: condition bits | 1108 | * @cond: condition bits |
1109 | * @var: hw_params variable to apply the ratdens constraint | 1109 | * @var: hw_params variable to apply the ratdens constraint |
1110 | * @r: ratdens_t constriants | 1110 | * @r: struct snd_ratdens constriants |
1111 | */ | 1111 | */ |
1112 | int snd_pcm_hw_constraint_ratdens(snd_pcm_runtime_t *runtime, | 1112 | int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, |
1113 | unsigned int cond, | 1113 | unsigned int cond, |
1114 | snd_pcm_hw_param_t var, | 1114 | snd_pcm_hw_param_t var, |
1115 | snd_pcm_hw_constraint_ratdens_t *r) | 1115 | struct snd_pcm_hw_constraint_ratdens *r) |
1116 | { | 1116 | { |
1117 | return snd_pcm_hw_rule_add(runtime, cond, var, | 1117 | return snd_pcm_hw_rule_add(runtime, cond, var, |
1118 | snd_pcm_hw_rule_ratdens, r, | 1118 | snd_pcm_hw_rule_ratdens, r, |
1119 | var, -1); | 1119 | var, -1); |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | static int snd_pcm_hw_rule_msbits(snd_pcm_hw_params_t *params, | 1122 | static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params, |
1123 | snd_pcm_hw_rule_t *rule) | 1123 | struct snd_pcm_hw_rule *rule) |
1124 | { | 1124 | { |
1125 | unsigned int l = (unsigned long) rule->private; | 1125 | unsigned int l = (unsigned long) rule->private; |
1126 | int width = l & 0xffff; | 1126 | int width = l & 0xffff; |
1127 | unsigned int msbits = l >> 16; | 1127 | unsigned int msbits = l >> 16; |
1128 | snd_interval_t *i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); | 1128 | struct snd_interval *i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); |
1129 | if (snd_interval_single(i) && snd_interval_value(i) == width) | 1129 | if (snd_interval_single(i) && snd_interval_value(i) == width) |
1130 | params->msbits = msbits; | 1130 | params->msbits = msbits; |
1131 | return 0; | 1131 | return 0; |
@@ -1138,7 +1138,7 @@ static int snd_pcm_hw_rule_msbits(snd_pcm_hw_params_t *params, | |||
1138 | * @width: sample bits width | 1138 | * @width: sample bits width |
1139 | * @msbits: msbits width | 1139 | * @msbits: msbits width |
1140 | */ | 1140 | */ |
1141 | int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime, | 1141 | int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, |
1142 | unsigned int cond, | 1142 | unsigned int cond, |
1143 | unsigned int width, | 1143 | unsigned int width, |
1144 | unsigned int msbits) | 1144 | unsigned int msbits) |
@@ -1150,8 +1150,8 @@ int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime, | |||
1150 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1); | 1150 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1); |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | static int snd_pcm_hw_rule_step(snd_pcm_hw_params_t *params, | 1153 | static int snd_pcm_hw_rule_step(struct snd_pcm_hw_params *params, |
1154 | snd_pcm_hw_rule_t *rule) | 1154 | struct snd_pcm_hw_rule *rule) |
1155 | { | 1155 | { |
1156 | unsigned long step = (unsigned long) rule->private; | 1156 | unsigned long step = (unsigned long) rule->private; |
1157 | return snd_interval_step(hw_param_interval(params, rule->var), 0, step); | 1157 | return snd_interval_step(hw_param_interval(params, rule->var), 0, step); |
@@ -1164,7 +1164,7 @@ static int snd_pcm_hw_rule_step(snd_pcm_hw_params_t *params, | |||
1164 | * @var: hw_params variable to apply the step constraint | 1164 | * @var: hw_params variable to apply the step constraint |
1165 | * @step: step size | 1165 | * @step: step size |
1166 | */ | 1166 | */ |
1167 | int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime, | 1167 | int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, |
1168 | unsigned int cond, | 1168 | unsigned int cond, |
1169 | snd_pcm_hw_param_t var, | 1169 | snd_pcm_hw_param_t var, |
1170 | unsigned long step) | 1170 | unsigned long step) |
@@ -1174,7 +1174,7 @@ int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime, | |||
1174 | var, -1); | 1174 | var, -1); |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | static int snd_pcm_hw_rule_pow2(snd_pcm_hw_params_t *params, snd_pcm_hw_rule_t *rule) | 1177 | static int snd_pcm_hw_rule_pow2(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule) |
1178 | { | 1178 | { |
1179 | static int pow2_sizes[] = { | 1179 | static int pow2_sizes[] = { |
1180 | 1<<0, 1<<1, 1<<2, 1<<3, 1<<4, 1<<5, 1<<6, 1<<7, | 1180 | 1<<0, 1<<1, 1<<2, 1<<3, 1<<4, 1<<5, 1<<6, 1<<7, |
@@ -1192,7 +1192,7 @@ static int snd_pcm_hw_rule_pow2(snd_pcm_hw_params_t *params, snd_pcm_hw_rule_t * | |||
1192 | * @cond: condition bits | 1192 | * @cond: condition bits |
1193 | * @var: hw_params variable to apply the power-of-2 constraint | 1193 | * @var: hw_params variable to apply the power-of-2 constraint |
1194 | */ | 1194 | */ |
1195 | int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime, | 1195 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, |
1196 | unsigned int cond, | 1196 | unsigned int cond, |
1197 | snd_pcm_hw_param_t var) | 1197 | snd_pcm_hw_param_t var) |
1198 | { | 1198 | { |
@@ -1202,13 +1202,12 @@ int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime, | |||
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | /* To use the same code we have in alsa-lib */ | 1204 | /* To use the same code we have in alsa-lib */ |
1205 | #define snd_pcm_t snd_pcm_substream_t | ||
1206 | #define assert(i) snd_assert((i), return -EINVAL) | 1205 | #define assert(i) snd_assert((i), return -EINVAL) |
1207 | #ifndef INT_MIN | 1206 | #ifndef INT_MIN |
1208 | #define INT_MIN ((int)((unsigned int)INT_MAX+1)) | 1207 | #define INT_MIN ((int)((unsigned int)INT_MAX+1)) |
1209 | #endif | 1208 | #endif |
1210 | 1209 | ||
1211 | static void _snd_pcm_hw_param_any(snd_pcm_hw_params_t *params, | 1210 | static void _snd_pcm_hw_param_any(struct snd_pcm_hw_params *params, |
1212 | snd_pcm_hw_param_t var) | 1211 | snd_pcm_hw_param_t var) |
1213 | { | 1212 | { |
1214 | if (hw_is_mask(var)) { | 1213 | if (hw_is_mask(var)) { |
@@ -1230,7 +1229,7 @@ static void _snd_pcm_hw_param_any(snd_pcm_hw_params_t *params, | |||
1230 | /* | 1229 | /* |
1231 | * snd_pcm_hw_param_any | 1230 | * snd_pcm_hw_param_any |
1232 | */ | 1231 | */ |
1233 | int snd_pcm_hw_param_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | 1232 | int snd_pcm_hw_param_any(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
1234 | snd_pcm_hw_param_t var) | 1233 | snd_pcm_hw_param_t var) |
1235 | { | 1234 | { |
1236 | _snd_pcm_hw_param_any(params, var); | 1235 | _snd_pcm_hw_param_any(params, var); |
@@ -1238,7 +1237,7 @@ int snd_pcm_hw_param_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | |||
1238 | } | 1237 | } |
1239 | #endif /* 0 */ | 1238 | #endif /* 0 */ |
1240 | 1239 | ||
1241 | void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params) | 1240 | void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params) |
1242 | { | 1241 | { |
1243 | unsigned int k; | 1242 | unsigned int k; |
1244 | memset(params, 0, sizeof(*params)); | 1243 | memset(params, 0, sizeof(*params)); |
@@ -1255,7 +1254,7 @@ void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params) | |||
1255 | * | 1254 | * |
1256 | * Fill PARAMS with full configuration space boundaries | 1255 | * Fill PARAMS with full configuration space boundaries |
1257 | */ | 1256 | */ |
1258 | int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) | 1257 | int snd_pcm_hw_params_any(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params) |
1259 | { | 1258 | { |
1260 | _snd_pcm_hw_params_any(params); | 1259 | _snd_pcm_hw_params_any(params); |
1261 | return snd_pcm_hw_refine(pcm, params); | 1260 | return snd_pcm_hw_refine(pcm, params); |
@@ -1271,11 +1270,11 @@ int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) | |||
1271 | * Return the value for field PAR if it's fixed in configuration space | 1270 | * Return the value for field PAR if it's fixed in configuration space |
1272 | * defined by PARAMS. Return -EINVAL otherwise | 1271 | * defined by PARAMS. Return -EINVAL otherwise |
1273 | */ | 1272 | */ |
1274 | static int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params, | 1273 | static int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params, |
1275 | snd_pcm_hw_param_t var, int *dir) | 1274 | snd_pcm_hw_param_t var, int *dir) |
1276 | { | 1275 | { |
1277 | if (hw_is_mask(var)) { | 1276 | if (hw_is_mask(var)) { |
1278 | const snd_mask_t *mask = hw_param_mask_c(params, var); | 1277 | const struct snd_mask *mask = hw_param_mask_c(params, var); |
1279 | if (!snd_mask_single(mask)) | 1278 | if (!snd_mask_single(mask)) |
1280 | return -EINVAL; | 1279 | return -EINVAL; |
1281 | if (dir) | 1280 | if (dir) |
@@ -1283,7 +1282,7 @@ static int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params, | |||
1283 | return snd_mask_value(mask); | 1282 | return snd_mask_value(mask); |
1284 | } | 1283 | } |
1285 | if (hw_is_interval(var)) { | 1284 | if (hw_is_interval(var)) { |
1286 | const snd_interval_t *i = hw_param_interval_c(params, var); | 1285 | const struct snd_interval *i = hw_param_interval_c(params, var); |
1287 | if (!snd_interval_single(i)) | 1286 | if (!snd_interval_single(i)) |
1288 | return -EINVAL; | 1287 | return -EINVAL; |
1289 | if (dir) | 1288 | if (dir) |
@@ -1302,7 +1301,7 @@ static int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params, | |||
1302 | * | 1301 | * |
1303 | * Return the minimum value for field PAR. | 1302 | * Return the minimum value for field PAR. |
1304 | */ | 1303 | */ |
1305 | unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params, | 1304 | unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params, |
1306 | snd_pcm_hw_param_t var, int *dir) | 1305 | snd_pcm_hw_param_t var, int *dir) |
1307 | { | 1306 | { |
1308 | if (hw_is_mask(var)) { | 1307 | if (hw_is_mask(var)) { |
@@ -1311,7 +1310,7 @@ unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params, | |||
1311 | return snd_mask_min(hw_param_mask_c(params, var)); | 1310 | return snd_mask_min(hw_param_mask_c(params, var)); |
1312 | } | 1311 | } |
1313 | if (hw_is_interval(var)) { | 1312 | if (hw_is_interval(var)) { |
1314 | const snd_interval_t *i = hw_param_interval_c(params, var); | 1313 | const struct snd_interval *i = hw_param_interval_c(params, var); |
1315 | if (dir) | 1314 | if (dir) |
1316 | *dir = i->openmin; | 1315 | *dir = i->openmin; |
1317 | return snd_interval_min(i); | 1316 | return snd_interval_min(i); |
@@ -1328,7 +1327,7 @@ unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params, | |||
1328 | * | 1327 | * |
1329 | * Return the maximum value for field PAR. | 1328 | * Return the maximum value for field PAR. |
1330 | */ | 1329 | */ |
1331 | unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params, | 1330 | unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params, |
1332 | snd_pcm_hw_param_t var, int *dir) | 1331 | snd_pcm_hw_param_t var, int *dir) |
1333 | { | 1332 | { |
1334 | if (hw_is_mask(var)) { | 1333 | if (hw_is_mask(var)) { |
@@ -1337,7 +1336,7 @@ unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params, | |||
1337 | return snd_mask_max(hw_param_mask_c(params, var)); | 1336 | return snd_mask_max(hw_param_mask_c(params, var)); |
1338 | } | 1337 | } |
1339 | if (hw_is_interval(var)) { | 1338 | if (hw_is_interval(var)) { |
1340 | const snd_interval_t *i = hw_param_interval_c(params, var); | 1339 | const struct snd_interval *i = hw_param_interval_c(params, var); |
1341 | if (dir) | 1340 | if (dir) |
1342 | *dir = - (int) i->openmax; | 1341 | *dir = - (int) i->openmax; |
1343 | return snd_interval_max(i); | 1342 | return snd_interval_max(i); |
@@ -1346,7 +1345,7 @@ unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params, | |||
1346 | return -EINVAL; | 1345 | return -EINVAL; |
1347 | } | 1346 | } |
1348 | 1347 | ||
1349 | void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, | 1348 | void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, |
1350 | snd_pcm_hw_param_t var) | 1349 | snd_pcm_hw_param_t var) |
1351 | { | 1350 | { |
1352 | if (hw_is_mask(var)) { | 1351 | if (hw_is_mask(var)) { |
@@ -1362,7 +1361,7 @@ void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, | |||
1362 | } | 1361 | } |
1363 | } | 1362 | } |
1364 | 1363 | ||
1365 | int _snd_pcm_hw_param_setinteger(snd_pcm_hw_params_t *params, | 1364 | int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params, |
1366 | snd_pcm_hw_param_t var) | 1365 | snd_pcm_hw_param_t var) |
1367 | { | 1366 | { |
1368 | int changed; | 1367 | int changed; |
@@ -1383,8 +1382,8 @@ int _snd_pcm_hw_param_setinteger(snd_pcm_hw_params_t *params, | |||
1383 | * non integer values. Reduce configuration space accordingly. | 1382 | * non integer values. Reduce configuration space accordingly. |
1384 | * Return -EINVAL if the configuration space is empty | 1383 | * Return -EINVAL if the configuration space is empty |
1385 | */ | 1384 | */ |
1386 | int snd_pcm_hw_param_setinteger(snd_pcm_t *pcm, | 1385 | int snd_pcm_hw_param_setinteger(struct snd_pcm_substream *pcm, |
1387 | snd_pcm_hw_params_t *params, | 1386 | struct snd_pcm_hw_params *params, |
1388 | snd_pcm_hw_param_t var) | 1387 | snd_pcm_hw_param_t var) |
1389 | { | 1388 | { |
1390 | int changed = _snd_pcm_hw_param_setinteger(params, var); | 1389 | int changed = _snd_pcm_hw_param_setinteger(params, var); |
@@ -1399,7 +1398,7 @@ int snd_pcm_hw_param_setinteger(snd_pcm_t *pcm, | |||
1399 | } | 1398 | } |
1400 | #endif /* 0 */ | 1399 | #endif /* 0 */ |
1401 | 1400 | ||
1402 | static int _snd_pcm_hw_param_first(snd_pcm_hw_params_t *params, | 1401 | static int _snd_pcm_hw_param_first(struct snd_pcm_hw_params *params, |
1403 | snd_pcm_hw_param_t var) | 1402 | snd_pcm_hw_param_t var) |
1404 | { | 1403 | { |
1405 | int changed; | 1404 | int changed; |
@@ -1430,8 +1429,8 @@ static int _snd_pcm_hw_param_first(snd_pcm_hw_params_t *params, | |||
1430 | * values > minimum. Reduce configuration space accordingly. | 1429 | * values > minimum. Reduce configuration space accordingly. |
1431 | * Return the minimum. | 1430 | * Return the minimum. |
1432 | */ | 1431 | */ |
1433 | static int snd_pcm_hw_param_first(snd_pcm_t *pcm, | 1432 | static int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, |
1434 | snd_pcm_hw_params_t *params, | 1433 | struct snd_pcm_hw_params *params, |
1435 | snd_pcm_hw_param_t var, int *dir) | 1434 | snd_pcm_hw_param_t var, int *dir) |
1436 | { | 1435 | { |
1437 | int changed = _snd_pcm_hw_param_first(params, var); | 1436 | int changed = _snd_pcm_hw_param_first(params, var); |
@@ -1444,7 +1443,7 @@ static int snd_pcm_hw_param_first(snd_pcm_t *pcm, | |||
1444 | return snd_pcm_hw_param_value(params, var, dir); | 1443 | return snd_pcm_hw_param_value(params, var, dir); |
1445 | } | 1444 | } |
1446 | 1445 | ||
1447 | static int _snd_pcm_hw_param_last(snd_pcm_hw_params_t *params, | 1446 | static int _snd_pcm_hw_param_last(struct snd_pcm_hw_params *params, |
1448 | snd_pcm_hw_param_t var) | 1447 | snd_pcm_hw_param_t var) |
1449 | { | 1448 | { |
1450 | int changed; | 1449 | int changed; |
@@ -1475,8 +1474,8 @@ static int _snd_pcm_hw_param_last(snd_pcm_hw_params_t *params, | |||
1475 | * values < maximum. Reduce configuration space accordingly. | 1474 | * values < maximum. Reduce configuration space accordingly. |
1476 | * Return the maximum. | 1475 | * Return the maximum. |
1477 | */ | 1476 | */ |
1478 | static int snd_pcm_hw_param_last(snd_pcm_t *pcm, | 1477 | static int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, |
1479 | snd_pcm_hw_params_t *params, | 1478 | struct snd_pcm_hw_params *params, |
1480 | snd_pcm_hw_param_t var, int *dir) | 1479 | snd_pcm_hw_param_t var, int *dir) |
1481 | { | 1480 | { |
1482 | int changed = _snd_pcm_hw_param_last(params, var); | 1481 | int changed = _snd_pcm_hw_param_last(params, var); |
@@ -1489,7 +1488,7 @@ static int snd_pcm_hw_param_last(snd_pcm_t *pcm, | |||
1489 | return snd_pcm_hw_param_value(params, var, dir); | 1488 | return snd_pcm_hw_param_value(params, var, dir); |
1490 | } | 1489 | } |
1491 | 1490 | ||
1492 | int _snd_pcm_hw_param_min(snd_pcm_hw_params_t *params, | 1491 | int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params, |
1493 | snd_pcm_hw_param_t var, unsigned int val, int dir) | 1492 | snd_pcm_hw_param_t var, unsigned int val, int dir) |
1494 | { | 1493 | { |
1495 | int changed; | 1494 | int changed; |
@@ -1531,7 +1530,7 @@ int _snd_pcm_hw_param_min(snd_pcm_hw_params_t *params, | |||
1531 | * values < VAL. Reduce configuration space accordingly. | 1530 | * values < VAL. Reduce configuration space accordingly. |
1532 | * Return new minimum or -EINVAL if the configuration space is empty | 1531 | * Return new minimum or -EINVAL if the configuration space is empty |
1533 | */ | 1532 | */ |
1534 | static int snd_pcm_hw_param_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | 1533 | static int snd_pcm_hw_param_min(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
1535 | snd_pcm_hw_param_t var, unsigned int val, | 1534 | snd_pcm_hw_param_t var, unsigned int val, |
1536 | int *dir) | 1535 | int *dir) |
1537 | { | 1536 | { |
@@ -1546,7 +1545,7 @@ static int snd_pcm_hw_param_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | |||
1546 | return snd_pcm_hw_param_value_min(params, var, dir); | 1545 | return snd_pcm_hw_param_value_min(params, var, dir); |
1547 | } | 1546 | } |
1548 | 1547 | ||
1549 | static int _snd_pcm_hw_param_max(snd_pcm_hw_params_t *params, | 1548 | static int _snd_pcm_hw_param_max(struct snd_pcm_hw_params *params, |
1550 | snd_pcm_hw_param_t var, unsigned int val, | 1549 | snd_pcm_hw_param_t var, unsigned int val, |
1551 | int dir) | 1550 | int dir) |
1552 | { | 1551 | { |
@@ -1591,7 +1590,7 @@ static int _snd_pcm_hw_param_max(snd_pcm_hw_params_t *params, | |||
1591 | * values >= VAL + 1. Reduce configuration space accordingly. | 1590 | * values >= VAL + 1. Reduce configuration space accordingly. |
1592 | * Return new maximum or -EINVAL if the configuration space is empty | 1591 | * Return new maximum or -EINVAL if the configuration space is empty |
1593 | */ | 1592 | */ |
1594 | static int snd_pcm_hw_param_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | 1593 | static int snd_pcm_hw_param_max(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
1595 | snd_pcm_hw_param_t var, unsigned int val, | 1594 | snd_pcm_hw_param_t var, unsigned int val, |
1596 | int *dir) | 1595 | int *dir) |
1597 | { | 1596 | { |
@@ -1606,12 +1605,12 @@ static int snd_pcm_hw_param_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | |||
1606 | return snd_pcm_hw_param_value_max(params, var, dir); | 1605 | return snd_pcm_hw_param_value_max(params, var, dir); |
1607 | } | 1606 | } |
1608 | 1607 | ||
1609 | int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, | 1608 | int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params, |
1610 | snd_pcm_hw_param_t var, unsigned int val, int dir) | 1609 | snd_pcm_hw_param_t var, unsigned int val, int dir) |
1611 | { | 1610 | { |
1612 | int changed; | 1611 | int changed; |
1613 | if (hw_is_mask(var)) { | 1612 | if (hw_is_mask(var)) { |
1614 | snd_mask_t *m = hw_param_mask(params, var); | 1613 | struct snd_mask *m = hw_param_mask(params, var); |
1615 | if (val == 0 && dir < 0) { | 1614 | if (val == 0 && dir < 0) { |
1616 | changed = -EINVAL; | 1615 | changed = -EINVAL; |
1617 | snd_mask_none(m); | 1616 | snd_mask_none(m); |
@@ -1623,14 +1622,14 @@ int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, | |||
1623 | changed = snd_mask_refine_set(hw_param_mask(params, var), val); | 1622 | changed = snd_mask_refine_set(hw_param_mask(params, var), val); |
1624 | } | 1623 | } |
1625 | } else if (hw_is_interval(var)) { | 1624 | } else if (hw_is_interval(var)) { |
1626 | snd_interval_t *i = hw_param_interval(params, var); | 1625 | struct snd_interval *i = hw_param_interval(params, var); |
1627 | if (val == 0 && dir < 0) { | 1626 | if (val == 0 && dir < 0) { |
1628 | changed = -EINVAL; | 1627 | changed = -EINVAL; |
1629 | snd_interval_none(i); | 1628 | snd_interval_none(i); |
1630 | } else if (dir == 0) | 1629 | } else if (dir == 0) |
1631 | changed = snd_interval_refine_set(i, val); | 1630 | changed = snd_interval_refine_set(i, val); |
1632 | else { | 1631 | else { |
1633 | snd_interval_t t; | 1632 | struct snd_interval t; |
1634 | t.openmin = 1; | 1633 | t.openmin = 1; |
1635 | t.openmax = 1; | 1634 | t.openmax = 1; |
1636 | t.empty = 0; | 1635 | t.empty = 0; |
@@ -1667,7 +1666,7 @@ int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, | |||
1667 | * values != VAL. Reduce configuration space accordingly. | 1666 | * values != VAL. Reduce configuration space accordingly. |
1668 | * Return VAL or -EINVAL if the configuration space is empty | 1667 | * Return VAL or -EINVAL if the configuration space is empty |
1669 | */ | 1668 | */ |
1670 | int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | 1669 | int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
1671 | snd_pcm_hw_param_t var, unsigned int val, int dir) | 1670 | snd_pcm_hw_param_t var, unsigned int val, int dir) |
1672 | { | 1671 | { |
1673 | int changed = _snd_pcm_hw_param_set(params, var, val, dir); | 1672 | int changed = _snd_pcm_hw_param_set(params, var, val, dir); |
@@ -1681,8 +1680,8 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | |||
1681 | return snd_pcm_hw_param_value(params, var, NULL); | 1680 | return snd_pcm_hw_param_value(params, var, NULL); |
1682 | } | 1681 | } |
1683 | 1682 | ||
1684 | static int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params, | 1683 | static int _snd_pcm_hw_param_mask(struct snd_pcm_hw_params *params, |
1685 | snd_pcm_hw_param_t var, const snd_mask_t *val) | 1684 | snd_pcm_hw_param_t var, const struct snd_mask *val) |
1686 | { | 1685 | { |
1687 | int changed; | 1686 | int changed; |
1688 | assert(hw_is_mask(var)); | 1687 | assert(hw_is_mask(var)); |
@@ -1708,8 +1707,8 @@ static int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params, | |||
1708 | * Return 0 on success or -EINVAL | 1707 | * Return 0 on success or -EINVAL |
1709 | * if the configuration space is empty | 1708 | * if the configuration space is empty |
1710 | */ | 1709 | */ |
1711 | int snd_pcm_hw_param_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | 1710 | int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
1712 | snd_pcm_hw_param_t var, const snd_mask_t *val) | 1711 | snd_pcm_hw_param_t var, const struct snd_mask *val) |
1713 | { | 1712 | { |
1714 | int changed = _snd_pcm_hw_param_mask(params, var, val); | 1713 | int changed = _snd_pcm_hw_param_mask(params, var, val); |
1715 | if (changed < 0) | 1714 | if (changed < 0) |
@@ -1784,10 +1783,10 @@ static int boundary_nearer(int min, int mindir, | |||
1784 | * SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_SUBFORMAT. | 1783 | * SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_SUBFORMAT. |
1785 | * Return the value found. | 1784 | * Return the value found. |
1786 | */ | 1785 | */ |
1787 | int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | 1786 | int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
1788 | snd_pcm_hw_param_t var, unsigned int best, int *dir) | 1787 | snd_pcm_hw_param_t var, unsigned int best, int *dir) |
1789 | { | 1788 | { |
1790 | snd_pcm_hw_params_t *save = NULL; | 1789 | struct snd_pcm_hw_params *save = NULL; |
1791 | int v; | 1790 | int v; |
1792 | unsigned int saved_min; | 1791 | unsigned int saved_min; |
1793 | int last = 0; | 1792 | int last = 0; |
@@ -1814,7 +1813,7 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | |||
1814 | saved_min = min; | 1813 | saved_min = min; |
1815 | min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir); | 1814 | min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir); |
1816 | if (min >= 0) { | 1815 | if (min >= 0) { |
1817 | snd_pcm_hw_params_t *params1; | 1816 | struct snd_pcm_hw_params *params1; |
1818 | if (max < 0) | 1817 | if (max < 0) |
1819 | goto _end; | 1818 | goto _end; |
1820 | if ((unsigned int)min == saved_min && mindir == valdir) | 1819 | if ((unsigned int)min == saved_min && mindir == valdir) |
@@ -1861,7 +1860,7 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, | |||
1861 | * first access, first format, first subformat, min channels, | 1860 | * first access, first format, first subformat, min channels, |
1862 | * min rate, min period time, max buffer size, min tick time | 1861 | * min rate, min period time, max buffer size, min tick time |
1863 | */ | 1862 | */ |
1864 | int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) | 1863 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params) |
1865 | { | 1864 | { |
1866 | int err; | 1865 | int err; |
1867 | 1866 | ||
@@ -1892,13 +1891,12 @@ int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) | |||
1892 | return 0; | 1891 | return 0; |
1893 | } | 1892 | } |
1894 | 1893 | ||
1895 | #undef snd_pcm_t | ||
1896 | #undef assert | 1894 | #undef assert |
1897 | 1895 | ||
1898 | static int snd_pcm_lib_ioctl_reset(snd_pcm_substream_t *substream, | 1896 | static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream, |
1899 | void *arg) | 1897 | void *arg) |
1900 | { | 1898 | { |
1901 | snd_pcm_runtime_t *runtime = substream->runtime; | 1899 | struct snd_pcm_runtime *runtime = substream->runtime; |
1902 | unsigned long flags; | 1900 | unsigned long flags; |
1903 | snd_pcm_stream_lock_irqsave(substream, flags); | 1901 | snd_pcm_stream_lock_irqsave(substream, flags); |
1904 | if (snd_pcm_running(substream) && | 1902 | if (snd_pcm_running(substream) && |
@@ -1910,11 +1908,11 @@ static int snd_pcm_lib_ioctl_reset(snd_pcm_substream_t *substream, | |||
1910 | return 0; | 1908 | return 0; |
1911 | } | 1909 | } |
1912 | 1910 | ||
1913 | static int snd_pcm_lib_ioctl_channel_info(snd_pcm_substream_t *substream, | 1911 | static int snd_pcm_lib_ioctl_channel_info(struct snd_pcm_substream *substream, |
1914 | void *arg) | 1912 | void *arg) |
1915 | { | 1913 | { |
1916 | snd_pcm_channel_info_t *info = arg; | 1914 | struct snd_pcm_channel_info *info = arg; |
1917 | snd_pcm_runtime_t *runtime = substream->runtime; | 1915 | struct snd_pcm_runtime *runtime = substream->runtime; |
1918 | int width; | 1916 | int width; |
1919 | if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) { | 1917 | if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) { |
1920 | info->offset = -1; | 1918 | info->offset = -1; |
@@ -1956,7 +1954,7 @@ static int snd_pcm_lib_ioctl_channel_info(snd_pcm_substream_t *substream, | |||
1956 | * | 1954 | * |
1957 | * Returns zero if successful, or a negative error code on failure. | 1955 | * Returns zero if successful, or a negative error code on failure. |
1958 | */ | 1956 | */ |
1959 | int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, | 1957 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, |
1960 | unsigned int cmd, void *arg) | 1958 | unsigned int cmd, void *arg) |
1961 | { | 1959 | { |
1962 | switch (cmd) { | 1960 | switch (cmd) { |
@@ -1974,10 +1972,10 @@ int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, | |||
1974 | * Conditions | 1972 | * Conditions |
1975 | */ | 1973 | */ |
1976 | 1974 | ||
1977 | static void snd_pcm_system_tick_set(snd_pcm_substream_t *substream, | 1975 | static void snd_pcm_system_tick_set(struct snd_pcm_substream *substream, |
1978 | unsigned long ticks) | 1976 | unsigned long ticks) |
1979 | { | 1977 | { |
1980 | snd_pcm_runtime_t *runtime = substream->runtime; | 1978 | struct snd_pcm_runtime *runtime = substream->runtime; |
1981 | if (ticks == 0) | 1979 | if (ticks == 0) |
1982 | del_timer(&runtime->tick_timer); | 1980 | del_timer(&runtime->tick_timer); |
1983 | else { | 1981 | else { |
@@ -1988,14 +1986,14 @@ static void snd_pcm_system_tick_set(snd_pcm_substream_t *substream, | |||
1988 | } | 1986 | } |
1989 | 1987 | ||
1990 | /* Temporary alias */ | 1988 | /* Temporary alias */ |
1991 | void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks) | 1989 | void snd_pcm_tick_set(struct snd_pcm_substream *substream, unsigned long ticks) |
1992 | { | 1990 | { |
1993 | snd_pcm_system_tick_set(substream, ticks); | 1991 | snd_pcm_system_tick_set(substream, ticks); |
1994 | } | 1992 | } |
1995 | 1993 | ||
1996 | void snd_pcm_tick_prepare(snd_pcm_substream_t *substream) | 1994 | void snd_pcm_tick_prepare(struct snd_pcm_substream *substream) |
1997 | { | 1995 | { |
1998 | snd_pcm_runtime_t *runtime = substream->runtime; | 1996 | struct snd_pcm_runtime *runtime = substream->runtime; |
1999 | snd_pcm_uframes_t frames = ULONG_MAX; | 1997 | snd_pcm_uframes_t frames = ULONG_MAX; |
2000 | snd_pcm_uframes_t avail, dist; | 1998 | snd_pcm_uframes_t avail, dist; |
2001 | unsigned int ticks; | 1999 | unsigned int ticks; |
@@ -2046,9 +2044,9 @@ void snd_pcm_tick_prepare(snd_pcm_substream_t *substream) | |||
2046 | snd_pcm_tick_set(substream, (unsigned long) ticks); | 2044 | snd_pcm_tick_set(substream, (unsigned long) ticks); |
2047 | } | 2045 | } |
2048 | 2046 | ||
2049 | void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream) | 2047 | void snd_pcm_tick_elapsed(struct snd_pcm_substream *substream) |
2050 | { | 2048 | { |
2051 | snd_pcm_runtime_t *runtime; | 2049 | struct snd_pcm_runtime *runtime; |
2052 | unsigned long flags; | 2050 | unsigned long flags; |
2053 | 2051 | ||
2054 | snd_assert(substream != NULL, return); | 2052 | snd_assert(substream != NULL, return); |
@@ -2076,9 +2074,9 @@ void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream) | |||
2076 | * Even if more than one periods have elapsed since the last call, you | 2074 | * Even if more than one periods have elapsed since the last call, you |
2077 | * have to call this only once. | 2075 | * have to call this only once. |
2078 | */ | 2076 | */ |
2079 | void snd_pcm_period_elapsed(snd_pcm_substream_t *substream) | 2077 | void snd_pcm_period_elapsed(struct snd_pcm_substream *substream) |
2080 | { | 2078 | { |
2081 | snd_pcm_runtime_t *runtime; | 2079 | struct snd_pcm_runtime *runtime; |
2082 | unsigned long flags; | 2080 | unsigned long flags; |
2083 | 2081 | ||
2084 | snd_assert(substream != NULL, return); | 2082 | snd_assert(substream != NULL, return); |
@@ -2104,12 +2102,12 @@ void snd_pcm_period_elapsed(snd_pcm_substream_t *substream) | |||
2104 | kill_fasync(&runtime->fasync, SIGIO, POLL_IN); | 2102 | kill_fasync(&runtime->fasync, SIGIO, POLL_IN); |
2105 | } | 2103 | } |
2106 | 2104 | ||
2107 | static int snd_pcm_lib_write_transfer(snd_pcm_substream_t *substream, | 2105 | static int snd_pcm_lib_write_transfer(struct snd_pcm_substream *substream, |
2108 | unsigned int hwoff, | 2106 | unsigned int hwoff, |
2109 | unsigned long data, unsigned int off, | 2107 | unsigned long data, unsigned int off, |
2110 | snd_pcm_uframes_t frames) | 2108 | snd_pcm_uframes_t frames) |
2111 | { | 2109 | { |
2112 | snd_pcm_runtime_t *runtime = substream->runtime; | 2110 | struct snd_pcm_runtime *runtime = substream->runtime; |
2113 | int err; | 2111 | int err; |
2114 | char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); | 2112 | char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); |
2115 | if (substream->ops->copy) { | 2113 | if (substream->ops->copy) { |
@@ -2124,17 +2122,17 @@ static int snd_pcm_lib_write_transfer(snd_pcm_substream_t *substream, | |||
2124 | return 0; | 2122 | return 0; |
2125 | } | 2123 | } |
2126 | 2124 | ||
2127 | typedef int (*transfer_f)(snd_pcm_substream_t *substream, unsigned int hwoff, | 2125 | typedef int (*transfer_f)(struct snd_pcm_substream *substream, unsigned int hwoff, |
2128 | unsigned long data, unsigned int off, | 2126 | unsigned long data, unsigned int off, |
2129 | snd_pcm_uframes_t size); | 2127 | snd_pcm_uframes_t size); |
2130 | 2128 | ||
2131 | static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, | 2129 | static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream, |
2132 | unsigned long data, | 2130 | unsigned long data, |
2133 | snd_pcm_uframes_t size, | 2131 | snd_pcm_uframes_t size, |
2134 | int nonblock, | 2132 | int nonblock, |
2135 | transfer_f transfer) | 2133 | transfer_f transfer) |
2136 | { | 2134 | { |
2137 | snd_pcm_runtime_t *runtime = substream->runtime; | 2135 | struct snd_pcm_runtime *runtime = substream->runtime; |
2138 | snd_pcm_uframes_t xfer = 0; | 2136 | snd_pcm_uframes_t xfer = 0; |
2139 | snd_pcm_uframes_t offset = 0; | 2137 | snd_pcm_uframes_t offset = 0; |
2140 | int err = 0; | 2138 | int err = 0; |
@@ -2290,9 +2288,9 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, | |||
2290 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : err; | 2288 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : err; |
2291 | } | 2289 | } |
2292 | 2290 | ||
2293 | snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void __user *buf, snd_pcm_uframes_t size) | 2291 | snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, const void __user *buf, snd_pcm_uframes_t size) |
2294 | { | 2292 | { |
2295 | snd_pcm_runtime_t *runtime; | 2293 | struct snd_pcm_runtime *runtime; |
2296 | int nonblock; | 2294 | int nonblock; |
2297 | 2295 | ||
2298 | snd_assert(substream != NULL, return -ENXIO); | 2296 | snd_assert(substream != NULL, return -ENXIO); |
@@ -2306,7 +2304,7 @@ snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void _ | |||
2306 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); | 2304 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); |
2307 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 2305 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
2308 | if (substream->oss.oss) { | 2306 | if (substream->oss.oss) { |
2309 | snd_pcm_oss_setup_t *setup = substream->oss.setup; | 2307 | struct snd_pcm_oss_setup *setup = substream->oss.setup; |
2310 | if (setup != NULL) { | 2308 | if (setup != NULL) { |
2311 | if (setup->nonblock) | 2309 | if (setup->nonblock) |
2312 | nonblock = 1; | 2310 | nonblock = 1; |
@@ -2323,12 +2321,12 @@ snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void _ | |||
2323 | snd_pcm_lib_write_transfer); | 2321 | snd_pcm_lib_write_transfer); |
2324 | } | 2322 | } |
2325 | 2323 | ||
2326 | static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream, | 2324 | static int snd_pcm_lib_writev_transfer(struct snd_pcm_substream *substream, |
2327 | unsigned int hwoff, | 2325 | unsigned int hwoff, |
2328 | unsigned long data, unsigned int off, | 2326 | unsigned long data, unsigned int off, |
2329 | snd_pcm_uframes_t frames) | 2327 | snd_pcm_uframes_t frames) |
2330 | { | 2328 | { |
2331 | snd_pcm_runtime_t *runtime = substream->runtime; | 2329 | struct snd_pcm_runtime *runtime = substream->runtime; |
2332 | int err; | 2330 | int err; |
2333 | void __user **bufs = (void __user **)data; | 2331 | void __user **bufs = (void __user **)data; |
2334 | int channels = runtime->channels; | 2332 | int channels = runtime->channels; |
@@ -2363,11 +2361,11 @@ static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream, | |||
2363 | return 0; | 2361 | return 0; |
2364 | } | 2362 | } |
2365 | 2363 | ||
2366 | snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, | 2364 | snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream, |
2367 | void __user **bufs, | 2365 | void __user **bufs, |
2368 | snd_pcm_uframes_t frames) | 2366 | snd_pcm_uframes_t frames) |
2369 | { | 2367 | { |
2370 | snd_pcm_runtime_t *runtime; | 2368 | struct snd_pcm_runtime *runtime; |
2371 | int nonblock; | 2369 | int nonblock; |
2372 | 2370 | ||
2373 | snd_assert(substream != NULL, return -ENXIO); | 2371 | snd_assert(substream != NULL, return -ENXIO); |
@@ -2381,7 +2379,7 @@ snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, | |||
2381 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); | 2379 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); |
2382 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 2380 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
2383 | if (substream->oss.oss) { | 2381 | if (substream->oss.oss) { |
2384 | snd_pcm_oss_setup_t *setup = substream->oss.setup; | 2382 | struct snd_pcm_oss_setup *setup = substream->oss.setup; |
2385 | if (setup != NULL) { | 2383 | if (setup != NULL) { |
2386 | if (setup->nonblock) | 2384 | if (setup->nonblock) |
2387 | nonblock = 1; | 2385 | nonblock = 1; |
@@ -2397,12 +2395,12 @@ snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, | |||
2397 | nonblock, snd_pcm_lib_writev_transfer); | 2395 | nonblock, snd_pcm_lib_writev_transfer); |
2398 | } | 2396 | } |
2399 | 2397 | ||
2400 | static int snd_pcm_lib_read_transfer(snd_pcm_substream_t *substream, | 2398 | static int snd_pcm_lib_read_transfer(struct snd_pcm_substream *substream, |
2401 | unsigned int hwoff, | 2399 | unsigned int hwoff, |
2402 | unsigned long data, unsigned int off, | 2400 | unsigned long data, unsigned int off, |
2403 | snd_pcm_uframes_t frames) | 2401 | snd_pcm_uframes_t frames) |
2404 | { | 2402 | { |
2405 | snd_pcm_runtime_t *runtime = substream->runtime; | 2403 | struct snd_pcm_runtime *runtime = substream->runtime; |
2406 | int err; | 2404 | int err; |
2407 | char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); | 2405 | char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); |
2408 | if (substream->ops->copy) { | 2406 | if (substream->ops->copy) { |
@@ -2417,13 +2415,13 @@ static int snd_pcm_lib_read_transfer(snd_pcm_substream_t *substream, | |||
2417 | return 0; | 2415 | return 0; |
2418 | } | 2416 | } |
2419 | 2417 | ||
2420 | static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, | 2418 | static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream, |
2421 | unsigned long data, | 2419 | unsigned long data, |
2422 | snd_pcm_uframes_t size, | 2420 | snd_pcm_uframes_t size, |
2423 | int nonblock, | 2421 | int nonblock, |
2424 | transfer_f transfer) | 2422 | transfer_f transfer) |
2425 | { | 2423 | { |
2426 | snd_pcm_runtime_t *runtime = substream->runtime; | 2424 | struct snd_pcm_runtime *runtime = substream->runtime; |
2427 | snd_pcm_uframes_t xfer = 0; | 2425 | snd_pcm_uframes_t xfer = 0; |
2428 | snd_pcm_uframes_t offset = 0; | 2426 | snd_pcm_uframes_t offset = 0; |
2429 | int err = 0; | 2427 | int err = 0; |
@@ -2587,9 +2585,9 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, | |||
2587 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : err; | 2585 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : err; |
2588 | } | 2586 | } |
2589 | 2587 | ||
2590 | snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void __user *buf, snd_pcm_uframes_t size) | 2588 | snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream, void __user *buf, snd_pcm_uframes_t size) |
2591 | { | 2589 | { |
2592 | snd_pcm_runtime_t *runtime; | 2590 | struct snd_pcm_runtime *runtime; |
2593 | int nonblock; | 2591 | int nonblock; |
2594 | 2592 | ||
2595 | snd_assert(substream != NULL, return -ENXIO); | 2593 | snd_assert(substream != NULL, return -ENXIO); |
@@ -2603,7 +2601,7 @@ snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void __user * | |||
2603 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); | 2601 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); |
2604 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 2602 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
2605 | if (substream->oss.oss) { | 2603 | if (substream->oss.oss) { |
2606 | snd_pcm_oss_setup_t *setup = substream->oss.setup; | 2604 | struct snd_pcm_oss_setup *setup = substream->oss.setup; |
2607 | if (setup != NULL) { | 2605 | if (setup != NULL) { |
2608 | if (setup->nonblock) | 2606 | if (setup->nonblock) |
2609 | nonblock = 1; | 2607 | nonblock = 1; |
@@ -2617,12 +2615,12 @@ snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void __user * | |||
2617 | return snd_pcm_lib_read1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_read_transfer); | 2615 | return snd_pcm_lib_read1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_read_transfer); |
2618 | } | 2616 | } |
2619 | 2617 | ||
2620 | static int snd_pcm_lib_readv_transfer(snd_pcm_substream_t *substream, | 2618 | static int snd_pcm_lib_readv_transfer(struct snd_pcm_substream *substream, |
2621 | unsigned int hwoff, | 2619 | unsigned int hwoff, |
2622 | unsigned long data, unsigned int off, | 2620 | unsigned long data, unsigned int off, |
2623 | snd_pcm_uframes_t frames) | 2621 | snd_pcm_uframes_t frames) |
2624 | { | 2622 | { |
2625 | snd_pcm_runtime_t *runtime = substream->runtime; | 2623 | struct snd_pcm_runtime *runtime = substream->runtime; |
2626 | int err; | 2624 | int err; |
2627 | void __user **bufs = (void __user **)data; | 2625 | void __user **bufs = (void __user **)data; |
2628 | int channels = runtime->channels; | 2626 | int channels = runtime->channels; |
@@ -2654,11 +2652,11 @@ static int snd_pcm_lib_readv_transfer(snd_pcm_substream_t *substream, | |||
2654 | return 0; | 2652 | return 0; |
2655 | } | 2653 | } |
2656 | 2654 | ||
2657 | snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, | 2655 | snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, |
2658 | void __user **bufs, | 2656 | void __user **bufs, |
2659 | snd_pcm_uframes_t frames) | 2657 | snd_pcm_uframes_t frames) |
2660 | { | 2658 | { |
2661 | snd_pcm_runtime_t *runtime; | 2659 | struct snd_pcm_runtime *runtime; |
2662 | int nonblock; | 2660 | int nonblock; |
2663 | 2661 | ||
2664 | snd_assert(substream != NULL, return -ENXIO); | 2662 | snd_assert(substream != NULL, return -ENXIO); |
@@ -2672,7 +2670,7 @@ snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, | |||
2672 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); | 2670 | nonblock = !!(substream->ffile->f_flags & O_NONBLOCK); |
2673 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 2671 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
2674 | if (substream->oss.oss) { | 2672 | if (substream->oss.oss) { |
2675 | snd_pcm_oss_setup_t *setup = substream->oss.setup; | 2673 | struct snd_pcm_oss_setup *setup = substream->oss.setup; |
2676 | if (setup != NULL) { | 2674 | if (setup != NULL) { |
2677 | if (setup->nonblock) | 2675 | if (setup->nonblock) |
2678 | nonblock = 1; | 2676 | nonblock = 1; |