diff options
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/usbaudio.c | 374 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 16 | ||||
-rw-r--r-- | sound/usb/usbmidi.c | 211 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 183 | ||||
-rw-r--r-- | sound/usb/usbquirks.h | 310 | ||||
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 65 | ||||
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.h | 2 | ||||
-rw-r--r-- | sound/usb/usx2y/usbus428ctldefs.h | 36 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 49 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.h | 45 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 383 | ||||
-rw-r--r-- | sound/usb/usx2y/usx2yhwdeppcm.c | 206 | ||||
-rw-r--r-- | sound/usb/usx2y/usx2yhwdeppcm.h | 1 |
13 files changed, 954 insertions, 927 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 22f8bb612bff..a1bd8040dea4 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -102,10 +102,6 @@ MODULE_PARM_DESC(async_unlink, "Use async unlink mode."); | |||
102 | #define SYNC_URBS 4 /* always four urbs for sync */ | 102 | #define SYNC_URBS 4 /* always four urbs for sync */ |
103 | #define MIN_PACKS_URB 1 /* minimum 1 packet per urb */ | 103 | #define MIN_PACKS_URB 1 /* minimum 1 packet per urb */ |
104 | 104 | ||
105 | typedef struct snd_usb_substream snd_usb_substream_t; | ||
106 | typedef struct snd_usb_stream snd_usb_stream_t; | ||
107 | typedef struct snd_urb_ctx snd_urb_ctx_t; | ||
108 | |||
109 | struct audioformat { | 105 | struct audioformat { |
110 | struct list_head list; | 106 | struct list_head list; |
111 | snd_pcm_format_t format; /* format type */ | 107 | snd_pcm_format_t format; /* format type */ |
@@ -125,25 +121,27 @@ struct audioformat { | |||
125 | unsigned int *rate_table; /* rate table */ | 121 | unsigned int *rate_table; /* rate table */ |
126 | }; | 122 | }; |
127 | 123 | ||
124 | struct snd_usb_substream; | ||
125 | |||
128 | struct snd_urb_ctx { | 126 | struct snd_urb_ctx { |
129 | struct urb *urb; | 127 | struct urb *urb; |
130 | unsigned int buffer_size; /* size of data buffer, if data URB */ | 128 | unsigned int buffer_size; /* size of data buffer, if data URB */ |
131 | snd_usb_substream_t *subs; | 129 | struct snd_usb_substream *subs; |
132 | int index; /* index for urb array */ | 130 | int index; /* index for urb array */ |
133 | int packets; /* number of packets per urb */ | 131 | int packets; /* number of packets per urb */ |
134 | }; | 132 | }; |
135 | 133 | ||
136 | struct snd_urb_ops { | 134 | struct snd_urb_ops { |
137 | int (*prepare)(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime, struct urb *u); | 135 | int (*prepare)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u); |
138 | int (*retire)(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime, struct urb *u); | 136 | int (*retire)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u); |
139 | int (*prepare_sync)(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime, struct urb *u); | 137 | int (*prepare_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u); |
140 | int (*retire_sync)(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime, struct urb *u); | 138 | int (*retire_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u); |
141 | }; | 139 | }; |
142 | 140 | ||
143 | struct snd_usb_substream { | 141 | struct snd_usb_substream { |
144 | snd_usb_stream_t *stream; | 142 | struct snd_usb_stream *stream; |
145 | struct usb_device *dev; | 143 | struct usb_device *dev; |
146 | snd_pcm_substream_t *pcm_substream; | 144 | struct snd_pcm_substream *pcm_substream; |
147 | int direction; /* playback or capture */ | 145 | int direction; /* playback or capture */ |
148 | int interface; /* current interface */ | 146 | int interface; /* current interface */ |
149 | int endpoint; /* assigned endpoint */ | 147 | int endpoint; /* assigned endpoint */ |
@@ -175,8 +173,8 @@ struct snd_usb_substream { | |||
175 | unsigned long unlink_mask; /* bitmask of unlinked urbs */ | 173 | unsigned long unlink_mask; /* bitmask of unlinked urbs */ |
176 | 174 | ||
177 | unsigned int nurbs; /* # urbs */ | 175 | unsigned int nurbs; /* # urbs */ |
178 | snd_urb_ctx_t dataurb[MAX_URBS]; /* data urb table */ | 176 | struct snd_urb_ctx dataurb[MAX_URBS]; /* data urb table */ |
179 | snd_urb_ctx_t syncurb[SYNC_URBS]; /* sync urb table */ | 177 | struct snd_urb_ctx syncurb[SYNC_URBS]; /* sync urb table */ |
180 | char *syncbuf; /* sync buffer for all sync URBs */ | 178 | char *syncbuf; /* sync buffer for all sync URBs */ |
181 | dma_addr_t sync_dma; /* DMA address of syncbuf */ | 179 | dma_addr_t sync_dma; /* DMA address of syncbuf */ |
182 | 180 | ||
@@ -190,11 +188,11 @@ struct snd_usb_substream { | |||
190 | 188 | ||
191 | 189 | ||
192 | struct snd_usb_stream { | 190 | struct snd_usb_stream { |
193 | snd_usb_audio_t *chip; | 191 | struct snd_usb_audio *chip; |
194 | snd_pcm_t *pcm; | 192 | struct snd_pcm *pcm; |
195 | int pcm_index; | 193 | int pcm_index; |
196 | unsigned int fmt_type; /* USB audio format type (1-3) */ | 194 | unsigned int fmt_type; /* USB audio format type (1-3) */ |
197 | snd_usb_substream_t substream[2]; | 195 | struct snd_usb_substream substream[2]; |
198 | struct list_head list; | 196 | struct list_head list; |
199 | }; | 197 | }; |
200 | 198 | ||
@@ -205,7 +203,7 @@ struct snd_usb_stream { | |||
205 | */ | 203 | */ |
206 | 204 | ||
207 | static DECLARE_MUTEX(register_mutex); | 205 | static DECLARE_MUTEX(register_mutex); |
208 | static snd_usb_audio_t *usb_chip[SNDRV_CARDS]; | 206 | static struct snd_usb_audio *usb_chip[SNDRV_CARDS]; |
209 | 207 | ||
210 | 208 | ||
211 | /* | 209 | /* |
@@ -245,12 +243,12 @@ static inline unsigned get_high_speed_hz(unsigned int usb_rate) | |||
245 | * fill the length and offset of each urb descriptor. | 243 | * fill the length and offset of each urb descriptor. |
246 | * the fixed 10.14 frequency is passed through the pipe. | 244 | * the fixed 10.14 frequency is passed through the pipe. |
247 | */ | 245 | */ |
248 | static int prepare_capture_sync_urb(snd_usb_substream_t *subs, | 246 | static int prepare_capture_sync_urb(struct snd_usb_substream *subs, |
249 | snd_pcm_runtime_t *runtime, | 247 | struct snd_pcm_runtime *runtime, |
250 | struct urb *urb) | 248 | struct urb *urb) |
251 | { | 249 | { |
252 | unsigned char *cp = urb->transfer_buffer; | 250 | unsigned char *cp = urb->transfer_buffer; |
253 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 251 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
254 | 252 | ||
255 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ | 253 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ |
256 | urb->iso_frame_desc[0].length = 3; | 254 | urb->iso_frame_desc[0].length = 3; |
@@ -267,12 +265,12 @@ static int prepare_capture_sync_urb(snd_usb_substream_t *subs, | |||
267 | * fill the length and offset of each urb descriptor. | 265 | * fill the length and offset of each urb descriptor. |
268 | * the fixed 12.13 frequency is passed as 16.16 through the pipe. | 266 | * the fixed 12.13 frequency is passed as 16.16 through the pipe. |
269 | */ | 267 | */ |
270 | static int prepare_capture_sync_urb_hs(snd_usb_substream_t *subs, | 268 | static int prepare_capture_sync_urb_hs(struct snd_usb_substream *subs, |
271 | snd_pcm_runtime_t *runtime, | 269 | struct snd_pcm_runtime *runtime, |
272 | struct urb *urb) | 270 | struct urb *urb) |
273 | { | 271 | { |
274 | unsigned char *cp = urb->transfer_buffer; | 272 | unsigned char *cp = urb->transfer_buffer; |
275 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 273 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
276 | 274 | ||
277 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ | 275 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ |
278 | urb->iso_frame_desc[0].length = 4; | 276 | urb->iso_frame_desc[0].length = 4; |
@@ -288,8 +286,8 @@ static int prepare_capture_sync_urb_hs(snd_usb_substream_t *subs, | |||
288 | * process after capture sync complete | 286 | * process after capture sync complete |
289 | * - nothing to do | 287 | * - nothing to do |
290 | */ | 288 | */ |
291 | static int retire_capture_sync_urb(snd_usb_substream_t *subs, | 289 | static int retire_capture_sync_urb(struct snd_usb_substream *subs, |
292 | snd_pcm_runtime_t *runtime, | 290 | struct snd_pcm_runtime *runtime, |
293 | struct urb *urb) | 291 | struct urb *urb) |
294 | { | 292 | { |
295 | return 0; | 293 | return 0; |
@@ -305,12 +303,12 @@ static int retire_capture_sync_urb(snd_usb_substream_t *subs, | |||
305 | * write onto the pcm buffer directly... the data is thus copied | 303 | * write onto the pcm buffer directly... the data is thus copied |
306 | * later at complete callback to the global buffer. | 304 | * later at complete callback to the global buffer. |
307 | */ | 305 | */ |
308 | static int prepare_capture_urb(snd_usb_substream_t *subs, | 306 | static int prepare_capture_urb(struct snd_usb_substream *subs, |
309 | snd_pcm_runtime_t *runtime, | 307 | struct snd_pcm_runtime *runtime, |
310 | struct urb *urb) | 308 | struct urb *urb) |
311 | { | 309 | { |
312 | int i, offs; | 310 | int i, offs; |
313 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 311 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
314 | 312 | ||
315 | offs = 0; | 313 | offs = 0; |
316 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ | 314 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ |
@@ -340,8 +338,8 @@ static int prepare_capture_urb(snd_usb_substream_t *subs, | |||
340 | * copy the data from each desctiptor to the pcm buffer, and | 338 | * copy the data from each desctiptor to the pcm buffer, and |
341 | * update the current position. | 339 | * update the current position. |
342 | */ | 340 | */ |
343 | static int retire_capture_urb(snd_usb_substream_t *subs, | 341 | static int retire_capture_urb(struct snd_usb_substream *subs, |
344 | snd_pcm_runtime_t *runtime, | 342 | struct snd_pcm_runtime *runtime, |
345 | struct urb *urb) | 343 | struct urb *urb) |
346 | { | 344 | { |
347 | unsigned long flags; | 345 | unsigned long flags; |
@@ -395,11 +393,11 @@ static int retire_capture_urb(snd_usb_substream_t *subs, | |||
395 | * set up the offset and length to receive the current frequency. | 393 | * set up the offset and length to receive the current frequency. |
396 | */ | 394 | */ |
397 | 395 | ||
398 | static int prepare_playback_sync_urb(snd_usb_substream_t *subs, | 396 | static int prepare_playback_sync_urb(struct snd_usb_substream *subs, |
399 | snd_pcm_runtime_t *runtime, | 397 | struct snd_pcm_runtime *runtime, |
400 | struct urb *urb) | 398 | struct urb *urb) |
401 | { | 399 | { |
402 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 400 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
403 | 401 | ||
404 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ | 402 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ |
405 | urb->iso_frame_desc[0].length = 3; | 403 | urb->iso_frame_desc[0].length = 3; |
@@ -413,11 +411,11 @@ static int prepare_playback_sync_urb(snd_usb_substream_t *subs, | |||
413 | * set up the offset and length to receive the current frequency. | 411 | * set up the offset and length to receive the current frequency. |
414 | */ | 412 | */ |
415 | 413 | ||
416 | static int prepare_playback_sync_urb_hs(snd_usb_substream_t *subs, | 414 | static int prepare_playback_sync_urb_hs(struct snd_usb_substream *subs, |
417 | snd_pcm_runtime_t *runtime, | 415 | struct snd_pcm_runtime *runtime, |
418 | struct urb *urb) | 416 | struct urb *urb) |
419 | { | 417 | { |
420 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 418 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
421 | 419 | ||
422 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ | 420 | urb->dev = ctx->subs->dev; /* we need to set this at each time */ |
423 | urb->iso_frame_desc[0].length = 4; | 421 | urb->iso_frame_desc[0].length = 4; |
@@ -431,8 +429,8 @@ static int prepare_playback_sync_urb_hs(snd_usb_substream_t *subs, | |||
431 | * retrieve the current 10.14 frequency from pipe, and set it. | 429 | * retrieve the current 10.14 frequency from pipe, and set it. |
432 | * the value is referred in prepare_playback_urb(). | 430 | * the value is referred in prepare_playback_urb(). |
433 | */ | 431 | */ |
434 | static int retire_playback_sync_urb(snd_usb_substream_t *subs, | 432 | static int retire_playback_sync_urb(struct snd_usb_substream *subs, |
435 | snd_pcm_runtime_t *runtime, | 433 | struct snd_pcm_runtime *runtime, |
436 | struct urb *urb) | 434 | struct urb *urb) |
437 | { | 435 | { |
438 | unsigned int f; | 436 | unsigned int f; |
@@ -457,8 +455,8 @@ static int retire_playback_sync_urb(snd_usb_substream_t *subs, | |||
457 | * retrieve the current 12.13 frequency from pipe, and set it. | 455 | * retrieve the current 12.13 frequency from pipe, and set it. |
458 | * the value is referred in prepare_playback_urb(). | 456 | * the value is referred in prepare_playback_urb(). |
459 | */ | 457 | */ |
460 | static int retire_playback_sync_urb_hs(snd_usb_substream_t *subs, | 458 | static int retire_playback_sync_urb_hs(struct snd_usb_substream *subs, |
461 | snd_pcm_runtime_t *runtime, | 459 | struct snd_pcm_runtime *runtime, |
462 | struct urb *urb) | 460 | struct urb *urb) |
463 | { | 461 | { |
464 | unsigned int f; | 462 | unsigned int f; |
@@ -482,12 +480,12 @@ static int retire_playback_sync_urb_hs(snd_usb_substream_t *subs, | |||
482 | * | 480 | * |
483 | * We don't care about (or have) any data, so we just send a transfer delimiter. | 481 | * We don't care about (or have) any data, so we just send a transfer delimiter. |
484 | */ | 482 | */ |
485 | static int prepare_startup_playback_urb(snd_usb_substream_t *subs, | 483 | static int prepare_startup_playback_urb(struct snd_usb_substream *subs, |
486 | snd_pcm_runtime_t *runtime, | 484 | struct snd_pcm_runtime *runtime, |
487 | struct urb *urb) | 485 | struct urb *urb) |
488 | { | 486 | { |
489 | unsigned int i; | 487 | unsigned int i; |
490 | snd_urb_ctx_t *ctx = urb->context; | 488 | struct snd_urb_ctx *ctx = urb->context; |
491 | 489 | ||
492 | urb->dev = ctx->subs->dev; | 490 | urb->dev = ctx->subs->dev; |
493 | urb->number_of_packets = subs->packs_per_ms; | 491 | urb->number_of_packets = subs->packs_per_ms; |
@@ -507,15 +505,15 @@ static int prepare_startup_playback_urb(snd_usb_substream_t *subs, | |||
507 | * To avoid inconsistencies when updating hwptr_done, we use double buffering | 505 | * To avoid inconsistencies when updating hwptr_done, we use double buffering |
508 | * for all URBs. | 506 | * for all URBs. |
509 | */ | 507 | */ |
510 | static int prepare_playback_urb(snd_usb_substream_t *subs, | 508 | static int prepare_playback_urb(struct snd_usb_substream *subs, |
511 | snd_pcm_runtime_t *runtime, | 509 | struct snd_pcm_runtime *runtime, |
512 | struct urb *urb) | 510 | struct urb *urb) |
513 | { | 511 | { |
514 | int i, stride, offs; | 512 | int i, stride, offs; |
515 | unsigned int counts; | 513 | unsigned int counts; |
516 | unsigned long flags; | 514 | unsigned long flags; |
517 | int period_elapsed = 0; | 515 | int period_elapsed = 0; |
518 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 516 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
519 | 517 | ||
520 | stride = runtime->frame_bits >> 3; | 518 | stride = runtime->frame_bits >> 3; |
521 | 519 | ||
@@ -597,8 +595,8 @@ static int prepare_playback_urb(snd_usb_substream_t *subs, | |||
597 | * process after playback data complete | 595 | * process after playback data complete |
598 | * - nothing to do | 596 | * - nothing to do |
599 | */ | 597 | */ |
600 | static int retire_playback_urb(snd_usb_substream_t *subs, | 598 | static int retire_playback_urb(struct snd_usb_substream *subs, |
601 | snd_pcm_runtime_t *runtime, | 599 | struct snd_pcm_runtime *runtime, |
602 | struct urb *urb) | 600 | struct urb *urb) |
603 | { | 601 | { |
604 | return 0; | 602 | return 0; |
@@ -642,9 +640,9 @@ static struct snd_urb_ops audio_urb_ops_high_speed[2] = { | |||
642 | */ | 640 | */ |
643 | static void snd_complete_urb(struct urb *urb, struct pt_regs *regs) | 641 | static void snd_complete_urb(struct urb *urb, struct pt_regs *regs) |
644 | { | 642 | { |
645 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 643 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
646 | snd_usb_substream_t *subs = ctx->subs; | 644 | struct snd_usb_substream *subs = ctx->subs; |
647 | snd_pcm_substream_t *substream = ctx->subs->pcm_substream; | 645 | struct snd_pcm_substream *substream = ctx->subs->pcm_substream; |
648 | int err = 0; | 646 | int err = 0; |
649 | 647 | ||
650 | if ((subs->running && subs->ops.retire(subs, substream->runtime, urb)) || | 648 | if ((subs->running && subs->ops.retire(subs, substream->runtime, urb)) || |
@@ -665,9 +663,9 @@ static void snd_complete_urb(struct urb *urb, struct pt_regs *regs) | |||
665 | */ | 663 | */ |
666 | static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs) | 664 | static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs) |
667 | { | 665 | { |
668 | snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; | 666 | struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context; |
669 | snd_usb_substream_t *subs = ctx->subs; | 667 | struct snd_usb_substream *subs = ctx->subs; |
670 | snd_pcm_substream_t *substream = ctx->subs->pcm_substream; | 668 | struct snd_pcm_substream *substream = ctx->subs->pcm_substream; |
671 | int err = 0; | 669 | int err = 0; |
672 | 670 | ||
673 | if ((subs->running && subs->ops.retire_sync(subs, substream->runtime, urb)) || | 671 | if ((subs->running && subs->ops.retire_sync(subs, substream->runtime, urb)) || |
@@ -684,7 +682,7 @@ static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs) | |||
684 | 682 | ||
685 | 683 | ||
686 | /* get the physical page pointer at the given offset */ | 684 | /* get the physical page pointer at the given offset */ |
687 | static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, | 685 | static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, |
688 | unsigned long offset) | 686 | unsigned long offset) |
689 | { | 687 | { |
690 | void *pageptr = subs->runtime->dma_area + offset; | 688 | void *pageptr = subs->runtime->dma_area + offset; |
@@ -692,9 +690,9 @@ static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, | |||
692 | } | 690 | } |
693 | 691 | ||
694 | /* allocate virtual buffer; may be called more than once */ | 692 | /* allocate virtual buffer; may be called more than once */ |
695 | static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) | 693 | static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t size) |
696 | { | 694 | { |
697 | snd_pcm_runtime_t *runtime = subs->runtime; | 695 | struct snd_pcm_runtime *runtime = subs->runtime; |
698 | if (runtime->dma_area) { | 696 | if (runtime->dma_area) { |
699 | if (runtime->dma_bytes >= size) | 697 | if (runtime->dma_bytes >= size) |
700 | return 0; /* already large enough */ | 698 | return 0; /* already large enough */ |
@@ -708,9 +706,9 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) | |||
708 | } | 706 | } |
709 | 707 | ||
710 | /* free virtual buffer; may be called more than once */ | 708 | /* free virtual buffer; may be called more than once */ |
711 | static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) | 709 | static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) |
712 | { | 710 | { |
713 | snd_pcm_runtime_t *runtime = subs->runtime; | 711 | struct snd_pcm_runtime *runtime = subs->runtime; |
714 | if (runtime->dma_area) { | 712 | if (runtime->dma_area) { |
715 | vfree(runtime->dma_area); | 713 | vfree(runtime->dma_area); |
716 | runtime->dma_area = NULL; | 714 | runtime->dma_area = NULL; |
@@ -722,7 +720,7 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) | |||
722 | /* | 720 | /* |
723 | * unlink active urbs. | 721 | * unlink active urbs. |
724 | */ | 722 | */ |
725 | static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep) | 723 | static int deactivate_urbs(struct snd_usb_substream *subs, int force, int can_sleep) |
726 | { | 724 | { |
727 | unsigned int i; | 725 | unsigned int i; |
728 | int async; | 726 | int async; |
@@ -768,7 +766,7 @@ static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep) | |||
768 | /* | 766 | /* |
769 | * set up and start data/sync urbs | 767 | * set up and start data/sync urbs |
770 | */ | 768 | */ |
771 | static int start_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) | 769 | static int start_urbs(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime) |
772 | { | 770 | { |
773 | unsigned int i; | 771 | unsigned int i; |
774 | int err; | 772 | int err; |
@@ -824,7 +822,7 @@ static int start_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) | |||
824 | /* | 822 | /* |
825 | * wait until all urbs are processed. | 823 | * wait until all urbs are processed. |
826 | */ | 824 | */ |
827 | static int wait_clear_urbs(snd_usb_substream_t *subs) | 825 | static int wait_clear_urbs(struct snd_usb_substream *subs) |
828 | { | 826 | { |
829 | unsigned long end_time = jiffies + msecs_to_jiffies(1000); | 827 | unsigned long end_time = jiffies + msecs_to_jiffies(1000); |
830 | unsigned int i; | 828 | unsigned int i; |
@@ -855,12 +853,12 @@ static int wait_clear_urbs(snd_usb_substream_t *subs) | |||
855 | /* | 853 | /* |
856 | * return the current pcm pointer. just return the hwptr_done value. | 854 | * return the current pcm pointer. just return the hwptr_done value. |
857 | */ | 855 | */ |
858 | static snd_pcm_uframes_t snd_usb_pcm_pointer(snd_pcm_substream_t *substream) | 856 | static snd_pcm_uframes_t snd_usb_pcm_pointer(struct snd_pcm_substream *substream) |
859 | { | 857 | { |
860 | snd_usb_substream_t *subs; | 858 | struct snd_usb_substream *subs; |
861 | snd_pcm_uframes_t hwptr_done; | 859 | snd_pcm_uframes_t hwptr_done; |
862 | 860 | ||
863 | subs = (snd_usb_substream_t *)substream->runtime->private_data; | 861 | subs = (struct snd_usb_substream *)substream->runtime->private_data; |
864 | spin_lock(&subs->lock); | 862 | spin_lock(&subs->lock); |
865 | hwptr_done = subs->hwptr_done; | 863 | hwptr_done = subs->hwptr_done; |
866 | spin_unlock(&subs->lock); | 864 | spin_unlock(&subs->lock); |
@@ -871,10 +869,10 @@ static snd_pcm_uframes_t snd_usb_pcm_pointer(snd_pcm_substream_t *substream) | |||
871 | /* | 869 | /* |
872 | * start/stop playback substream | 870 | * start/stop playback substream |
873 | */ | 871 | */ |
874 | static int snd_usb_pcm_playback_trigger(snd_pcm_substream_t *substream, | 872 | static int snd_usb_pcm_playback_trigger(struct snd_pcm_substream *substream, |
875 | int cmd) | 873 | int cmd) |
876 | { | 874 | { |
877 | snd_usb_substream_t *subs = substream->runtime->private_data; | 875 | struct snd_usb_substream *subs = substream->runtime->private_data; |
878 | 876 | ||
879 | switch (cmd) { | 877 | switch (cmd) { |
880 | case SNDRV_PCM_TRIGGER_START: | 878 | case SNDRV_PCM_TRIGGER_START: |
@@ -890,10 +888,10 @@ static int snd_usb_pcm_playback_trigger(snd_pcm_substream_t *substream, | |||
890 | /* | 888 | /* |
891 | * start/stop capture substream | 889 | * start/stop capture substream |
892 | */ | 890 | */ |
893 | static int snd_usb_pcm_capture_trigger(snd_pcm_substream_t *substream, | 891 | static int snd_usb_pcm_capture_trigger(struct snd_pcm_substream *substream, |
894 | int cmd) | 892 | int cmd) |
895 | { | 893 | { |
896 | snd_usb_substream_t *subs = substream->runtime->private_data; | 894 | struct snd_usb_substream *subs = substream->runtime->private_data; |
897 | 895 | ||
898 | switch (cmd) { | 896 | switch (cmd) { |
899 | case SNDRV_PCM_TRIGGER_START: | 897 | case SNDRV_PCM_TRIGGER_START: |
@@ -909,7 +907,7 @@ static int snd_usb_pcm_capture_trigger(snd_pcm_substream_t *substream, | |||
909 | /* | 907 | /* |
910 | * release a urb data | 908 | * release a urb data |
911 | */ | 909 | */ |
912 | static void release_urb_ctx(snd_urb_ctx_t *u) | 910 | static void release_urb_ctx(struct snd_urb_ctx *u) |
913 | { | 911 | { |
914 | if (u->urb) { | 912 | if (u->urb) { |
915 | if (u->buffer_size) | 913 | if (u->buffer_size) |
@@ -924,7 +922,7 @@ static void release_urb_ctx(snd_urb_ctx_t *u) | |||
924 | /* | 922 | /* |
925 | * release a substream | 923 | * release a substream |
926 | */ | 924 | */ |
927 | static void release_substream_urbs(snd_usb_substream_t *subs, int force) | 925 | static void release_substream_urbs(struct snd_usb_substream *subs, int force) |
928 | { | 926 | { |
929 | int i; | 927 | int i; |
930 | 928 | ||
@@ -945,7 +943,7 @@ static void release_substream_urbs(snd_usb_substream_t *subs, int force) | |||
945 | /* | 943 | /* |
946 | * initialize a substream for plaback/capture | 944 | * initialize a substream for plaback/capture |
947 | */ | 945 | */ |
948 | static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_bytes, | 946 | static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int period_bytes, |
949 | unsigned int rate, unsigned int frame_bits) | 947 | unsigned int rate, unsigned int frame_bits) |
950 | { | 948 | { |
951 | unsigned int maxsize, n, i; | 949 | unsigned int maxsize, n, i; |
@@ -1045,7 +1043,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by | |||
1045 | 1043 | ||
1046 | /* allocate and initialize data urbs */ | 1044 | /* allocate and initialize data urbs */ |
1047 | for (i = 0; i < subs->nurbs; i++) { | 1045 | for (i = 0; i < subs->nurbs; i++) { |
1048 | snd_urb_ctx_t *u = &subs->dataurb[i]; | 1046 | struct snd_urb_ctx *u = &subs->dataurb[i]; |
1049 | u->index = i; | 1047 | u->index = i; |
1050 | u->subs = subs; | 1048 | u->subs = subs; |
1051 | u->packets = npacks[i]; | 1049 | u->packets = npacks[i]; |
@@ -1074,7 +1072,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by | |||
1074 | if (! subs->syncbuf) | 1072 | if (! subs->syncbuf) |
1075 | goto out_of_memory; | 1073 | goto out_of_memory; |
1076 | for (i = 0; i < SYNC_URBS; i++) { | 1074 | for (i = 0; i < SYNC_URBS; i++) { |
1077 | snd_urb_ctx_t *u = &subs->syncurb[i]; | 1075 | struct snd_urb_ctx *u = &subs->syncurb[i]; |
1078 | u->index = i; | 1076 | u->index = i; |
1079 | u->subs = subs; | 1077 | u->subs = subs; |
1080 | u->packets = 1; | 1078 | u->packets = 1; |
@@ -1104,7 +1102,7 @@ out_of_memory: | |||
1104 | /* | 1102 | /* |
1105 | * find a matching audio format | 1103 | * find a matching audio format |
1106 | */ | 1104 | */ |
1107 | static struct audioformat *find_format(snd_usb_substream_t *subs, unsigned int format, | 1105 | static struct audioformat *find_format(struct snd_usb_substream *subs, unsigned int format, |
1108 | unsigned int rate, unsigned int channels) | 1106 | unsigned int rate, unsigned int channels) |
1109 | { | 1107 | { |
1110 | struct list_head *p; | 1108 | struct list_head *p; |
@@ -1229,7 +1227,7 @@ static int init_usb_sample_rate(struct usb_device *dev, int iface, | |||
1229 | /* | 1227 | /* |
1230 | * find a matching format and set up the interface | 1228 | * find a matching format and set up the interface |
1231 | */ | 1229 | */ |
1232 | static int set_format(snd_usb_substream_t *subs, struct audioformat *fmt) | 1230 | static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) |
1233 | { | 1231 | { |
1234 | struct usb_device *dev = subs->dev; | 1232 | struct usb_device *dev = subs->dev; |
1235 | struct usb_host_interface *alts; | 1233 | struct usb_host_interface *alts; |
@@ -1358,10 +1356,10 @@ static int set_format(snd_usb_substream_t *subs, struct audioformat *fmt) | |||
1358 | * if sg buffer is supported on the later version of alsa, we'll follow | 1356 | * if sg buffer is supported on the later version of alsa, we'll follow |
1359 | * that. | 1357 | * that. |
1360 | */ | 1358 | */ |
1361 | static int snd_usb_hw_params(snd_pcm_substream_t *substream, | 1359 | static int snd_usb_hw_params(struct snd_pcm_substream *substream, |
1362 | snd_pcm_hw_params_t *hw_params) | 1360 | struct snd_pcm_hw_params *hw_params) |
1363 | { | 1361 | { |
1364 | snd_usb_substream_t *subs = (snd_usb_substream_t *)substream->runtime->private_data; | 1362 | struct snd_usb_substream *subs = (struct snd_usb_substream *)substream->runtime->private_data; |
1365 | struct audioformat *fmt; | 1363 | struct audioformat *fmt; |
1366 | unsigned int channels, rate, format; | 1364 | unsigned int channels, rate, format; |
1367 | int ret, changed; | 1365 | int ret, changed; |
@@ -1415,9 +1413,9 @@ static int snd_usb_hw_params(snd_pcm_substream_t *substream, | |||
1415 | * | 1413 | * |
1416 | * reset the audio format and release the buffer | 1414 | * reset the audio format and release the buffer |
1417 | */ | 1415 | */ |
1418 | static int snd_usb_hw_free(snd_pcm_substream_t *substream) | 1416 | static int snd_usb_hw_free(struct snd_pcm_substream *substream) |
1419 | { | 1417 | { |
1420 | snd_usb_substream_t *subs = (snd_usb_substream_t *)substream->runtime->private_data; | 1418 | struct snd_usb_substream *subs = (struct snd_usb_substream *)substream->runtime->private_data; |
1421 | 1419 | ||
1422 | subs->cur_audiofmt = NULL; | 1420 | subs->cur_audiofmt = NULL; |
1423 | subs->cur_rate = 0; | 1421 | subs->cur_rate = 0; |
@@ -1431,10 +1429,10 @@ static int snd_usb_hw_free(snd_pcm_substream_t *substream) | |||
1431 | * | 1429 | * |
1432 | * only a few subtle things... | 1430 | * only a few subtle things... |
1433 | */ | 1431 | */ |
1434 | static int snd_usb_pcm_prepare(snd_pcm_substream_t *substream) | 1432 | static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) |
1435 | { | 1433 | { |
1436 | snd_pcm_runtime_t *runtime = substream->runtime; | 1434 | struct snd_pcm_runtime *runtime = substream->runtime; |
1437 | snd_usb_substream_t *subs = runtime->private_data; | 1435 | struct snd_usb_substream *subs = runtime->private_data; |
1438 | 1436 | ||
1439 | if (! subs->cur_audiofmt) { | 1437 | if (! subs->cur_audiofmt) { |
1440 | snd_printk(KERN_ERR "usbaudio: no format is specified!\n"); | 1438 | snd_printk(KERN_ERR "usbaudio: no format is specified!\n"); |
@@ -1463,7 +1461,7 @@ static int snd_usb_pcm_prepare(snd_pcm_substream_t *substream) | |||
1463 | return 0; | 1461 | return 0; |
1464 | } | 1462 | } |
1465 | 1463 | ||
1466 | static snd_pcm_hardware_t snd_usb_playback = | 1464 | static struct snd_pcm_hardware snd_usb_playback = |
1467 | { | 1465 | { |
1468 | .info = SNDRV_PCM_INFO_MMAP | | 1466 | .info = SNDRV_PCM_INFO_MMAP | |
1469 | SNDRV_PCM_INFO_MMAP_VALID | | 1467 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -1477,7 +1475,7 @@ static snd_pcm_hardware_t snd_usb_playback = | |||
1477 | .periods_max = 1024, | 1475 | .periods_max = 1024, |
1478 | }; | 1476 | }; |
1479 | 1477 | ||
1480 | static snd_pcm_hardware_t snd_usb_capture = | 1478 | static struct snd_pcm_hardware snd_usb_capture = |
1481 | { | 1479 | { |
1482 | .info = SNDRV_PCM_INFO_MMAP | | 1480 | .info = SNDRV_PCM_INFO_MMAP | |
1483 | SNDRV_PCM_INFO_MMAP_VALID | | 1481 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -1501,11 +1499,11 @@ static snd_pcm_hardware_t snd_usb_capture = | |||
1501 | #define hwc_debug(fmt, args...) /**/ | 1499 | #define hwc_debug(fmt, args...) /**/ |
1502 | #endif | 1500 | #endif |
1503 | 1501 | ||
1504 | static int hw_check_valid_format(snd_pcm_hw_params_t *params, struct audioformat *fp) | 1502 | static int hw_check_valid_format(struct snd_pcm_hw_params *params, struct audioformat *fp) |
1505 | { | 1503 | { |
1506 | snd_interval_t *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); | 1504 | struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); |
1507 | snd_interval_t *ct = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 1505 | struct snd_interval *ct = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
1508 | snd_mask_t *fmts = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); | 1506 | struct snd_mask *fmts = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); |
1509 | 1507 | ||
1510 | /* check the format */ | 1508 | /* check the format */ |
1511 | if (! snd_mask_test(fmts, fp->format)) { | 1509 | if (! snd_mask_test(fmts, fp->format)) { |
@@ -1529,12 +1527,12 @@ static int hw_check_valid_format(snd_pcm_hw_params_t *params, struct audioformat | |||
1529 | return 1; | 1527 | return 1; |
1530 | } | 1528 | } |
1531 | 1529 | ||
1532 | static int hw_rule_rate(snd_pcm_hw_params_t *params, | 1530 | static int hw_rule_rate(struct snd_pcm_hw_params *params, |
1533 | snd_pcm_hw_rule_t *rule) | 1531 | struct snd_pcm_hw_rule *rule) |
1534 | { | 1532 | { |
1535 | snd_usb_substream_t *subs = rule->private; | 1533 | struct snd_usb_substream *subs = rule->private; |
1536 | struct list_head *p; | 1534 | struct list_head *p; |
1537 | snd_interval_t *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); | 1535 | struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); |
1538 | unsigned int rmin, rmax; | 1536 | unsigned int rmin, rmax; |
1539 | int changed; | 1537 | int changed; |
1540 | 1538 | ||
@@ -1583,12 +1581,12 @@ static int hw_rule_rate(snd_pcm_hw_params_t *params, | |||
1583 | } | 1581 | } |
1584 | 1582 | ||
1585 | 1583 | ||
1586 | static int hw_rule_channels(snd_pcm_hw_params_t *params, | 1584 | static int hw_rule_channels(struct snd_pcm_hw_params *params, |
1587 | snd_pcm_hw_rule_t *rule) | 1585 | struct snd_pcm_hw_rule *rule) |
1588 | { | 1586 | { |
1589 | snd_usb_substream_t *subs = rule->private; | 1587 | struct snd_usb_substream *subs = rule->private; |
1590 | struct list_head *p; | 1588 | struct list_head *p; |
1591 | snd_interval_t *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 1589 | struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
1592 | unsigned int rmin, rmax; | 1590 | unsigned int rmin, rmax; |
1593 | int changed; | 1591 | int changed; |
1594 | 1592 | ||
@@ -1636,12 +1634,12 @@ static int hw_rule_channels(snd_pcm_hw_params_t *params, | |||
1636 | return changed; | 1634 | return changed; |
1637 | } | 1635 | } |
1638 | 1636 | ||
1639 | static int hw_rule_format(snd_pcm_hw_params_t *params, | 1637 | static int hw_rule_format(struct snd_pcm_hw_params *params, |
1640 | snd_pcm_hw_rule_t *rule) | 1638 | struct snd_pcm_hw_rule *rule) |
1641 | { | 1639 | { |
1642 | snd_usb_substream_t *subs = rule->private; | 1640 | struct snd_usb_substream *subs = rule->private; |
1643 | struct list_head *p; | 1641 | struct list_head *p; |
1644 | snd_mask_t *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); | 1642 | struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); |
1645 | u64 fbits; | 1643 | u64 fbits; |
1646 | u32 oldbits[2]; | 1644 | u32 oldbits[2]; |
1647 | int changed; | 1645 | int changed; |
@@ -1674,7 +1672,7 @@ static int hw_rule_format(snd_pcm_hw_params_t *params, | |||
1674 | /* | 1672 | /* |
1675 | * check whether the registered audio formats need special hw-constraints | 1673 | * check whether the registered audio formats need special hw-constraints |
1676 | */ | 1674 | */ |
1677 | static int check_hw_params_convention(snd_usb_substream_t *subs) | 1675 | static int check_hw_params_convention(struct snd_usb_substream *subs) |
1678 | { | 1676 | { |
1679 | int i; | 1677 | int i; |
1680 | u32 *channels; | 1678 | u32 *channels; |
@@ -1758,7 +1756,7 @@ static int check_hw_params_convention(snd_usb_substream_t *subs) | |||
1758 | * set up the runtime hardware information. | 1756 | * set up the runtime hardware information. |
1759 | */ | 1757 | */ |
1760 | 1758 | ||
1761 | static int setup_hw_info(snd_pcm_runtime_t *runtime, snd_usb_substream_t *subs) | 1759 | static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs) |
1762 | { | 1760 | { |
1763 | struct list_head *p; | 1761 | struct list_head *p; |
1764 | int err; | 1762 | int err; |
@@ -1819,12 +1817,12 @@ static int setup_hw_info(snd_pcm_runtime_t *runtime, snd_usb_substream_t *subs) | |||
1819 | return 0; | 1817 | return 0; |
1820 | } | 1818 | } |
1821 | 1819 | ||
1822 | static int snd_usb_pcm_open(snd_pcm_substream_t *substream, int direction, | 1820 | static int snd_usb_pcm_open(struct snd_pcm_substream *substream, int direction, |
1823 | snd_pcm_hardware_t *hw) | 1821 | struct snd_pcm_hardware *hw) |
1824 | { | 1822 | { |
1825 | snd_usb_stream_t *as = snd_pcm_substream_chip(substream); | 1823 | struct snd_usb_stream *as = snd_pcm_substream_chip(substream); |
1826 | snd_pcm_runtime_t *runtime = substream->runtime; | 1824 | struct snd_pcm_runtime *runtime = substream->runtime; |
1827 | snd_usb_substream_t *subs = &as->substream[direction]; | 1825 | struct snd_usb_substream *subs = &as->substream[direction]; |
1828 | 1826 | ||
1829 | subs->interface = -1; | 1827 | subs->interface = -1; |
1830 | subs->format = 0; | 1828 | subs->format = 0; |
@@ -1834,10 +1832,10 @@ static int snd_usb_pcm_open(snd_pcm_substream_t *substream, int direction, | |||
1834 | return setup_hw_info(runtime, subs); | 1832 | return setup_hw_info(runtime, subs); |
1835 | } | 1833 | } |
1836 | 1834 | ||
1837 | static int snd_usb_pcm_close(snd_pcm_substream_t *substream, int direction) | 1835 | static int snd_usb_pcm_close(struct snd_pcm_substream *substream, int direction) |
1838 | { | 1836 | { |
1839 | snd_usb_stream_t *as = snd_pcm_substream_chip(substream); | 1837 | struct snd_usb_stream *as = snd_pcm_substream_chip(substream); |
1840 | snd_usb_substream_t *subs = &as->substream[direction]; | 1838 | struct snd_usb_substream *subs = &as->substream[direction]; |
1841 | 1839 | ||
1842 | if (subs->interface >= 0) { | 1840 | if (subs->interface >= 0) { |
1843 | usb_set_interface(subs->dev, subs->interface, 0); | 1841 | usb_set_interface(subs->dev, subs->interface, 0); |
@@ -1847,27 +1845,27 @@ static int snd_usb_pcm_close(snd_pcm_substream_t *substream, int direction) | |||
1847 | return 0; | 1845 | return 0; |
1848 | } | 1846 | } |
1849 | 1847 | ||
1850 | static int snd_usb_playback_open(snd_pcm_substream_t *substream) | 1848 | static int snd_usb_playback_open(struct snd_pcm_substream *substream) |
1851 | { | 1849 | { |
1852 | return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_PLAYBACK, &snd_usb_playback); | 1850 | return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_PLAYBACK, &snd_usb_playback); |
1853 | } | 1851 | } |
1854 | 1852 | ||
1855 | static int snd_usb_playback_close(snd_pcm_substream_t *substream) | 1853 | static int snd_usb_playback_close(struct snd_pcm_substream *substream) |
1856 | { | 1854 | { |
1857 | return snd_usb_pcm_close(substream, SNDRV_PCM_STREAM_PLAYBACK); | 1855 | return snd_usb_pcm_close(substream, SNDRV_PCM_STREAM_PLAYBACK); |
1858 | } | 1856 | } |
1859 | 1857 | ||
1860 | static int snd_usb_capture_open(snd_pcm_substream_t *substream) | 1858 | static int snd_usb_capture_open(struct snd_pcm_substream *substream) |
1861 | { | 1859 | { |
1862 | return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_CAPTURE, &snd_usb_capture); | 1860 | return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_CAPTURE, &snd_usb_capture); |
1863 | } | 1861 | } |
1864 | 1862 | ||
1865 | static int snd_usb_capture_close(snd_pcm_substream_t *substream) | 1863 | static int snd_usb_capture_close(struct snd_pcm_substream *substream) |
1866 | { | 1864 | { |
1867 | return snd_usb_pcm_close(substream, SNDRV_PCM_STREAM_CAPTURE); | 1865 | return snd_usb_pcm_close(substream, SNDRV_PCM_STREAM_CAPTURE); |
1868 | } | 1866 | } |
1869 | 1867 | ||
1870 | static snd_pcm_ops_t snd_usb_playback_ops = { | 1868 | static struct snd_pcm_ops snd_usb_playback_ops = { |
1871 | .open = snd_usb_playback_open, | 1869 | .open = snd_usb_playback_open, |
1872 | .close = snd_usb_playback_close, | 1870 | .close = snd_usb_playback_close, |
1873 | .ioctl = snd_pcm_lib_ioctl, | 1871 | .ioctl = snd_pcm_lib_ioctl, |
@@ -1879,7 +1877,7 @@ static snd_pcm_ops_t snd_usb_playback_ops = { | |||
1879 | .page = snd_pcm_get_vmalloc_page, | 1877 | .page = snd_pcm_get_vmalloc_page, |
1880 | }; | 1878 | }; |
1881 | 1879 | ||
1882 | static snd_pcm_ops_t snd_usb_capture_ops = { | 1880 | static struct snd_pcm_ops snd_usb_capture_ops = { |
1883 | .open = snd_usb_capture_open, | 1881 | .open = snd_usb_capture_open, |
1884 | .close = snd_usb_capture_close, | 1882 | .close = snd_usb_capture_close, |
1885 | .ioctl = snd_pcm_lib_ioctl, | 1883 | .ioctl = snd_pcm_lib_ioctl, |
@@ -2006,7 +2004,7 @@ static struct usb_driver usb_audio_driver = { | |||
2006 | /* | 2004 | /* |
2007 | * proc interface for list the supported pcm formats | 2005 | * proc interface for list the supported pcm formats |
2008 | */ | 2006 | */ |
2009 | static void proc_dump_substream_formats(snd_usb_substream_t *subs, snd_info_buffer_t *buffer) | 2007 | static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct snd_info_buffer *buffer) |
2010 | { | 2008 | { |
2011 | struct list_head *p; | 2009 | struct list_head *p; |
2012 | static char *sync_types[4] = { | 2010 | static char *sync_types[4] = { |
@@ -2042,7 +2040,7 @@ static void proc_dump_substream_formats(snd_usb_substream_t *subs, snd_info_buff | |||
2042 | } | 2040 | } |
2043 | } | 2041 | } |
2044 | 2042 | ||
2045 | static void proc_dump_substream_status(snd_usb_substream_t *subs, snd_info_buffer_t *buffer) | 2043 | static void proc_dump_substream_status(struct snd_usb_substream *subs, struct snd_info_buffer *buffer) |
2046 | { | 2044 | { |
2047 | if (subs->running) { | 2045 | if (subs->running) { |
2048 | unsigned int i; | 2046 | unsigned int i; |
@@ -2064,9 +2062,9 @@ static void proc_dump_substream_status(snd_usb_substream_t *subs, snd_info_buffe | |||
2064 | } | 2062 | } |
2065 | } | 2063 | } |
2066 | 2064 | ||
2067 | static void proc_pcm_format_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) | 2065 | static void proc_pcm_format_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
2068 | { | 2066 | { |
2069 | snd_usb_stream_t *stream = entry->private_data; | 2067 | struct snd_usb_stream *stream = entry->private_data; |
2070 | 2068 | ||
2071 | snd_iprintf(buffer, "%s : %s\n", stream->chip->card->longname, stream->pcm->name); | 2069 | snd_iprintf(buffer, "%s : %s\n", stream->chip->card->longname, stream->pcm->name); |
2072 | 2070 | ||
@@ -2082,11 +2080,11 @@ static void proc_pcm_format_read(snd_info_entry_t *entry, snd_info_buffer_t *buf | |||
2082 | } | 2080 | } |
2083 | } | 2081 | } |
2084 | 2082 | ||
2085 | static void proc_pcm_format_add(snd_usb_stream_t *stream) | 2083 | static void proc_pcm_format_add(struct snd_usb_stream *stream) |
2086 | { | 2084 | { |
2087 | snd_info_entry_t *entry; | 2085 | struct snd_info_entry *entry; |
2088 | char name[32]; | 2086 | char name[32]; |
2089 | snd_card_t *card = stream->chip->card; | 2087 | struct snd_card *card = stream->chip->card; |
2090 | 2088 | ||
2091 | sprintf(name, "stream%d", stream->pcm_index); | 2089 | sprintf(name, "stream%d", stream->pcm_index); |
2092 | if (! snd_card_proc_new(card, name, &entry)) | 2090 | if (! snd_card_proc_new(card, name, &entry)) |
@@ -2098,9 +2096,9 @@ static void proc_pcm_format_add(snd_usb_stream_t *stream) | |||
2098 | * initialize the substream instance. | 2096 | * initialize the substream instance. |
2099 | */ | 2097 | */ |
2100 | 2098 | ||
2101 | static void init_substream(snd_usb_stream_t *as, int stream, struct audioformat *fp) | 2099 | static void init_substream(struct snd_usb_stream *as, int stream, struct audioformat *fp) |
2102 | { | 2100 | { |
2103 | snd_usb_substream_t *subs = &as->substream[stream]; | 2101 | struct snd_usb_substream *subs = &as->substream[stream]; |
2104 | 2102 | ||
2105 | INIT_LIST_HEAD(&subs->fmt_list); | 2103 | INIT_LIST_HEAD(&subs->fmt_list); |
2106 | spin_lock_init(&subs->lock); | 2104 | spin_lock_init(&subs->lock); |
@@ -2127,7 +2125,7 @@ static void init_substream(snd_usb_stream_t *as, int stream, struct audioformat | |||
2127 | /* | 2125 | /* |
2128 | * free a substream | 2126 | * free a substream |
2129 | */ | 2127 | */ |
2130 | static void free_substream(snd_usb_substream_t *subs) | 2128 | static void free_substream(struct snd_usb_substream *subs) |
2131 | { | 2129 | { |
2132 | struct list_head *p, *n; | 2130 | struct list_head *p, *n; |
2133 | 2131 | ||
@@ -2144,7 +2142,7 @@ static void free_substream(snd_usb_substream_t *subs) | |||
2144 | /* | 2142 | /* |
2145 | * free a usb stream instance | 2143 | * free a usb stream instance |
2146 | */ | 2144 | */ |
2147 | static void snd_usb_audio_stream_free(snd_usb_stream_t *stream) | 2145 | static void snd_usb_audio_stream_free(struct snd_usb_stream *stream) |
2148 | { | 2146 | { |
2149 | free_substream(&stream->substream[0]); | 2147 | free_substream(&stream->substream[0]); |
2150 | free_substream(&stream->substream[1]); | 2148 | free_substream(&stream->substream[1]); |
@@ -2152,9 +2150,9 @@ static void snd_usb_audio_stream_free(snd_usb_stream_t *stream) | |||
2152 | kfree(stream); | 2150 | kfree(stream); |
2153 | } | 2151 | } |
2154 | 2152 | ||
2155 | static void snd_usb_audio_pcm_free(snd_pcm_t *pcm) | 2153 | static void snd_usb_audio_pcm_free(struct snd_pcm *pcm) |
2156 | { | 2154 | { |
2157 | snd_usb_stream_t *stream = pcm->private_data; | 2155 | struct snd_usb_stream *stream = pcm->private_data; |
2158 | if (stream) { | 2156 | if (stream) { |
2159 | stream->pcm = NULL; | 2157 | stream->pcm = NULL; |
2160 | snd_usb_audio_stream_free(stream); | 2158 | snd_usb_audio_stream_free(stream); |
@@ -2167,16 +2165,16 @@ static void snd_usb_audio_pcm_free(snd_pcm_t *pcm) | |||
2167 | * if a stream with the same endpoint already exists, append to it. | 2165 | * if a stream with the same endpoint already exists, append to it. |
2168 | * if not, create a new pcm stream. | 2166 | * if not, create a new pcm stream. |
2169 | */ | 2167 | */ |
2170 | static int add_audio_endpoint(snd_usb_audio_t *chip, int stream, struct audioformat *fp) | 2168 | static int add_audio_endpoint(struct snd_usb_audio *chip, int stream, struct audioformat *fp) |
2171 | { | 2169 | { |
2172 | struct list_head *p; | 2170 | struct list_head *p; |
2173 | snd_usb_stream_t *as; | 2171 | struct snd_usb_stream *as; |
2174 | snd_usb_substream_t *subs; | 2172 | struct snd_usb_substream *subs; |
2175 | snd_pcm_t *pcm; | 2173 | struct snd_pcm *pcm; |
2176 | int err; | 2174 | int err; |
2177 | 2175 | ||
2178 | list_for_each(p, &chip->pcm_list) { | 2176 | list_for_each(p, &chip->pcm_list) { |
2179 | as = list_entry(p, snd_usb_stream_t, list); | 2177 | as = list_entry(p, struct snd_usb_stream, list); |
2180 | if (as->fmt_type != fp->fmt_type) | 2178 | if (as->fmt_type != fp->fmt_type) |
2181 | continue; | 2179 | continue; |
2182 | subs = &as->substream[stream]; | 2180 | subs = &as->substream[stream]; |
@@ -2191,7 +2189,7 @@ static int add_audio_endpoint(snd_usb_audio_t *chip, int stream, struct audiofor | |||
2191 | } | 2189 | } |
2192 | /* look for an empty stream */ | 2190 | /* look for an empty stream */ |
2193 | list_for_each(p, &chip->pcm_list) { | 2191 | list_for_each(p, &chip->pcm_list) { |
2194 | as = list_entry(p, snd_usb_stream_t, list); | 2192 | as = list_entry(p, struct snd_usb_stream, list); |
2195 | if (as->fmt_type != fp->fmt_type) | 2193 | if (as->fmt_type != fp->fmt_type) |
2196 | continue; | 2194 | continue; |
2197 | subs = &as->substream[stream]; | 2195 | subs = &as->substream[stream]; |
@@ -2243,7 +2241,7 @@ static int add_audio_endpoint(snd_usb_audio_t *chip, int stream, struct audiofor | |||
2243 | /* | 2241 | /* |
2244 | * check if the device uses big-endian samples | 2242 | * check if the device uses big-endian samples |
2245 | */ | 2243 | */ |
2246 | static int is_big_endian_format(snd_usb_audio_t *chip, struct audioformat *fp) | 2244 | static int is_big_endian_format(struct snd_usb_audio *chip, struct audioformat *fp) |
2247 | { | 2245 | { |
2248 | switch (chip->usb_id) { | 2246 | switch (chip->usb_id) { |
2249 | case USB_ID(0x0763, 0x2001): /* M-Audio Quattro: captured data only */ | 2247 | case USB_ID(0x0763, 0x2001): /* M-Audio Quattro: captured data only */ |
@@ -2265,7 +2263,7 @@ static int is_big_endian_format(snd_usb_audio_t *chip, struct audioformat *fp) | |||
2265 | * @format: the format tag (wFormatTag) | 2263 | * @format: the format tag (wFormatTag) |
2266 | * @fmt: the format type descriptor | 2264 | * @fmt: the format type descriptor |
2267 | */ | 2265 | */ |
2268 | static int parse_audio_format_i_type(snd_usb_audio_t *chip, struct audioformat *fp, | 2266 | static int parse_audio_format_i_type(struct snd_usb_audio *chip, struct audioformat *fp, |
2269 | int format, unsigned char *fmt) | 2267 | int format, unsigned char *fmt) |
2270 | { | 2268 | { |
2271 | int pcm_format; | 2269 | int pcm_format; |
@@ -2348,7 +2346,7 @@ static int parse_audio_format_i_type(snd_usb_audio_t *chip, struct audioformat * | |||
2348 | * @offset: the start offset of descriptor pointing the rate type | 2346 | * @offset: the start offset of descriptor pointing the rate type |
2349 | * (7 for type I and II, 8 for type II) | 2347 | * (7 for type I and II, 8 for type II) |
2350 | */ | 2348 | */ |
2351 | static int parse_audio_format_rates(snd_usb_audio_t *chip, struct audioformat *fp, | 2349 | static int parse_audio_format_rates(struct snd_usb_audio *chip, struct audioformat *fp, |
2352 | unsigned char *fmt, int offset) | 2350 | unsigned char *fmt, int offset) |
2353 | { | 2351 | { |
2354 | int nr_rates = fmt[offset]; | 2352 | int nr_rates = fmt[offset]; |
@@ -2401,7 +2399,7 @@ static int parse_audio_format_rates(snd_usb_audio_t *chip, struct audioformat *f | |||
2401 | /* | 2399 | /* |
2402 | * parse the format type I and III descriptors | 2400 | * parse the format type I and III descriptors |
2403 | */ | 2401 | */ |
2404 | static int parse_audio_format_i(snd_usb_audio_t *chip, struct audioformat *fp, | 2402 | static int parse_audio_format_i(struct snd_usb_audio *chip, struct audioformat *fp, |
2405 | int format, unsigned char *fmt) | 2403 | int format, unsigned char *fmt) |
2406 | { | 2404 | { |
2407 | int pcm_format; | 2405 | int pcm_format; |
@@ -2430,7 +2428,7 @@ static int parse_audio_format_i(snd_usb_audio_t *chip, struct audioformat *fp, | |||
2430 | /* | 2428 | /* |
2431 | * prase the format type II descriptor | 2429 | * prase the format type II descriptor |
2432 | */ | 2430 | */ |
2433 | static int parse_audio_format_ii(snd_usb_audio_t *chip, struct audioformat *fp, | 2431 | static int parse_audio_format_ii(struct snd_usb_audio *chip, struct audioformat *fp, |
2434 | int format, unsigned char *fmt) | 2432 | int format, unsigned char *fmt) |
2435 | { | 2433 | { |
2436 | int brate, framesize; | 2434 | int brate, framesize; |
@@ -2457,7 +2455,7 @@ static int parse_audio_format_ii(snd_usb_audio_t *chip, struct audioformat *fp, | |||
2457 | return parse_audio_format_rates(chip, fp, fmt, 8); /* fmt[8..] sample rates */ | 2455 | return parse_audio_format_rates(chip, fp, fmt, 8); /* fmt[8..] sample rates */ |
2458 | } | 2456 | } |
2459 | 2457 | ||
2460 | static int parse_audio_format(snd_usb_audio_t *chip, struct audioformat *fp, | 2458 | static int parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp, |
2461 | int format, unsigned char *fmt, int stream) | 2459 | int format, unsigned char *fmt, int stream) |
2462 | { | 2460 | { |
2463 | int err; | 2461 | int err; |
@@ -2494,7 +2492,7 @@ static int parse_audio_format(snd_usb_audio_t *chip, struct audioformat *fp, | |||
2494 | return 0; | 2492 | return 0; |
2495 | } | 2493 | } |
2496 | 2494 | ||
2497 | static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no) | 2495 | static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) |
2498 | { | 2496 | { |
2499 | struct usb_device *dev; | 2497 | struct usb_device *dev; |
2500 | struct usb_interface *iface; | 2498 | struct usb_interface *iface; |
@@ -2645,10 +2643,10 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no) | |||
2645 | static void snd_usb_stream_disconnect(struct list_head *head) | 2643 | static void snd_usb_stream_disconnect(struct list_head *head) |
2646 | { | 2644 | { |
2647 | int idx; | 2645 | int idx; |
2648 | snd_usb_stream_t *as; | 2646 | struct snd_usb_stream *as; |
2649 | snd_usb_substream_t *subs; | 2647 | struct snd_usb_substream *subs; |
2650 | 2648 | ||
2651 | as = list_entry(head, snd_usb_stream_t, list); | 2649 | as = list_entry(head, struct snd_usb_stream, list); |
2652 | for (idx = 0; idx < 2; idx++) { | 2650 | for (idx = 0; idx < 2; idx++) { |
2653 | subs = &as->substream[idx]; | 2651 | subs = &as->substream[idx]; |
2654 | if (!subs->num_formats) | 2652 | if (!subs->num_formats) |
@@ -2661,7 +2659,7 @@ static void snd_usb_stream_disconnect(struct list_head *head) | |||
2661 | /* | 2659 | /* |
2662 | * parse audio control descriptor and create pcm/midi streams | 2660 | * parse audio control descriptor and create pcm/midi streams |
2663 | */ | 2661 | */ |
2664 | static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif) | 2662 | static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) |
2665 | { | 2663 | { |
2666 | struct usb_device *dev = chip->dev; | 2664 | struct usb_device *dev = chip->dev; |
2667 | struct usb_host_interface *host_iface; | 2665 | struct usb_host_interface *host_iface; |
@@ -2728,9 +2726,9 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif) | |||
2728 | /* | 2726 | /* |
2729 | * create a stream for an endpoint/altsetting without proper descriptors | 2727 | * create a stream for an endpoint/altsetting without proper descriptors |
2730 | */ | 2728 | */ |
2731 | static int create_fixed_stream_quirk(snd_usb_audio_t *chip, | 2729 | static int create_fixed_stream_quirk(struct snd_usb_audio *chip, |
2732 | struct usb_interface *iface, | 2730 | struct usb_interface *iface, |
2733 | const snd_usb_audio_quirk_t *quirk) | 2731 | const struct snd_usb_audio_quirk *quirk) |
2734 | { | 2732 | { |
2735 | struct audioformat *fp; | 2733 | struct audioformat *fp; |
2736 | struct usb_host_interface *alts; | 2734 | struct usb_host_interface *alts; |
@@ -2777,9 +2775,9 @@ static int create_fixed_stream_quirk(snd_usb_audio_t *chip, | |||
2777 | /* | 2775 | /* |
2778 | * create a stream for an interface with proper descriptors | 2776 | * create a stream for an interface with proper descriptors |
2779 | */ | 2777 | */ |
2780 | static int create_standard_audio_quirk(snd_usb_audio_t *chip, | 2778 | static int create_standard_audio_quirk(struct snd_usb_audio *chip, |
2781 | struct usb_interface *iface, | 2779 | struct usb_interface *iface, |
2782 | const snd_usb_audio_quirk_t *quirk) | 2780 | const struct snd_usb_audio_quirk *quirk) |
2783 | { | 2781 | { |
2784 | struct usb_host_interface *alts; | 2782 | struct usb_host_interface *alts; |
2785 | struct usb_interface_descriptor *altsd; | 2783 | struct usb_interface_descriptor *altsd; |
@@ -2802,9 +2800,9 @@ static int create_standard_audio_quirk(snd_usb_audio_t *chip, | |||
2802 | * Create a stream for an Edirol UA-700/UA-25 interface. The only way | 2800 | * Create a stream for an Edirol UA-700/UA-25 interface. The only way |
2803 | * to detect the sample rate is by looking at wMaxPacketSize. | 2801 | * to detect the sample rate is by looking at wMaxPacketSize. |
2804 | */ | 2802 | */ |
2805 | static int create_ua700_ua25_quirk(snd_usb_audio_t *chip, | 2803 | static int create_ua700_ua25_quirk(struct snd_usb_audio *chip, |
2806 | struct usb_interface *iface, | 2804 | struct usb_interface *iface, |
2807 | const snd_usb_audio_quirk_t *quirk) | 2805 | const struct snd_usb_audio_quirk *quirk) |
2808 | { | 2806 | { |
2809 | static const struct audioformat ua_format = { | 2807 | static const struct audioformat ua_format = { |
2810 | .format = SNDRV_PCM_FORMAT_S24_3LE, | 2808 | .format = SNDRV_PCM_FORMAT_S24_3LE, |
@@ -2826,19 +2824,19 @@ static int create_ua700_ua25_quirk(snd_usb_audio_t *chip, | |||
2826 | altsd = get_iface_desc(alts); | 2824 | altsd = get_iface_desc(alts); |
2827 | 2825 | ||
2828 | if (altsd->bNumEndpoints == 2) { | 2826 | if (altsd->bNumEndpoints == 2) { |
2829 | static const snd_usb_midi_endpoint_info_t ua700_ep = { | 2827 | static const struct snd_usb_midi_endpoint_info ua700_ep = { |
2830 | .out_cables = 0x0003, | 2828 | .out_cables = 0x0003, |
2831 | .in_cables = 0x0003 | 2829 | .in_cables = 0x0003 |
2832 | }; | 2830 | }; |
2833 | static const snd_usb_audio_quirk_t ua700_quirk = { | 2831 | static const struct snd_usb_audio_quirk ua700_quirk = { |
2834 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 2832 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
2835 | .data = &ua700_ep | 2833 | .data = &ua700_ep |
2836 | }; | 2834 | }; |
2837 | static const snd_usb_midi_endpoint_info_t ua25_ep = { | 2835 | static const struct snd_usb_midi_endpoint_info ua25_ep = { |
2838 | .out_cables = 0x0001, | 2836 | .out_cables = 0x0001, |
2839 | .in_cables = 0x0001 | 2837 | .in_cables = 0x0001 |
2840 | }; | 2838 | }; |
2841 | static const snd_usb_audio_quirk_t ua25_quirk = { | 2839 | static const struct snd_usb_audio_quirk ua25_quirk = { |
2842 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 2840 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
2843 | .data = &ua25_ep | 2841 | .data = &ua25_ep |
2844 | }; | 2842 | }; |
@@ -2895,9 +2893,9 @@ static int create_ua700_ua25_quirk(snd_usb_audio_t *chip, | |||
2895 | /* | 2893 | /* |
2896 | * Create a stream for an Edirol UA-1000 interface. | 2894 | * Create a stream for an Edirol UA-1000 interface. |
2897 | */ | 2895 | */ |
2898 | static int create_ua1000_quirk(snd_usb_audio_t *chip, | 2896 | static int create_ua1000_quirk(struct snd_usb_audio *chip, |
2899 | struct usb_interface *iface, | 2897 | struct usb_interface *iface, |
2900 | const snd_usb_audio_quirk_t *quirk) | 2898 | const struct snd_usb_audio_quirk *quirk) |
2901 | { | 2899 | { |
2902 | static const struct audioformat ua1000_format = { | 2900 | static const struct audioformat ua1000_format = { |
2903 | .format = SNDRV_PCM_FORMAT_S32_LE, | 2901 | .format = SNDRV_PCM_FORMAT_S32_LE, |
@@ -2944,16 +2942,16 @@ static int create_ua1000_quirk(snd_usb_audio_t *chip, | |||
2944 | return 0; | 2942 | return 0; |
2945 | } | 2943 | } |
2946 | 2944 | ||
2947 | static int snd_usb_create_quirk(snd_usb_audio_t *chip, | 2945 | static int snd_usb_create_quirk(struct snd_usb_audio *chip, |
2948 | struct usb_interface *iface, | 2946 | struct usb_interface *iface, |
2949 | const snd_usb_audio_quirk_t *quirk); | 2947 | const struct snd_usb_audio_quirk *quirk); |
2950 | 2948 | ||
2951 | /* | 2949 | /* |
2952 | * handle the quirks for the contained interfaces | 2950 | * handle the quirks for the contained interfaces |
2953 | */ | 2951 | */ |
2954 | static int create_composite_quirk(snd_usb_audio_t *chip, | 2952 | static int create_composite_quirk(struct snd_usb_audio *chip, |
2955 | struct usb_interface *iface, | 2953 | struct usb_interface *iface, |
2956 | const snd_usb_audio_quirk_t *quirk) | 2954 | const struct snd_usb_audio_quirk *quirk) |
2957 | { | 2955 | { |
2958 | int probed_ifnum = get_iface_desc(iface->altsetting)->bInterfaceNumber; | 2956 | int probed_ifnum = get_iface_desc(iface->altsetting)->bInterfaceNumber; |
2959 | int err; | 2957 | int err; |
@@ -2974,9 +2972,9 @@ static int create_composite_quirk(snd_usb_audio_t *chip, | |||
2974 | return 0; | 2972 | return 0; |
2975 | } | 2973 | } |
2976 | 2974 | ||
2977 | static int ignore_interface_quirk(snd_usb_audio_t *chip, | 2975 | static int ignore_interface_quirk(struct snd_usb_audio *chip, |
2978 | struct usb_interface *iface, | 2976 | struct usb_interface *iface, |
2979 | const snd_usb_audio_quirk_t *quirk) | 2977 | const struct snd_usb_audio_quirk *quirk) |
2980 | { | 2978 | { |
2981 | return 0; | 2979 | return 0; |
2982 | } | 2980 | } |
@@ -3039,12 +3037,12 @@ static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev) | |||
3039 | * after this. | 3037 | * after this. |
3040 | * returns a negative value at error. | 3038 | * returns a negative value at error. |
3041 | */ | 3039 | */ |
3042 | static int snd_usb_create_quirk(snd_usb_audio_t *chip, | 3040 | static int snd_usb_create_quirk(struct snd_usb_audio *chip, |
3043 | struct usb_interface *iface, | 3041 | struct usb_interface *iface, |
3044 | const snd_usb_audio_quirk_t *quirk) | 3042 | const struct snd_usb_audio_quirk *quirk) |
3045 | { | 3043 | { |
3046 | typedef int (*quirk_func_t)(snd_usb_audio_t *, struct usb_interface *, | 3044 | typedef int (*quirk_func_t)(struct snd_usb_audio *, struct usb_interface *, |
3047 | const snd_usb_audio_quirk_t *); | 3045 | const struct snd_usb_audio_quirk *); |
3048 | static const quirk_func_t quirk_funcs[] = { | 3046 | static const quirk_func_t quirk_funcs[] = { |
3049 | [QUIRK_IGNORE_INTERFACE] = ignore_interface_quirk, | 3047 | [QUIRK_IGNORE_INTERFACE] = ignore_interface_quirk, |
3050 | [QUIRK_COMPOSITE] = create_composite_quirk, | 3048 | [QUIRK_COMPOSITE] = create_composite_quirk, |
@@ -3074,25 +3072,25 @@ static int snd_usb_create_quirk(snd_usb_audio_t *chip, | |||
3074 | /* | 3072 | /* |
3075 | * common proc files to show the usb device info | 3073 | * common proc files to show the usb device info |
3076 | */ | 3074 | */ |
3077 | static void proc_audio_usbbus_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) | 3075 | static void proc_audio_usbbus_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
3078 | { | 3076 | { |
3079 | snd_usb_audio_t *chip = entry->private_data; | 3077 | struct snd_usb_audio *chip = entry->private_data; |
3080 | if (! chip->shutdown) | 3078 | if (! chip->shutdown) |
3081 | snd_iprintf(buffer, "%03d/%03d\n", chip->dev->bus->busnum, chip->dev->devnum); | 3079 | snd_iprintf(buffer, "%03d/%03d\n", chip->dev->bus->busnum, chip->dev->devnum); |
3082 | } | 3080 | } |
3083 | 3081 | ||
3084 | static void proc_audio_usbid_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) | 3082 | static void proc_audio_usbid_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
3085 | { | 3083 | { |
3086 | snd_usb_audio_t *chip = entry->private_data; | 3084 | struct snd_usb_audio *chip = entry->private_data; |
3087 | if (! chip->shutdown) | 3085 | if (! chip->shutdown) |
3088 | snd_iprintf(buffer, "%04x:%04x\n", | 3086 | snd_iprintf(buffer, "%04x:%04x\n", |
3089 | USB_ID_VENDOR(chip->usb_id), | 3087 | USB_ID_VENDOR(chip->usb_id), |
3090 | USB_ID_PRODUCT(chip->usb_id)); | 3088 | USB_ID_PRODUCT(chip->usb_id)); |
3091 | } | 3089 | } |
3092 | 3090 | ||
3093 | static void snd_usb_audio_create_proc(snd_usb_audio_t *chip) | 3091 | static void snd_usb_audio_create_proc(struct snd_usb_audio *chip) |
3094 | { | 3092 | { |
3095 | snd_info_entry_t *entry; | 3093 | struct snd_info_entry *entry; |
3096 | if (! snd_card_proc_new(chip->card, "usbbus", &entry)) | 3094 | if (! snd_card_proc_new(chip->card, "usbbus", &entry)) |
3097 | snd_info_set_text_ops(entry, chip, 1024, proc_audio_usbbus_read); | 3095 | snd_info_set_text_ops(entry, chip, 1024, proc_audio_usbbus_read); |
3098 | if (! snd_card_proc_new(chip->card, "usbid", &entry)) | 3096 | if (! snd_card_proc_new(chip->card, "usbid", &entry)) |
@@ -3106,15 +3104,15 @@ static void snd_usb_audio_create_proc(snd_usb_audio_t *chip) | |||
3106 | * | 3104 | * |
3107 | */ | 3105 | */ |
3108 | 3106 | ||
3109 | static int snd_usb_audio_free(snd_usb_audio_t *chip) | 3107 | static int snd_usb_audio_free(struct snd_usb_audio *chip) |
3110 | { | 3108 | { |
3111 | kfree(chip); | 3109 | kfree(chip); |
3112 | return 0; | 3110 | return 0; |
3113 | } | 3111 | } |
3114 | 3112 | ||
3115 | static int snd_usb_audio_dev_free(snd_device_t *device) | 3113 | static int snd_usb_audio_dev_free(struct snd_device *device) |
3116 | { | 3114 | { |
3117 | snd_usb_audio_t *chip = device->device_data; | 3115 | struct snd_usb_audio *chip = device->device_data; |
3118 | return snd_usb_audio_free(chip); | 3116 | return snd_usb_audio_free(chip); |
3119 | } | 3117 | } |
3120 | 3118 | ||
@@ -3123,14 +3121,14 @@ static int snd_usb_audio_dev_free(snd_device_t *device) | |||
3123 | * create a chip instance and set its names. | 3121 | * create a chip instance and set its names. |
3124 | */ | 3122 | */ |
3125 | static int snd_usb_audio_create(struct usb_device *dev, int idx, | 3123 | static int snd_usb_audio_create(struct usb_device *dev, int idx, |
3126 | const snd_usb_audio_quirk_t *quirk, | 3124 | const struct snd_usb_audio_quirk *quirk, |
3127 | snd_usb_audio_t **rchip) | 3125 | struct snd_usb_audio **rchip) |
3128 | { | 3126 | { |
3129 | snd_card_t *card; | 3127 | struct snd_card *card; |
3130 | snd_usb_audio_t *chip; | 3128 | struct snd_usb_audio *chip; |
3131 | int err, len; | 3129 | int err, len; |
3132 | char component[14]; | 3130 | char component[14]; |
3133 | static snd_device_ops_t ops = { | 3131 | static struct snd_device_ops ops = { |
3134 | .dev_free = snd_usb_audio_dev_free, | 3132 | .dev_free = snd_usb_audio_dev_free, |
3135 | }; | 3133 | }; |
3136 | 3134 | ||
@@ -3234,9 +3232,9 @@ static void *snd_usb_audio_probe(struct usb_device *dev, | |||
3234 | struct usb_interface *intf, | 3232 | struct usb_interface *intf, |
3235 | const struct usb_device_id *usb_id) | 3233 | const struct usb_device_id *usb_id) |
3236 | { | 3234 | { |
3237 | const snd_usb_audio_quirk_t *quirk = (const snd_usb_audio_quirk_t *)usb_id->driver_info; | 3235 | const struct snd_usb_audio_quirk *quirk = (const struct snd_usb_audio_quirk *)usb_id->driver_info; |
3238 | int i, err; | 3236 | int i, err; |
3239 | snd_usb_audio_t *chip; | 3237 | struct snd_usb_audio *chip; |
3240 | struct usb_host_interface *alts; | 3238 | struct usb_host_interface *alts; |
3241 | int ifnum; | 3239 | int ifnum; |
3242 | u32 id; | 3240 | u32 id; |
@@ -3337,8 +3335,8 @@ static void *snd_usb_audio_probe(struct usb_device *dev, | |||
3337 | */ | 3335 | */ |
3338 | static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) | 3336 | static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) |
3339 | { | 3337 | { |
3340 | snd_usb_audio_t *chip; | 3338 | struct snd_usb_audio *chip; |
3341 | snd_card_t *card; | 3339 | struct snd_card *card; |
3342 | struct list_head *p; | 3340 | struct list_head *p; |
3343 | 3341 | ||
3344 | if (ptr == (void *)-1L) | 3342 | if (ptr == (void *)-1L) |
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index b5802022bb19..ecd724bfe5a5 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -126,12 +126,10 @@ | |||
126 | /* | 126 | /* |
127 | */ | 127 | */ |
128 | 128 | ||
129 | typedef struct snd_usb_audio snd_usb_audio_t; | ||
130 | |||
131 | struct snd_usb_audio { | 129 | struct snd_usb_audio { |
132 | int index; | 130 | int index; |
133 | struct usb_device *dev; | 131 | struct usb_device *dev; |
134 | snd_card_t *card; | 132 | struct snd_card *card; |
135 | u32 usb_id; | 133 | u32 usb_id; |
136 | int shutdown; | 134 | int shutdown; |
137 | int num_interfaces; | 135 | int num_interfaces; |
@@ -172,9 +170,6 @@ enum quirk_type { | |||
172 | QUIRK_TYPE_COUNT | 170 | QUIRK_TYPE_COUNT |
173 | }; | 171 | }; |
174 | 172 | ||
175 | typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t; | ||
176 | typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t; | ||
177 | |||
178 | struct snd_usb_audio_quirk { | 173 | struct snd_usb_audio_quirk { |
179 | const char *vendor_name; | 174 | const char *vendor_name; |
180 | const char *product_name; | 175 | const char *product_name; |
@@ -228,12 +223,15 @@ unsigned int snd_usb_combine_bytes(unsigned char *bytes, int size); | |||
228 | void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype); | 223 | void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype); |
229 | void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsubtype); | 224 | void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsubtype); |
230 | 225 | ||
231 | int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size, int timeout); | 226 | int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, |
227 | __u8 request, __u8 requesttype, __u16 value, __u16 index, | ||
228 | void *data, __u16 size, int timeout); | ||
232 | 229 | ||
233 | int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif); | 230 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif); |
234 | void snd_usb_mixer_disconnect(struct list_head *p); | 231 | void snd_usb_mixer_disconnect(struct list_head *p); |
235 | 232 | ||
236 | int snd_usb_create_midi_interface(snd_usb_audio_t *chip, struct usb_interface *iface, const snd_usb_audio_quirk_t *quirk); | 233 | int snd_usb_create_midi_interface(struct snd_usb_audio *chip, struct usb_interface *iface, |
234 | const struct snd_usb_audio_quirk *quirk); | ||
237 | void snd_usbmidi_input_stop(struct list_head* p); | 235 | void snd_usbmidi_input_stop(struct list_head* p); |
238 | void snd_usbmidi_input_start(struct list_head* p); | 236 | void snd_usbmidi_input_start(struct list_head* p); |
239 | void snd_usbmidi_disconnect(struct list_head *p); | 237 | void snd_usbmidi_disconnect(struct list_head *p); |
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index f8aa662562a0..f15b021c3ce8 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c | |||
@@ -84,39 +84,36 @@ struct usb_ms_endpoint_descriptor { | |||
84 | __u8 baAssocJackID[0]; | 84 | __u8 baAssocJackID[0]; |
85 | } __attribute__ ((packed)); | 85 | } __attribute__ ((packed)); |
86 | 86 | ||
87 | typedef struct snd_usb_midi snd_usb_midi_t; | 87 | struct snd_usb_midi_in_endpoint; |
88 | typedef struct snd_usb_midi_endpoint snd_usb_midi_endpoint_t; | 88 | struct snd_usb_midi_out_endpoint; |
89 | typedef struct snd_usb_midi_out_endpoint snd_usb_midi_out_endpoint_t; | 89 | struct snd_usb_midi_endpoint; |
90 | typedef struct snd_usb_midi_in_endpoint snd_usb_midi_in_endpoint_t; | ||
91 | typedef struct usbmidi_out_port usbmidi_out_port_t; | ||
92 | typedef struct usbmidi_in_port usbmidi_in_port_t; | ||
93 | 90 | ||
94 | struct usb_protocol_ops { | 91 | struct usb_protocol_ops { |
95 | void (*input)(snd_usb_midi_in_endpoint_t*, uint8_t*, int); | 92 | void (*input)(struct snd_usb_midi_in_endpoint*, uint8_t*, int); |
96 | void (*output)(snd_usb_midi_out_endpoint_t*); | 93 | void (*output)(struct snd_usb_midi_out_endpoint*); |
97 | void (*output_packet)(struct urb*, uint8_t, uint8_t, uint8_t, uint8_t); | 94 | void (*output_packet)(struct urb*, uint8_t, uint8_t, uint8_t, uint8_t); |
98 | void (*init_out_endpoint)(snd_usb_midi_out_endpoint_t*); | 95 | void (*init_out_endpoint)(struct snd_usb_midi_out_endpoint*); |
99 | void (*finish_out_endpoint)(snd_usb_midi_out_endpoint_t*); | 96 | void (*finish_out_endpoint)(struct snd_usb_midi_out_endpoint*); |
100 | }; | 97 | }; |
101 | 98 | ||
102 | struct snd_usb_midi { | 99 | struct snd_usb_midi { |
103 | snd_usb_audio_t *chip; | 100 | struct snd_usb_audio *chip; |
104 | struct usb_interface *iface; | 101 | struct usb_interface *iface; |
105 | const snd_usb_audio_quirk_t *quirk; | 102 | const struct snd_usb_audio_quirk *quirk; |
106 | snd_rawmidi_t* rmidi; | 103 | struct snd_rawmidi *rmidi; |
107 | struct usb_protocol_ops* usb_protocol_ops; | 104 | struct usb_protocol_ops* usb_protocol_ops; |
108 | struct list_head list; | 105 | struct list_head list; |
109 | struct timer_list error_timer; | 106 | struct timer_list error_timer; |
110 | 107 | ||
111 | struct snd_usb_midi_endpoint { | 108 | struct snd_usb_midi_endpoint { |
112 | snd_usb_midi_out_endpoint_t *out; | 109 | struct snd_usb_midi_out_endpoint *out; |
113 | snd_usb_midi_in_endpoint_t *in; | 110 | struct snd_usb_midi_in_endpoint *in; |
114 | } endpoints[MIDI_MAX_ENDPOINTS]; | 111 | } endpoints[MIDI_MAX_ENDPOINTS]; |
115 | unsigned long input_triggered; | 112 | unsigned long input_triggered; |
116 | }; | 113 | }; |
117 | 114 | ||
118 | struct snd_usb_midi_out_endpoint { | 115 | struct snd_usb_midi_out_endpoint { |
119 | snd_usb_midi_t* umidi; | 116 | struct snd_usb_midi* umidi; |
120 | struct urb* urb; | 117 | struct urb* urb; |
121 | int urb_active; | 118 | int urb_active; |
122 | int max_transfer; /* size of urb buffer */ | 119 | int max_transfer; /* size of urb buffer */ |
@@ -125,8 +122,8 @@ struct snd_usb_midi_out_endpoint { | |||
125 | spinlock_t buffer_lock; | 122 | spinlock_t buffer_lock; |
126 | 123 | ||
127 | struct usbmidi_out_port { | 124 | struct usbmidi_out_port { |
128 | snd_usb_midi_out_endpoint_t* ep; | 125 | struct snd_usb_midi_out_endpoint* ep; |
129 | snd_rawmidi_substream_t* substream; | 126 | struct snd_rawmidi_substream *substream; |
130 | int active; | 127 | int active; |
131 | uint8_t cable; /* cable number << 4 */ | 128 | uint8_t cable; /* cable number << 4 */ |
132 | uint8_t state; | 129 | uint8_t state; |
@@ -143,17 +140,17 @@ struct snd_usb_midi_out_endpoint { | |||
143 | }; | 140 | }; |
144 | 141 | ||
145 | struct snd_usb_midi_in_endpoint { | 142 | struct snd_usb_midi_in_endpoint { |
146 | snd_usb_midi_t* umidi; | 143 | struct snd_usb_midi* umidi; |
147 | struct urb* urb; | 144 | struct urb* urb; |
148 | struct usbmidi_in_port { | 145 | struct usbmidi_in_port { |
149 | snd_rawmidi_substream_t* substream; | 146 | struct snd_rawmidi_substream *substream; |
150 | } ports[0x10]; | 147 | } ports[0x10]; |
151 | u8 seen_f5; | 148 | u8 seen_f5; |
152 | u8 error_resubmit; | 149 | u8 error_resubmit; |
153 | int current_port; | 150 | int current_port; |
154 | }; | 151 | }; |
155 | 152 | ||
156 | static void snd_usbmidi_do_output(snd_usb_midi_out_endpoint_t* ep); | 153 | static void snd_usbmidi_do_output(struct snd_usb_midi_out_endpoint* ep); |
157 | 154 | ||
158 | static const uint8_t snd_usbmidi_cin_length[] = { | 155 | static const uint8_t snd_usbmidi_cin_length[] = { |
159 | 0, 0, 2, 3, 3, 1, 2, 3, 3, 3, 3, 3, 2, 2, 3, 1 | 156 | 0, 0, 2, 3, 3, 1, 2, 3, 3, 3, 3, 3, 2, 2, 3, 1 |
@@ -196,10 +193,10 @@ static int snd_usbmidi_urb_error(int status) | |||
196 | /* | 193 | /* |
197 | * Receives a chunk of MIDI data. | 194 | * Receives a chunk of MIDI data. |
198 | */ | 195 | */ |
199 | static void snd_usbmidi_input_data(snd_usb_midi_in_endpoint_t* ep, int portidx, | 196 | static void snd_usbmidi_input_data(struct snd_usb_midi_in_endpoint* ep, int portidx, |
200 | uint8_t* data, int length) | 197 | uint8_t* data, int length) |
201 | { | 198 | { |
202 | usbmidi_in_port_t* port = &ep->ports[portidx]; | 199 | struct usbmidi_in_port* port = &ep->ports[portidx]; |
203 | 200 | ||
204 | if (!port->substream) { | 201 | if (!port->substream) { |
205 | snd_printd("unexpected port %d!\n", portidx); | 202 | snd_printd("unexpected port %d!\n", portidx); |
@@ -227,7 +224,7 @@ static void dump_urb(const char *type, const u8 *data, int length) | |||
227 | */ | 224 | */ |
228 | static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs) | 225 | static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs) |
229 | { | 226 | { |
230 | snd_usb_midi_in_endpoint_t* ep = urb->context; | 227 | struct snd_usb_midi_in_endpoint* ep = urb->context; |
231 | 228 | ||
232 | if (urb->status == 0) { | 229 | if (urb->status == 0) { |
233 | dump_urb("received", urb->transfer_buffer, urb->actual_length); | 230 | dump_urb("received", urb->transfer_buffer, urb->actual_length); |
@@ -251,7 +248,7 @@ static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs) | |||
251 | 248 | ||
252 | static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs) | 249 | static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs) |
253 | { | 250 | { |
254 | snd_usb_midi_out_endpoint_t* ep = urb->context; | 251 | struct snd_usb_midi_out_endpoint* ep = urb->context; |
255 | 252 | ||
256 | spin_lock(&ep->buffer_lock); | 253 | spin_lock(&ep->buffer_lock); |
257 | ep->urb_active = 0; | 254 | ep->urb_active = 0; |
@@ -272,7 +269,7 @@ static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs) | |||
272 | * This is called when some data should be transferred to the device | 269 | * This is called when some data should be transferred to the device |
273 | * (from one or more substreams). | 270 | * (from one or more substreams). |
274 | */ | 271 | */ |
275 | static void snd_usbmidi_do_output(snd_usb_midi_out_endpoint_t* ep) | 272 | static void snd_usbmidi_do_output(struct snd_usb_midi_out_endpoint* ep) |
276 | { | 273 | { |
277 | struct urb* urb = ep->urb; | 274 | struct urb* urb = ep->urb; |
278 | unsigned long flags; | 275 | unsigned long flags; |
@@ -297,7 +294,7 @@ static void snd_usbmidi_do_output(snd_usb_midi_out_endpoint_t* ep) | |||
297 | 294 | ||
298 | static void snd_usbmidi_out_tasklet(unsigned long data) | 295 | static void snd_usbmidi_out_tasklet(unsigned long data) |
299 | { | 296 | { |
300 | snd_usb_midi_out_endpoint_t* ep = (snd_usb_midi_out_endpoint_t *) data; | 297 | struct snd_usb_midi_out_endpoint* ep = (struct snd_usb_midi_out_endpoint *) data; |
301 | 298 | ||
302 | snd_usbmidi_do_output(ep); | 299 | snd_usbmidi_do_output(ep); |
303 | } | 300 | } |
@@ -305,11 +302,11 @@ static void snd_usbmidi_out_tasklet(unsigned long data) | |||
305 | /* called after transfers had been interrupted due to some USB error */ | 302 | /* called after transfers had been interrupted due to some USB error */ |
306 | static void snd_usbmidi_error_timer(unsigned long data) | 303 | static void snd_usbmidi_error_timer(unsigned long data) |
307 | { | 304 | { |
308 | snd_usb_midi_t *umidi = (snd_usb_midi_t *)data; | 305 | struct snd_usb_midi *umidi = (struct snd_usb_midi *)data; |
309 | int i; | 306 | int i; |
310 | 307 | ||
311 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { | 308 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { |
312 | snd_usb_midi_in_endpoint_t *in = umidi->endpoints[i].in; | 309 | struct snd_usb_midi_in_endpoint *in = umidi->endpoints[i].in; |
313 | if (in && in->error_resubmit) { | 310 | if (in && in->error_resubmit) { |
314 | in->error_resubmit = 0; | 311 | in->error_resubmit = 0; |
315 | in->urb->dev = umidi->chip->dev; | 312 | in->urb->dev = umidi->chip->dev; |
@@ -321,7 +318,7 @@ static void snd_usbmidi_error_timer(unsigned long data) | |||
321 | } | 318 | } |
322 | 319 | ||
323 | /* helper function to send static data that may not DMA-able */ | 320 | /* helper function to send static data that may not DMA-able */ |
324 | static int send_bulk_static_data(snd_usb_midi_out_endpoint_t* ep, | 321 | static int send_bulk_static_data(struct snd_usb_midi_out_endpoint* ep, |
325 | const void *data, int len) | 322 | const void *data, int len) |
326 | { | 323 | { |
327 | int err; | 324 | int err; |
@@ -342,7 +339,7 @@ static int send_bulk_static_data(snd_usb_midi_out_endpoint_t* ep, | |||
342 | * fourth byte in each packet, and uses length instead of CIN. | 339 | * fourth byte in each packet, and uses length instead of CIN. |
343 | */ | 340 | */ |
344 | 341 | ||
345 | static void snd_usbmidi_standard_input(snd_usb_midi_in_endpoint_t* ep, | 342 | static void snd_usbmidi_standard_input(struct snd_usb_midi_in_endpoint* ep, |
346 | uint8_t* buffer, int buffer_length) | 343 | uint8_t* buffer, int buffer_length) |
347 | { | 344 | { |
348 | int i; | 345 | int i; |
@@ -355,7 +352,7 @@ static void snd_usbmidi_standard_input(snd_usb_midi_in_endpoint_t* ep, | |||
355 | } | 352 | } |
356 | } | 353 | } |
357 | 354 | ||
358 | static void snd_usbmidi_midiman_input(snd_usb_midi_in_endpoint_t* ep, | 355 | static void snd_usbmidi_midiman_input(struct snd_usb_midi_in_endpoint* ep, |
359 | uint8_t* buffer, int buffer_length) | 356 | uint8_t* buffer, int buffer_length) |
360 | { | 357 | { |
361 | int i; | 358 | int i; |
@@ -401,7 +398,7 @@ static void snd_usbmidi_output_midiman_packet(struct urb* urb, uint8_t p0, | |||
401 | /* | 398 | /* |
402 | * Converts MIDI commands to USB MIDI packets. | 399 | * Converts MIDI commands to USB MIDI packets. |
403 | */ | 400 | */ |
404 | static void snd_usbmidi_transmit_byte(usbmidi_out_port_t* port, | 401 | static void snd_usbmidi_transmit_byte(struct usbmidi_out_port* port, |
405 | uint8_t b, struct urb* urb) | 402 | uint8_t b, struct urb* urb) |
406 | { | 403 | { |
407 | uint8_t p0 = port->cable; | 404 | uint8_t p0 = port->cable; |
@@ -495,14 +492,14 @@ static void snd_usbmidi_transmit_byte(usbmidi_out_port_t* port, | |||
495 | } | 492 | } |
496 | } | 493 | } |
497 | 494 | ||
498 | static void snd_usbmidi_standard_output(snd_usb_midi_out_endpoint_t* ep) | 495 | static void snd_usbmidi_standard_output(struct snd_usb_midi_out_endpoint* ep) |
499 | { | 496 | { |
500 | struct urb* urb = ep->urb; | 497 | struct urb* urb = ep->urb; |
501 | int p; | 498 | int p; |
502 | 499 | ||
503 | /* FIXME: lower-numbered ports can starve higher-numbered ports */ | 500 | /* FIXME: lower-numbered ports can starve higher-numbered ports */ |
504 | for (p = 0; p < 0x10; ++p) { | 501 | for (p = 0; p < 0x10; ++p) { |
505 | usbmidi_out_port_t* port = &ep->ports[p]; | 502 | struct usbmidi_out_port* port = &ep->ports[p]; |
506 | if (!port->active) | 503 | if (!port->active) |
507 | continue; | 504 | continue; |
508 | while (urb->transfer_buffer_length + 3 < ep->max_transfer) { | 505 | while (urb->transfer_buffer_length + 3 < ep->max_transfer) { |
@@ -534,7 +531,7 @@ static struct usb_protocol_ops snd_usbmidi_midiman_ops = { | |||
534 | * at the third byte. | 531 | * at the third byte. |
535 | */ | 532 | */ |
536 | 533 | ||
537 | static void snd_usbmidi_novation_input(snd_usb_midi_in_endpoint_t* ep, | 534 | static void snd_usbmidi_novation_input(struct snd_usb_midi_in_endpoint* ep, |
538 | uint8_t* buffer, int buffer_length) | 535 | uint8_t* buffer, int buffer_length) |
539 | { | 536 | { |
540 | if (buffer_length < 2 || !buffer[0] || buffer_length < buffer[0] + 1) | 537 | if (buffer_length < 2 || !buffer[0] || buffer_length < buffer[0] + 1) |
@@ -542,7 +539,7 @@ static void snd_usbmidi_novation_input(snd_usb_midi_in_endpoint_t* ep, | |||
542 | snd_usbmidi_input_data(ep, 0, &buffer[2], buffer[0] - 1); | 539 | snd_usbmidi_input_data(ep, 0, &buffer[2], buffer[0] - 1); |
543 | } | 540 | } |
544 | 541 | ||
545 | static void snd_usbmidi_novation_output(snd_usb_midi_out_endpoint_t* ep) | 542 | static void snd_usbmidi_novation_output(struct snd_usb_midi_out_endpoint* ep) |
546 | { | 543 | { |
547 | uint8_t* transfer_buffer; | 544 | uint8_t* transfer_buffer; |
548 | int count; | 545 | int count; |
@@ -571,13 +568,13 @@ static struct usb_protocol_ops snd_usbmidi_novation_ops = { | |||
571 | * "raw" protocol: used by the MOTU FastLane. | 568 | * "raw" protocol: used by the MOTU FastLane. |
572 | */ | 569 | */ |
573 | 570 | ||
574 | static void snd_usbmidi_raw_input(snd_usb_midi_in_endpoint_t* ep, | 571 | static void snd_usbmidi_raw_input(struct snd_usb_midi_in_endpoint* ep, |
575 | uint8_t* buffer, int buffer_length) | 572 | uint8_t* buffer, int buffer_length) |
576 | { | 573 | { |
577 | snd_usbmidi_input_data(ep, 0, buffer, buffer_length); | 574 | snd_usbmidi_input_data(ep, 0, buffer, buffer_length); |
578 | } | 575 | } |
579 | 576 | ||
580 | static void snd_usbmidi_raw_output(snd_usb_midi_out_endpoint_t* ep) | 577 | static void snd_usbmidi_raw_output(struct snd_usb_midi_out_endpoint* ep) |
581 | { | 578 | { |
582 | int count; | 579 | int count; |
583 | 580 | ||
@@ -602,7 +599,7 @@ static struct usb_protocol_ops snd_usbmidi_raw_ops = { | |||
602 | * Emagic USB MIDI protocol: raw MIDI with "F5 xx" port switching. | 599 | * Emagic USB MIDI protocol: raw MIDI with "F5 xx" port switching. |
603 | */ | 600 | */ |
604 | 601 | ||
605 | static void snd_usbmidi_emagic_init_out(snd_usb_midi_out_endpoint_t* ep) | 602 | static void snd_usbmidi_emagic_init_out(struct snd_usb_midi_out_endpoint* ep) |
606 | { | 603 | { |
607 | static const u8 init_data[] = { | 604 | static const u8 init_data[] = { |
608 | /* initialization magic: "get version" */ | 605 | /* initialization magic: "get version" */ |
@@ -619,7 +616,7 @@ static void snd_usbmidi_emagic_init_out(snd_usb_midi_out_endpoint_t* ep) | |||
619 | send_bulk_static_data(ep, init_data, sizeof(init_data)); | 616 | send_bulk_static_data(ep, init_data, sizeof(init_data)); |
620 | } | 617 | } |
621 | 618 | ||
622 | static void snd_usbmidi_emagic_finish_out(snd_usb_midi_out_endpoint_t* ep) | 619 | static void snd_usbmidi_emagic_finish_out(struct snd_usb_midi_out_endpoint* ep) |
623 | { | 620 | { |
624 | static const u8 finish_data[] = { | 621 | static const u8 finish_data[] = { |
625 | /* switch to patch mode with last preset */ | 622 | /* switch to patch mode with last preset */ |
@@ -635,7 +632,7 @@ static void snd_usbmidi_emagic_finish_out(snd_usb_midi_out_endpoint_t* ep) | |||
635 | send_bulk_static_data(ep, finish_data, sizeof(finish_data)); | 632 | send_bulk_static_data(ep, finish_data, sizeof(finish_data)); |
636 | } | 633 | } |
637 | 634 | ||
638 | static void snd_usbmidi_emagic_input(snd_usb_midi_in_endpoint_t* ep, | 635 | static void snd_usbmidi_emagic_input(struct snd_usb_midi_in_endpoint* ep, |
639 | uint8_t* buffer, int buffer_length) | 636 | uint8_t* buffer, int buffer_length) |
640 | { | 637 | { |
641 | int i; | 638 | int i; |
@@ -679,7 +676,7 @@ static void snd_usbmidi_emagic_input(snd_usb_midi_in_endpoint_t* ep, | |||
679 | } | 676 | } |
680 | } | 677 | } |
681 | 678 | ||
682 | static void snd_usbmidi_emagic_output(snd_usb_midi_out_endpoint_t* ep) | 679 | static void snd_usbmidi_emagic_output(struct snd_usb_midi_out_endpoint* ep) |
683 | { | 680 | { |
684 | int port0 = ep->current_port; | 681 | int port0 = ep->current_port; |
685 | uint8_t* buf = ep->urb->transfer_buffer; | 682 | uint8_t* buf = ep->urb->transfer_buffer; |
@@ -689,7 +686,7 @@ static void snd_usbmidi_emagic_output(snd_usb_midi_out_endpoint_t* ep) | |||
689 | for (i = 0; i < 0x10; ++i) { | 686 | for (i = 0; i < 0x10; ++i) { |
690 | /* round-robin, starting at the last current port */ | 687 | /* round-robin, starting at the last current port */ |
691 | int portnum = (port0 + i) & 15; | 688 | int portnum = (port0 + i) & 15; |
692 | usbmidi_out_port_t* port = &ep->ports[portnum]; | 689 | struct usbmidi_out_port* port = &ep->ports[portnum]; |
693 | 690 | ||
694 | if (!port->active) | 691 | if (!port->active) |
695 | continue; | 692 | continue; |
@@ -733,10 +730,10 @@ static struct usb_protocol_ops snd_usbmidi_emagic_ops = { | |||
733 | }; | 730 | }; |
734 | 731 | ||
735 | 732 | ||
736 | static int snd_usbmidi_output_open(snd_rawmidi_substream_t* substream) | 733 | static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) |
737 | { | 734 | { |
738 | snd_usb_midi_t* umidi = substream->rmidi->private_data; | 735 | struct snd_usb_midi* umidi = substream->rmidi->private_data; |
739 | usbmidi_out_port_t* port = NULL; | 736 | struct usbmidi_out_port* port = NULL; |
740 | int i, j; | 737 | int i, j; |
741 | 738 | ||
742 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) | 739 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) |
@@ -755,14 +752,14 @@ static int snd_usbmidi_output_open(snd_rawmidi_substream_t* substream) | |||
755 | return 0; | 752 | return 0; |
756 | } | 753 | } |
757 | 754 | ||
758 | static int snd_usbmidi_output_close(snd_rawmidi_substream_t* substream) | 755 | static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) |
759 | { | 756 | { |
760 | return 0; | 757 | return 0; |
761 | } | 758 | } |
762 | 759 | ||
763 | static void snd_usbmidi_output_trigger(snd_rawmidi_substream_t* substream, int up) | 760 | static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream, int up) |
764 | { | 761 | { |
765 | usbmidi_out_port_t* port = (usbmidi_out_port_t*)substream->runtime->private_data; | 762 | struct usbmidi_out_port* port = (struct usbmidi_out_port*)substream->runtime->private_data; |
766 | 763 | ||
767 | port->active = up; | 764 | port->active = up; |
768 | if (up) { | 765 | if (up) { |
@@ -777,19 +774,19 @@ static void snd_usbmidi_output_trigger(snd_rawmidi_substream_t* substream, int u | |||
777 | } | 774 | } |
778 | } | 775 | } |
779 | 776 | ||
780 | static int snd_usbmidi_input_open(snd_rawmidi_substream_t* substream) | 777 | static int snd_usbmidi_input_open(struct snd_rawmidi_substream *substream) |
781 | { | 778 | { |
782 | return 0; | 779 | return 0; |
783 | } | 780 | } |
784 | 781 | ||
785 | static int snd_usbmidi_input_close(snd_rawmidi_substream_t* substream) | 782 | static int snd_usbmidi_input_close(struct snd_rawmidi_substream *substream) |
786 | { | 783 | { |
787 | return 0; | 784 | return 0; |
788 | } | 785 | } |
789 | 786 | ||
790 | static void snd_usbmidi_input_trigger(snd_rawmidi_substream_t* substream, int up) | 787 | static void snd_usbmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) |
791 | { | 788 | { |
792 | snd_usb_midi_t* umidi = substream->rmidi->private_data; | 789 | struct snd_usb_midi* umidi = substream->rmidi->private_data; |
793 | 790 | ||
794 | if (up) | 791 | if (up) |
795 | set_bit(substream->number, &umidi->input_triggered); | 792 | set_bit(substream->number, &umidi->input_triggered); |
@@ -797,13 +794,13 @@ static void snd_usbmidi_input_trigger(snd_rawmidi_substream_t* substream, int up | |||
797 | clear_bit(substream->number, &umidi->input_triggered); | 794 | clear_bit(substream->number, &umidi->input_triggered); |
798 | } | 795 | } |
799 | 796 | ||
800 | static snd_rawmidi_ops_t snd_usbmidi_output_ops = { | 797 | static struct snd_rawmidi_ops snd_usbmidi_output_ops = { |
801 | .open = snd_usbmidi_output_open, | 798 | .open = snd_usbmidi_output_open, |
802 | .close = snd_usbmidi_output_close, | 799 | .close = snd_usbmidi_output_close, |
803 | .trigger = snd_usbmidi_output_trigger, | 800 | .trigger = snd_usbmidi_output_trigger, |
804 | }; | 801 | }; |
805 | 802 | ||
806 | static snd_rawmidi_ops_t snd_usbmidi_input_ops = { | 803 | static struct snd_rawmidi_ops snd_usbmidi_input_ops = { |
807 | .open = snd_usbmidi_input_open, | 804 | .open = snd_usbmidi_input_open, |
808 | .close = snd_usbmidi_input_close, | 805 | .close = snd_usbmidi_input_close, |
809 | .trigger = snd_usbmidi_input_trigger | 806 | .trigger = snd_usbmidi_input_trigger |
@@ -813,7 +810,7 @@ static snd_rawmidi_ops_t snd_usbmidi_input_ops = { | |||
813 | * Frees an input endpoint. | 810 | * Frees an input endpoint. |
814 | * May be called when ep hasn't been initialized completely. | 811 | * May be called when ep hasn't been initialized completely. |
815 | */ | 812 | */ |
816 | static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep) | 813 | static void snd_usbmidi_in_endpoint_delete(struct snd_usb_midi_in_endpoint* ep) |
817 | { | 814 | { |
818 | if (ep->urb) { | 815 | if (ep->urb) { |
819 | usb_buffer_free(ep->umidi->chip->dev, | 816 | usb_buffer_free(ep->umidi->chip->dev, |
@@ -828,11 +825,11 @@ static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep) | |||
828 | /* | 825 | /* |
829 | * Creates an input endpoint. | 826 | * Creates an input endpoint. |
830 | */ | 827 | */ |
831 | static int snd_usbmidi_in_endpoint_create(snd_usb_midi_t* umidi, | 828 | static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi, |
832 | snd_usb_midi_endpoint_info_t* ep_info, | 829 | struct snd_usb_midi_endpoint_info* ep_info, |
833 | snd_usb_midi_endpoint_t* rep) | 830 | struct snd_usb_midi_endpoint* rep) |
834 | { | 831 | { |
835 | snd_usb_midi_in_endpoint_t* ep; | 832 | struct snd_usb_midi_in_endpoint* ep; |
836 | void* buffer; | 833 | void* buffer; |
837 | unsigned int pipe; | 834 | unsigned int pipe; |
838 | int length; | 835 | int length; |
@@ -885,7 +882,7 @@ static unsigned int snd_usbmidi_count_bits(unsigned int x) | |||
885 | * Frees an output endpoint. | 882 | * Frees an output endpoint. |
886 | * May be called when ep hasn't been initialized completely. | 883 | * May be called when ep hasn't been initialized completely. |
887 | */ | 884 | */ |
888 | static void snd_usbmidi_out_endpoint_delete(snd_usb_midi_out_endpoint_t* ep) | 885 | static void snd_usbmidi_out_endpoint_delete(struct snd_usb_midi_out_endpoint* ep) |
889 | { | 886 | { |
890 | if (ep->urb) { | 887 | if (ep->urb) { |
891 | usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, | 888 | usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, |
@@ -899,11 +896,11 @@ static void snd_usbmidi_out_endpoint_delete(snd_usb_midi_out_endpoint_t* ep) | |||
899 | /* | 896 | /* |
900 | * Creates an output endpoint, and initializes output ports. | 897 | * Creates an output endpoint, and initializes output ports. |
901 | */ | 898 | */ |
902 | static int snd_usbmidi_out_endpoint_create(snd_usb_midi_t* umidi, | 899 | static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi, |
903 | snd_usb_midi_endpoint_info_t* ep_info, | 900 | struct snd_usb_midi_endpoint_info* ep_info, |
904 | snd_usb_midi_endpoint_t* rep) | 901 | struct snd_usb_midi_endpoint* rep) |
905 | { | 902 | { |
906 | snd_usb_midi_out_endpoint_t* ep; | 903 | struct snd_usb_midi_out_endpoint* ep; |
907 | int i; | 904 | int i; |
908 | unsigned int pipe; | 905 | unsigned int pipe; |
909 | void* buffer; | 906 | void* buffer; |
@@ -951,12 +948,12 @@ static int snd_usbmidi_out_endpoint_create(snd_usb_midi_t* umidi, | |||
951 | /* | 948 | /* |
952 | * Frees everything. | 949 | * Frees everything. |
953 | */ | 950 | */ |
954 | static void snd_usbmidi_free(snd_usb_midi_t* umidi) | 951 | static void snd_usbmidi_free(struct snd_usb_midi* umidi) |
955 | { | 952 | { |
956 | int i; | 953 | int i; |
957 | 954 | ||
958 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { | 955 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { |
959 | snd_usb_midi_endpoint_t* ep = &umidi->endpoints[i]; | 956 | struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i]; |
960 | if (ep->out) | 957 | if (ep->out) |
961 | snd_usbmidi_out_endpoint_delete(ep->out); | 958 | snd_usbmidi_out_endpoint_delete(ep->out); |
962 | if (ep->in) | 959 | if (ep->in) |
@@ -970,13 +967,13 @@ static void snd_usbmidi_free(snd_usb_midi_t* umidi) | |||
970 | */ | 967 | */ |
971 | void snd_usbmidi_disconnect(struct list_head* p) | 968 | void snd_usbmidi_disconnect(struct list_head* p) |
972 | { | 969 | { |
973 | snd_usb_midi_t* umidi; | 970 | struct snd_usb_midi* umidi; |
974 | int i; | 971 | int i; |
975 | 972 | ||
976 | umidi = list_entry(p, snd_usb_midi_t, list); | 973 | umidi = list_entry(p, struct snd_usb_midi, list); |
977 | del_timer_sync(&umidi->error_timer); | 974 | del_timer_sync(&umidi->error_timer); |
978 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { | 975 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { |
979 | snd_usb_midi_endpoint_t* ep = &umidi->endpoints[i]; | 976 | struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i]; |
980 | if (ep->out) | 977 | if (ep->out) |
981 | tasklet_kill(&ep->out->tasklet); | 978 | tasklet_kill(&ep->out->tasklet); |
982 | if (ep->out && ep->out->urb) { | 979 | if (ep->out && ep->out->urb) { |
@@ -989,19 +986,19 @@ void snd_usbmidi_disconnect(struct list_head* p) | |||
989 | } | 986 | } |
990 | } | 987 | } |
991 | 988 | ||
992 | static void snd_usbmidi_rawmidi_free(snd_rawmidi_t* rmidi) | 989 | static void snd_usbmidi_rawmidi_free(struct snd_rawmidi *rmidi) |
993 | { | 990 | { |
994 | snd_usb_midi_t* umidi = rmidi->private_data; | 991 | struct snd_usb_midi* umidi = rmidi->private_data; |
995 | snd_usbmidi_free(umidi); | 992 | snd_usbmidi_free(umidi); |
996 | } | 993 | } |
997 | 994 | ||
998 | static snd_rawmidi_substream_t* snd_usbmidi_find_substream(snd_usb_midi_t* umidi, | 995 | static struct snd_rawmidi_substream *snd_usbmidi_find_substream(struct snd_usb_midi* umidi, |
999 | int stream, int number) | 996 | int stream, int number) |
1000 | { | 997 | { |
1001 | struct list_head* list; | 998 | struct list_head* list; |
1002 | 999 | ||
1003 | list_for_each(list, &umidi->rmidi->streams[stream].substreams) { | 1000 | list_for_each(list, &umidi->rmidi->streams[stream].substreams) { |
1004 | snd_rawmidi_substream_t* substream = list_entry(list, snd_rawmidi_substream_t, list); | 1001 | struct snd_rawmidi_substream *substream = list_entry(list, struct snd_rawmidi_substream, list); |
1005 | if (substream->number == number) | 1002 | if (substream->number == number) |
1006 | return substream; | 1003 | return substream; |
1007 | } | 1004 | } |
@@ -1097,14 +1094,14 @@ static struct { | |||
1097 | { USB_ID(0x086a, 0x0003), 4, "%s Broadcast" }, | 1094 | { USB_ID(0x086a, 0x0003), 4, "%s Broadcast" }, |
1098 | }; | 1095 | }; |
1099 | 1096 | ||
1100 | static void snd_usbmidi_init_substream(snd_usb_midi_t* umidi, | 1097 | static void snd_usbmidi_init_substream(struct snd_usb_midi* umidi, |
1101 | int stream, int number, | 1098 | int stream, int number, |
1102 | snd_rawmidi_substream_t** rsubstream) | 1099 | struct snd_rawmidi_substream ** rsubstream) |
1103 | { | 1100 | { |
1104 | int i; | 1101 | int i; |
1105 | const char *name_format; | 1102 | const char *name_format; |
1106 | 1103 | ||
1107 | snd_rawmidi_substream_t* substream = snd_usbmidi_find_substream(umidi, stream, number); | 1104 | struct snd_rawmidi_substream *substream = snd_usbmidi_find_substream(umidi, stream, number); |
1108 | if (!substream) { | 1105 | if (!substream) { |
1109 | snd_printd(KERN_ERR "substream %d:%d not found\n", stream, number); | 1106 | snd_printd(KERN_ERR "substream %d:%d not found\n", stream, number); |
1110 | return; | 1107 | return; |
@@ -1128,8 +1125,8 @@ static void snd_usbmidi_init_substream(snd_usb_midi_t* umidi, | |||
1128 | /* | 1125 | /* |
1129 | * Creates the endpoints and their ports. | 1126 | * Creates the endpoints and their ports. |
1130 | */ | 1127 | */ |
1131 | static int snd_usbmidi_create_endpoints(snd_usb_midi_t* umidi, | 1128 | static int snd_usbmidi_create_endpoints(struct snd_usb_midi* umidi, |
1132 | snd_usb_midi_endpoint_info_t* endpoints) | 1129 | struct snd_usb_midi_endpoint_info* endpoints) |
1133 | { | 1130 | { |
1134 | int i, j, err; | 1131 | int i, j, err; |
1135 | int out_ports = 0, in_ports = 0; | 1132 | int out_ports = 0, in_ports = 0; |
@@ -1169,8 +1166,8 @@ static int snd_usbmidi_create_endpoints(snd_usb_midi_t* umidi, | |||
1169 | /* | 1166 | /* |
1170 | * Returns MIDIStreaming device capabilities. | 1167 | * Returns MIDIStreaming device capabilities. |
1171 | */ | 1168 | */ |
1172 | static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi, | 1169 | static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, |
1173 | snd_usb_midi_endpoint_info_t* endpoints) | 1170 | struct snd_usb_midi_endpoint_info* endpoints) |
1174 | { | 1171 | { |
1175 | struct usb_interface* intf; | 1172 | struct usb_interface* intf; |
1176 | struct usb_host_interface *hostif; | 1173 | struct usb_host_interface *hostif; |
@@ -1244,7 +1241,7 @@ static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi, | |||
1244 | * On Roland devices, use the second alternate setting to be able to use | 1241 | * On Roland devices, use the second alternate setting to be able to use |
1245 | * the interrupt input endpoint. | 1242 | * the interrupt input endpoint. |
1246 | */ | 1243 | */ |
1247 | static void snd_usbmidi_switch_roland_altsetting(snd_usb_midi_t* umidi) | 1244 | static void snd_usbmidi_switch_roland_altsetting(struct snd_usb_midi* umidi) |
1248 | { | 1245 | { |
1249 | struct usb_interface* intf; | 1246 | struct usb_interface* intf; |
1250 | struct usb_host_interface *hostif; | 1247 | struct usb_host_interface *hostif; |
@@ -1270,8 +1267,8 @@ static void snd_usbmidi_switch_roland_altsetting(snd_usb_midi_t* umidi) | |||
1270 | /* | 1267 | /* |
1271 | * Try to find any usable endpoints in the interface. | 1268 | * Try to find any usable endpoints in the interface. |
1272 | */ | 1269 | */ |
1273 | static int snd_usbmidi_detect_endpoints(snd_usb_midi_t* umidi, | 1270 | static int snd_usbmidi_detect_endpoints(struct snd_usb_midi* umidi, |
1274 | snd_usb_midi_endpoint_info_t* endpoint, | 1271 | struct snd_usb_midi_endpoint_info* endpoint, |
1275 | int max_endpoints) | 1272 | int max_endpoints) |
1276 | { | 1273 | { |
1277 | struct usb_interface* intf; | 1274 | struct usb_interface* intf; |
@@ -1318,8 +1315,8 @@ static int snd_usbmidi_detect_endpoints(snd_usb_midi_t* umidi, | |||
1318 | /* | 1315 | /* |
1319 | * Detects the endpoints for one-port-per-endpoint protocols. | 1316 | * Detects the endpoints for one-port-per-endpoint protocols. |
1320 | */ | 1317 | */ |
1321 | static int snd_usbmidi_detect_per_port_endpoints(snd_usb_midi_t* umidi, | 1318 | static int snd_usbmidi_detect_per_port_endpoints(struct snd_usb_midi* umidi, |
1322 | snd_usb_midi_endpoint_info_t* endpoints) | 1319 | struct snd_usb_midi_endpoint_info* endpoints) |
1323 | { | 1320 | { |
1324 | int err, i; | 1321 | int err, i; |
1325 | 1322 | ||
@@ -1336,8 +1333,8 @@ static int snd_usbmidi_detect_per_port_endpoints(snd_usb_midi_t* umidi, | |||
1336 | /* | 1333 | /* |
1337 | * Detects the endpoints and ports of Yamaha devices. | 1334 | * Detects the endpoints and ports of Yamaha devices. |
1338 | */ | 1335 | */ |
1339 | static int snd_usbmidi_detect_yamaha(snd_usb_midi_t* umidi, | 1336 | static int snd_usbmidi_detect_yamaha(struct snd_usb_midi* umidi, |
1340 | snd_usb_midi_endpoint_info_t* endpoint) | 1337 | struct snd_usb_midi_endpoint_info* endpoint) |
1341 | { | 1338 | { |
1342 | struct usb_interface* intf; | 1339 | struct usb_interface* intf; |
1343 | struct usb_host_interface *hostif; | 1340 | struct usb_host_interface *hostif; |
@@ -1375,10 +1372,10 @@ static int snd_usbmidi_detect_yamaha(snd_usb_midi_t* umidi, | |||
1375 | /* | 1372 | /* |
1376 | * Creates the endpoints and their ports for Midiman devices. | 1373 | * Creates the endpoints and their ports for Midiman devices. |
1377 | */ | 1374 | */ |
1378 | static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, | 1375 | static int snd_usbmidi_create_endpoints_midiman(struct snd_usb_midi* umidi, |
1379 | snd_usb_midi_endpoint_info_t* endpoint) | 1376 | struct snd_usb_midi_endpoint_info* endpoint) |
1380 | { | 1377 | { |
1381 | snd_usb_midi_endpoint_info_t ep_info; | 1378 | struct snd_usb_midi_endpoint_info ep_info; |
1382 | struct usb_interface* intf; | 1379 | struct usb_interface* intf; |
1383 | struct usb_host_interface *hostif; | 1380 | struct usb_host_interface *hostif; |
1384 | struct usb_interface_descriptor* intfd; | 1381 | struct usb_interface_descriptor* intfd; |
@@ -1458,10 +1455,10 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, | |||
1458 | return 0; | 1455 | return 0; |
1459 | } | 1456 | } |
1460 | 1457 | ||
1461 | static int snd_usbmidi_create_rawmidi(snd_usb_midi_t* umidi, | 1458 | static int snd_usbmidi_create_rawmidi(struct snd_usb_midi* umidi, |
1462 | int out_ports, int in_ports) | 1459 | int out_ports, int in_ports) |
1463 | { | 1460 | { |
1464 | snd_rawmidi_t* rmidi; | 1461 | struct snd_rawmidi *rmidi; |
1465 | int err; | 1462 | int err; |
1466 | 1463 | ||
1467 | err = snd_rawmidi_new(umidi->chip->card, "USB MIDI", | 1464 | err = snd_rawmidi_new(umidi->chip->card, "USB MIDI", |
@@ -1487,18 +1484,18 @@ static int snd_usbmidi_create_rawmidi(snd_usb_midi_t* umidi, | |||
1487 | */ | 1484 | */ |
1488 | void snd_usbmidi_input_stop(struct list_head* p) | 1485 | void snd_usbmidi_input_stop(struct list_head* p) |
1489 | { | 1486 | { |
1490 | snd_usb_midi_t* umidi; | 1487 | struct snd_usb_midi* umidi; |
1491 | int i; | 1488 | int i; |
1492 | 1489 | ||
1493 | umidi = list_entry(p, snd_usb_midi_t, list); | 1490 | umidi = list_entry(p, struct snd_usb_midi, list); |
1494 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { | 1491 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { |
1495 | snd_usb_midi_endpoint_t* ep = &umidi->endpoints[i]; | 1492 | struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i]; |
1496 | if (ep->in) | 1493 | if (ep->in) |
1497 | usb_kill_urb(ep->in->urb); | 1494 | usb_kill_urb(ep->in->urb); |
1498 | } | 1495 | } |
1499 | } | 1496 | } |
1500 | 1497 | ||
1501 | static void snd_usbmidi_input_start_ep(snd_usb_midi_in_endpoint_t* ep) | 1498 | static void snd_usbmidi_input_start_ep(struct snd_usb_midi_in_endpoint* ep) |
1502 | { | 1499 | { |
1503 | if (ep) { | 1500 | if (ep) { |
1504 | struct urb* urb = ep->urb; | 1501 | struct urb* urb = ep->urb; |
@@ -1512,10 +1509,10 @@ static void snd_usbmidi_input_start_ep(snd_usb_midi_in_endpoint_t* ep) | |||
1512 | */ | 1509 | */ |
1513 | void snd_usbmidi_input_start(struct list_head* p) | 1510 | void snd_usbmidi_input_start(struct list_head* p) |
1514 | { | 1511 | { |
1515 | snd_usb_midi_t* umidi; | 1512 | struct snd_usb_midi* umidi; |
1516 | int i; | 1513 | int i; |
1517 | 1514 | ||
1518 | umidi = list_entry(p, snd_usb_midi_t, list); | 1515 | umidi = list_entry(p, struct snd_usb_midi, list); |
1519 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) | 1516 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) |
1520 | snd_usbmidi_input_start_ep(umidi->endpoints[i].in); | 1517 | snd_usbmidi_input_start_ep(umidi->endpoints[i].in); |
1521 | } | 1518 | } |
@@ -1523,12 +1520,12 @@ void snd_usbmidi_input_start(struct list_head* p) | |||
1523 | /* | 1520 | /* |
1524 | * Creates and registers everything needed for a MIDI streaming interface. | 1521 | * Creates and registers everything needed for a MIDI streaming interface. |
1525 | */ | 1522 | */ |
1526 | int snd_usb_create_midi_interface(snd_usb_audio_t* chip, | 1523 | int snd_usb_create_midi_interface(struct snd_usb_audio* chip, |
1527 | struct usb_interface* iface, | 1524 | struct usb_interface* iface, |
1528 | const snd_usb_audio_quirk_t* quirk) | 1525 | const struct snd_usb_audio_quirk* quirk) |
1529 | { | 1526 | { |
1530 | snd_usb_midi_t* umidi; | 1527 | struct snd_usb_midi* umidi; |
1531 | snd_usb_midi_endpoint_info_t endpoints[MIDI_MAX_ENDPOINTS]; | 1528 | struct snd_usb_midi_endpoint_info endpoints[MIDI_MAX_ENDPOINTS]; |
1532 | int out_ports, in_ports; | 1529 | int out_ports, in_ports; |
1533 | int i, err; | 1530 | int i, err; |
1534 | 1531 | ||
@@ -1551,7 +1548,7 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip, | |||
1551 | break; | 1548 | break; |
1552 | case QUIRK_MIDI_FIXED_ENDPOINT: | 1549 | case QUIRK_MIDI_FIXED_ENDPOINT: |
1553 | memcpy(&endpoints[0], quirk->data, | 1550 | memcpy(&endpoints[0], quirk->data, |
1554 | sizeof(snd_usb_midi_endpoint_info_t)); | 1551 | sizeof(struct snd_usb_midi_endpoint_info)); |
1555 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); | 1552 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); |
1556 | break; | 1553 | break; |
1557 | case QUIRK_MIDI_YAMAHA: | 1554 | case QUIRK_MIDI_YAMAHA: |
@@ -1560,7 +1557,7 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip, | |||
1560 | case QUIRK_MIDI_MIDIMAN: | 1557 | case QUIRK_MIDI_MIDIMAN: |
1561 | umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops; | 1558 | umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops; |
1562 | memcpy(&endpoints[0], quirk->data, | 1559 | memcpy(&endpoints[0], quirk->data, |
1563 | sizeof(snd_usb_midi_endpoint_info_t)); | 1560 | sizeof(struct snd_usb_midi_endpoint_info)); |
1564 | err = 0; | 1561 | err = 0; |
1565 | break; | 1562 | break; |
1566 | case QUIRK_MIDI_NOVATION: | 1563 | case QUIRK_MIDI_NOVATION: |
@@ -1574,7 +1571,7 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip, | |||
1574 | case QUIRK_MIDI_EMAGIC: | 1571 | case QUIRK_MIDI_EMAGIC: |
1575 | umidi->usb_protocol_ops = &snd_usbmidi_emagic_ops; | 1572 | umidi->usb_protocol_ops = &snd_usbmidi_emagic_ops; |
1576 | memcpy(&endpoints[0], quirk->data, | 1573 | memcpy(&endpoints[0], quirk->data, |
1577 | sizeof(snd_usb_midi_endpoint_info_t)); | 1574 | sizeof(struct snd_usb_midi_endpoint_info)); |
1578 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); | 1575 | err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); |
1579 | break; | 1576 | break; |
1580 | case QUIRK_MIDI_MIDITECH: | 1577 | case QUIRK_MIDI_MIDITECH: |
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index e570d140258d..678dac2d4dba 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
@@ -46,18 +46,13 @@ | |||
46 | /* ignore error from controls - for debugging */ | 46 | /* ignore error from controls - for debugging */ |
47 | /* #define IGNORE_CTL_ERROR */ | 47 | /* #define IGNORE_CTL_ERROR */ |
48 | 48 | ||
49 | typedef struct usb_mixer_build mixer_build_t; | ||
50 | typedef struct usb_audio_term usb_audio_term_t; | ||
51 | typedef struct usb_mixer_elem_info usb_mixer_elem_info_t; | ||
52 | |||
53 | |||
54 | struct usb_mixer_interface { | 49 | struct usb_mixer_interface { |
55 | snd_usb_audio_t *chip; | 50 | struct snd_usb_audio *chip; |
56 | unsigned int ctrlif; | 51 | unsigned int ctrlif; |
57 | struct list_head list; | 52 | struct list_head list; |
58 | unsigned int ignore_ctl_error; | 53 | unsigned int ignore_ctl_error; |
59 | struct urb *urb; | 54 | struct urb *urb; |
60 | usb_mixer_elem_info_t **id_elems; /* array[256], indexed by unit id */ | 55 | struct usb_mixer_elem_info **id_elems; /* array[256], indexed by unit id */ |
61 | 56 | ||
62 | /* Sound Blaster remote control stuff */ | 57 | /* Sound Blaster remote control stuff */ |
63 | enum { | 58 | enum { |
@@ -86,21 +81,21 @@ struct usb_audio_term { | |||
86 | 81 | ||
87 | struct usbmix_name_map; | 82 | struct usbmix_name_map; |
88 | 83 | ||
89 | struct usb_mixer_build { | 84 | struct mixer_build { |
90 | snd_usb_audio_t *chip; | 85 | struct snd_usb_audio *chip; |
91 | struct usb_mixer_interface *mixer; | 86 | struct usb_mixer_interface *mixer; |
92 | unsigned char *buffer; | 87 | unsigned char *buffer; |
93 | unsigned int buflen; | 88 | unsigned int buflen; |
94 | DECLARE_BITMAP(unitbitmap, 256); | 89 | DECLARE_BITMAP(unitbitmap, 256); |
95 | usb_audio_term_t oterm; | 90 | struct usb_audio_term oterm; |
96 | const struct usbmix_name_map *map; | 91 | const struct usbmix_name_map *map; |
97 | const struct usbmix_selector_map *selector_map; | 92 | const struct usbmix_selector_map *selector_map; |
98 | }; | 93 | }; |
99 | 94 | ||
100 | struct usb_mixer_elem_info { | 95 | struct usb_mixer_elem_info { |
101 | struct usb_mixer_interface *mixer; | 96 | struct usb_mixer_interface *mixer; |
102 | usb_mixer_elem_info_t *next_id_elem; /* list of controls with same id */ | 97 | struct usb_mixer_elem_info *next_id_elem; /* list of controls with same id */ |
103 | snd_ctl_elem_id_t *elem_id; | 98 | struct snd_ctl_elem_id *elem_id; |
104 | unsigned int id; | 99 | unsigned int id; |
105 | unsigned int control; /* CS or ICN (high byte) */ | 100 | unsigned int control; /* CS or ICN (high byte) */ |
106 | unsigned int cmask; /* channel mask bitmap: 0 = master */ | 101 | unsigned int cmask; /* channel mask bitmap: 0 = master */ |
@@ -179,7 +174,7 @@ enum { | |||
179 | #include "usbmixer_maps.c" | 174 | #include "usbmixer_maps.c" |
180 | 175 | ||
181 | /* get the mapped name if the unit matches */ | 176 | /* get the mapped name if the unit matches */ |
182 | static int check_mapped_name(mixer_build_t *state, int unitid, int control, char *buf, int buflen) | 177 | static int check_mapped_name(struct mixer_build *state, int unitid, int control, char *buf, int buflen) |
183 | { | 178 | { |
184 | const struct usbmix_name_map *p; | 179 | const struct usbmix_name_map *p; |
185 | 180 | ||
@@ -197,7 +192,7 @@ static int check_mapped_name(mixer_build_t *state, int unitid, int control, char | |||
197 | } | 192 | } |
198 | 193 | ||
199 | /* check whether the control should be ignored */ | 194 | /* check whether the control should be ignored */ |
200 | static int check_ignored_ctl(mixer_build_t *state, int unitid, int control) | 195 | static int check_ignored_ctl(struct mixer_build *state, int unitid, int control) |
201 | { | 196 | { |
202 | const struct usbmix_name_map *p; | 197 | const struct usbmix_name_map *p; |
203 | 198 | ||
@@ -214,7 +209,7 @@ static int check_ignored_ctl(mixer_build_t *state, int unitid, int control) | |||
214 | } | 209 | } |
215 | 210 | ||
216 | /* get the mapped selector source name */ | 211 | /* get the mapped selector source name */ |
217 | static int check_mapped_selector_name(mixer_build_t *state, int unitid, | 212 | static int check_mapped_selector_name(struct mixer_build *state, int unitid, |
218 | int index, char *buf, int buflen) | 213 | int index, char *buf, int buflen) |
219 | { | 214 | { |
220 | const struct usbmix_selector_map *p; | 215 | const struct usbmix_selector_map *p; |
@@ -231,7 +226,7 @@ static int check_mapped_selector_name(mixer_build_t *state, int unitid, | |||
231 | /* | 226 | /* |
232 | * find an audio control unit with the given unit id | 227 | * find an audio control unit with the given unit id |
233 | */ | 228 | */ |
234 | static void *find_audio_control_unit(mixer_build_t *state, unsigned char unit) | 229 | static void *find_audio_control_unit(struct mixer_build *state, unsigned char unit) |
235 | { | 230 | { |
236 | unsigned char *p; | 231 | unsigned char *p; |
237 | 232 | ||
@@ -248,7 +243,7 @@ static void *find_audio_control_unit(mixer_build_t *state, unsigned char unit) | |||
248 | /* | 243 | /* |
249 | * copy a string with the given id | 244 | * copy a string with the given id |
250 | */ | 245 | */ |
251 | static int snd_usb_copy_string_desc(mixer_build_t *state, int index, char *buf, int maxlen) | 246 | static int snd_usb_copy_string_desc(struct mixer_build *state, int index, char *buf, int maxlen) |
252 | { | 247 | { |
253 | int len = usb_string(state->chip->dev, index, buf, maxlen - 1); | 248 | int len = usb_string(state->chip->dev, index, buf, maxlen - 1); |
254 | buf[len] = 0; | 249 | buf[len] = 0; |
@@ -258,7 +253,7 @@ static int snd_usb_copy_string_desc(mixer_build_t *state, int index, char *buf, | |||
258 | /* | 253 | /* |
259 | * convert from the byte/word on usb descriptor to the zero-based integer | 254 | * convert from the byte/word on usb descriptor to the zero-based integer |
260 | */ | 255 | */ |
261 | static int convert_signed_value(usb_mixer_elem_info_t *cval, int val) | 256 | static int convert_signed_value(struct usb_mixer_elem_info *cval, int val) |
262 | { | 257 | { |
263 | switch (cval->val_type) { | 258 | switch (cval->val_type) { |
264 | case USB_MIXER_BOOLEAN: | 259 | case USB_MIXER_BOOLEAN: |
@@ -288,7 +283,7 @@ static int convert_signed_value(usb_mixer_elem_info_t *cval, int val) | |||
288 | /* | 283 | /* |
289 | * convert from the zero-based int to the byte/word for usb descriptor | 284 | * convert from the zero-based int to the byte/word for usb descriptor |
290 | */ | 285 | */ |
291 | static int convert_bytes_value(usb_mixer_elem_info_t *cval, int val) | 286 | static int convert_bytes_value(struct usb_mixer_elem_info *cval, int val) |
292 | { | 287 | { |
293 | switch (cval->val_type) { | 288 | switch (cval->val_type) { |
294 | case USB_MIXER_BOOLEAN: | 289 | case USB_MIXER_BOOLEAN: |
@@ -305,7 +300,7 @@ static int convert_bytes_value(usb_mixer_elem_info_t *cval, int val) | |||
305 | return 0; /* not reached */ | 300 | return 0; /* not reached */ |
306 | } | 301 | } |
307 | 302 | ||
308 | static int get_relative_value(usb_mixer_elem_info_t *cval, int val) | 303 | static int get_relative_value(struct usb_mixer_elem_info *cval, int val) |
309 | { | 304 | { |
310 | if (! cval->res) | 305 | if (! cval->res) |
311 | cval->res = 1; | 306 | cval->res = 1; |
@@ -317,7 +312,7 @@ static int get_relative_value(usb_mixer_elem_info_t *cval, int val) | |||
317 | return (val - cval->min) / cval->res; | 312 | return (val - cval->min) / cval->res; |
318 | } | 313 | } |
319 | 314 | ||
320 | static int get_abs_value(usb_mixer_elem_info_t *cval, int val) | 315 | static int get_abs_value(struct usb_mixer_elem_info *cval, int val) |
321 | { | 316 | { |
322 | if (val < 0) | 317 | if (val < 0) |
323 | return cval->min; | 318 | return cval->min; |
@@ -335,7 +330,7 @@ static int get_abs_value(usb_mixer_elem_info_t *cval, int val) | |||
335 | * retrieve a mixer value | 330 | * retrieve a mixer value |
336 | */ | 331 | */ |
337 | 332 | ||
338 | static int get_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, int *value_ret) | 333 | static int get_ctl_value(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret) |
339 | { | 334 | { |
340 | unsigned char buf[2]; | 335 | unsigned char buf[2]; |
341 | int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1; | 336 | int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1; |
@@ -357,13 +352,13 @@ static int get_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i | |||
357 | return -EINVAL; | 352 | return -EINVAL; |
358 | } | 353 | } |
359 | 354 | ||
360 | static int get_cur_ctl_value(usb_mixer_elem_info_t *cval, int validx, int *value) | 355 | static int get_cur_ctl_value(struct usb_mixer_elem_info *cval, int validx, int *value) |
361 | { | 356 | { |
362 | return get_ctl_value(cval, GET_CUR, validx, value); | 357 | return get_ctl_value(cval, GET_CUR, validx, value); |
363 | } | 358 | } |
364 | 359 | ||
365 | /* channel = 0: master, 1 = first channel */ | 360 | /* channel = 0: master, 1 = first channel */ |
366 | static inline int get_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, int *value) | 361 | static inline int get_cur_mix_value(struct usb_mixer_elem_info *cval, int channel, int *value) |
367 | { | 362 | { |
368 | return get_ctl_value(cval, GET_CUR, (cval->control << 8) | channel, value); | 363 | return get_ctl_value(cval, GET_CUR, (cval->control << 8) | channel, value); |
369 | } | 364 | } |
@@ -372,7 +367,7 @@ static inline int get_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, in | |||
372 | * set a mixer value | 367 | * set a mixer value |
373 | */ | 368 | */ |
374 | 369 | ||
375 | static int set_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, int value_set) | 370 | static int set_ctl_value(struct usb_mixer_elem_info *cval, int request, int validx, int value_set) |
376 | { | 371 | { |
377 | unsigned char buf[2]; | 372 | unsigned char buf[2]; |
378 | int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1; | 373 | int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1; |
@@ -394,12 +389,12 @@ static int set_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i | |||
394 | return -EINVAL; | 389 | return -EINVAL; |
395 | } | 390 | } |
396 | 391 | ||
397 | static int set_cur_ctl_value(usb_mixer_elem_info_t *cval, int validx, int value) | 392 | static int set_cur_ctl_value(struct usb_mixer_elem_info *cval, int validx, int value) |
398 | { | 393 | { |
399 | return set_ctl_value(cval, SET_CUR, validx, value); | 394 | return set_ctl_value(cval, SET_CUR, validx, value); |
400 | } | 395 | } |
401 | 396 | ||
402 | static inline int set_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, int value) | 397 | static inline int set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel, int value) |
403 | { | 398 | { |
404 | return set_ctl_value(cval, SET_CUR, (cval->control << 8) | channel, value); | 399 | return set_ctl_value(cval, SET_CUR, (cval->control << 8) | channel, value); |
405 | } | 400 | } |
@@ -409,7 +404,7 @@ static inline int set_cur_mix_value(usb_mixer_elem_info_t *cval, int channel, in | |||
409 | * parser routines begin here... | 404 | * parser routines begin here... |
410 | */ | 405 | */ |
411 | 406 | ||
412 | static int parse_audio_unit(mixer_build_t *state, int unitid); | 407 | static int parse_audio_unit(struct mixer_build *state, int unitid); |
413 | 408 | ||
414 | 409 | ||
415 | /* | 410 | /* |
@@ -430,9 +425,9 @@ static int check_matrix_bitmap(unsigned char *bmap, int ich, int och, int num_ou | |||
430 | * if failed, give up and free the control instance. | 425 | * if failed, give up and free the control instance. |
431 | */ | 426 | */ |
432 | 427 | ||
433 | static int add_control_to_empty(mixer_build_t *state, snd_kcontrol_t *kctl) | 428 | static int add_control_to_empty(struct mixer_build *state, struct snd_kcontrol *kctl) |
434 | { | 429 | { |
435 | usb_mixer_elem_info_t *cval = kctl->private_data; | 430 | struct usb_mixer_elem_info *cval = kctl->private_data; |
436 | int err; | 431 | int err; |
437 | 432 | ||
438 | while (snd_ctl_find_id(state->chip->card, &kctl->id)) | 433 | while (snd_ctl_find_id(state->chip->card, &kctl->id)) |
@@ -496,7 +491,7 @@ static struct iterm_name_combo { | |||
496 | { 0 }, | 491 | { 0 }, |
497 | }; | 492 | }; |
498 | 493 | ||
499 | static int get_term_name(mixer_build_t *state, usb_audio_term_t *iterm, | 494 | static int get_term_name(struct mixer_build *state, struct usb_audio_term *iterm, |
500 | unsigned char *name, int maxlen, int term_only) | 495 | unsigned char *name, int maxlen, int term_only) |
501 | { | 496 | { |
502 | struct iterm_name_combo *names; | 497 | struct iterm_name_combo *names; |
@@ -546,7 +541,7 @@ static int get_term_name(mixer_build_t *state, usb_audio_term_t *iterm, | |||
546 | * parse the source unit recursively until it reaches to a terminal | 541 | * parse the source unit recursively until it reaches to a terminal |
547 | * or a branched unit. | 542 | * or a branched unit. |
548 | */ | 543 | */ |
549 | static int check_input_term(mixer_build_t *state, int id, usb_audio_term_t *term) | 544 | static int check_input_term(struct mixer_build *state, int id, struct usb_audio_term *term) |
550 | { | 545 | { |
551 | unsigned char *p1; | 546 | unsigned char *p1; |
552 | 547 | ||
@@ -621,7 +616,7 @@ static struct usb_feature_control_info audio_feature_info[] = { | |||
621 | 616 | ||
622 | 617 | ||
623 | /* private_free callback */ | 618 | /* private_free callback */ |
624 | static void usb_mixer_elem_free(snd_kcontrol_t *kctl) | 619 | static void usb_mixer_elem_free(struct snd_kcontrol *kctl) |
625 | { | 620 | { |
626 | kfree(kctl->private_data); | 621 | kfree(kctl->private_data); |
627 | kctl->private_data = NULL; | 622 | kctl->private_data = NULL; |
@@ -635,7 +630,7 @@ static void usb_mixer_elem_free(snd_kcontrol_t *kctl) | |||
635 | /* | 630 | /* |
636 | * retrieve the minimum and maximum values for the specified control | 631 | * retrieve the minimum and maximum values for the specified control |
637 | */ | 632 | */ |
638 | static int get_min_max(usb_mixer_elem_info_t *cval, int default_min) | 633 | static int get_min_max(struct usb_mixer_elem_info *cval, int default_min) |
639 | { | 634 | { |
640 | /* for failsafe */ | 635 | /* for failsafe */ |
641 | cval->min = default_min; | 636 | cval->min = default_min; |
@@ -683,9 +678,9 @@ static int get_min_max(usb_mixer_elem_info_t *cval, int default_min) | |||
683 | 678 | ||
684 | 679 | ||
685 | /* get a feature/mixer unit info */ | 680 | /* get a feature/mixer unit info */ |
686 | static int mixer_ctl_feature_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 681 | static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
687 | { | 682 | { |
688 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 683 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
689 | 684 | ||
690 | if (cval->val_type == USB_MIXER_BOOLEAN || | 685 | if (cval->val_type == USB_MIXER_BOOLEAN || |
691 | cval->val_type == USB_MIXER_INV_BOOLEAN) | 686 | cval->val_type == USB_MIXER_INV_BOOLEAN) |
@@ -707,9 +702,9 @@ static int mixer_ctl_feature_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
707 | } | 702 | } |
708 | 703 | ||
709 | /* get the current value from feature/mixer unit */ | 704 | /* get the current value from feature/mixer unit */ |
710 | static int mixer_ctl_feature_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 705 | static int mixer_ctl_feature_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
711 | { | 706 | { |
712 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 707 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
713 | int c, cnt, val, err; | 708 | int c, cnt, val, err; |
714 | 709 | ||
715 | if (cval->cmask) { | 710 | if (cval->cmask) { |
@@ -748,9 +743,9 @@ static int mixer_ctl_feature_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
748 | } | 743 | } |
749 | 744 | ||
750 | /* put the current value to feature/mixer unit */ | 745 | /* put the current value to feature/mixer unit */ |
751 | static int mixer_ctl_feature_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 746 | static int mixer_ctl_feature_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
752 | { | 747 | { |
753 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 748 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
754 | int c, cnt, val, oval, err; | 749 | int c, cnt, val, oval, err; |
755 | int changed = 0; | 750 | int changed = 0; |
756 | 751 | ||
@@ -791,7 +786,7 @@ static int mixer_ctl_feature_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
791 | return changed; | 786 | return changed; |
792 | } | 787 | } |
793 | 788 | ||
794 | static snd_kcontrol_new_t usb_feature_unit_ctl = { | 789 | static struct snd_kcontrol_new usb_feature_unit_ctl = { |
795 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 790 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
796 | .name = "", /* will be filled later manually */ | 791 | .name = "", /* will be filled later manually */ |
797 | .info = mixer_ctl_feature_info, | 792 | .info = mixer_ctl_feature_info, |
@@ -804,15 +799,15 @@ static snd_kcontrol_new_t usb_feature_unit_ctl = { | |||
804 | * build a feature control | 799 | * build a feature control |
805 | */ | 800 | */ |
806 | 801 | ||
807 | static void build_feature_ctl(mixer_build_t *state, unsigned char *desc, | 802 | static void build_feature_ctl(struct mixer_build *state, unsigned char *desc, |
808 | unsigned int ctl_mask, int control, | 803 | unsigned int ctl_mask, int control, |
809 | usb_audio_term_t *iterm, int unitid) | 804 | struct usb_audio_term *iterm, int unitid) |
810 | { | 805 | { |
811 | unsigned int len = 0; | 806 | unsigned int len = 0; |
812 | int mapped_name = 0; | 807 | int mapped_name = 0; |
813 | int nameid = desc[desc[0] - 1]; | 808 | int nameid = desc[desc[0] - 1]; |
814 | snd_kcontrol_t *kctl; | 809 | struct snd_kcontrol *kctl; |
815 | usb_mixer_elem_info_t *cval; | 810 | struct usb_mixer_elem_info *cval; |
816 | 811 | ||
817 | control++; /* change from zero-based to 1-based value */ | 812 | control++; /* change from zero-based to 1-based value */ |
818 | 813 | ||
@@ -928,10 +923,10 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc, | |||
928 | * | 923 | * |
929 | * most of controlls are defined here. | 924 | * most of controlls are defined here. |
930 | */ | 925 | */ |
931 | static int parse_audio_feature_unit(mixer_build_t *state, int unitid, unsigned char *ftr) | 926 | static int parse_audio_feature_unit(struct mixer_build *state, int unitid, unsigned char *ftr) |
932 | { | 927 | { |
933 | int channels, i, j; | 928 | int channels, i, j; |
934 | usb_audio_term_t iterm; | 929 | struct usb_audio_term iterm; |
935 | unsigned int master_bits, first_ch_bits; | 930 | unsigned int master_bits, first_ch_bits; |
936 | int err, csize; | 931 | int err, csize; |
937 | 932 | ||
@@ -984,15 +979,15 @@ static int parse_audio_feature_unit(mixer_build_t *state, int unitid, unsigned c | |||
984 | * input channel number (zero based) is given in control field instead. | 979 | * input channel number (zero based) is given in control field instead. |
985 | */ | 980 | */ |
986 | 981 | ||
987 | static void build_mixer_unit_ctl(mixer_build_t *state, unsigned char *desc, | 982 | static void build_mixer_unit_ctl(struct mixer_build *state, unsigned char *desc, |
988 | int in_pin, int in_ch, int unitid, | 983 | int in_pin, int in_ch, int unitid, |
989 | usb_audio_term_t *iterm) | 984 | struct usb_audio_term *iterm) |
990 | { | 985 | { |
991 | usb_mixer_elem_info_t *cval; | 986 | struct usb_mixer_elem_info *cval; |
992 | unsigned int input_pins = desc[4]; | 987 | unsigned int input_pins = desc[4]; |
993 | unsigned int num_outs = desc[5 + input_pins]; | 988 | unsigned int num_outs = desc[5 + input_pins]; |
994 | unsigned int i, len; | 989 | unsigned int i, len; |
995 | snd_kcontrol_t *kctl; | 990 | struct snd_kcontrol *kctl; |
996 | 991 | ||
997 | if (check_ignored_ctl(state, unitid, 0)) | 992 | if (check_ignored_ctl(state, unitid, 0)) |
998 | return; | 993 | return; |
@@ -1039,9 +1034,9 @@ static void build_mixer_unit_ctl(mixer_build_t *state, unsigned char *desc, | |||
1039 | /* | 1034 | /* |
1040 | * parse a mixer unit | 1035 | * parse a mixer unit |
1041 | */ | 1036 | */ |
1042 | static int parse_audio_mixer_unit(mixer_build_t *state, int unitid, unsigned char *desc) | 1037 | static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, unsigned char *desc) |
1043 | { | 1038 | { |
1044 | usb_audio_term_t iterm; | 1039 | struct usb_audio_term iterm; |
1045 | int input_pins, num_ins, num_outs; | 1040 | int input_pins, num_ins, num_outs; |
1046 | int pin, ich, err; | 1041 | int pin, ich, err; |
1047 | 1042 | ||
@@ -1089,9 +1084,9 @@ static int parse_audio_mixer_unit(mixer_build_t *state, int unitid, unsigned cha | |||
1089 | */ | 1084 | */ |
1090 | 1085 | ||
1091 | /* get callback for processing/extension unit */ | 1086 | /* get callback for processing/extension unit */ |
1092 | static int mixer_ctl_procunit_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1087 | static int mixer_ctl_procunit_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1093 | { | 1088 | { |
1094 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 1089 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
1095 | int err, val; | 1090 | int err, val; |
1096 | 1091 | ||
1097 | err = get_cur_ctl_value(cval, cval->control << 8, &val); | 1092 | err = get_cur_ctl_value(cval, cval->control << 8, &val); |
@@ -1107,9 +1102,9 @@ static int mixer_ctl_procunit_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1107 | } | 1102 | } |
1108 | 1103 | ||
1109 | /* put callback for processing/extension unit */ | 1104 | /* put callback for processing/extension unit */ |
1110 | static int mixer_ctl_procunit_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1105 | static int mixer_ctl_procunit_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1111 | { | 1106 | { |
1112 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 1107 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
1113 | int val, oval, err; | 1108 | int val, oval, err; |
1114 | 1109 | ||
1115 | err = get_cur_ctl_value(cval, cval->control << 8, &oval); | 1110 | err = get_cur_ctl_value(cval, cval->control << 8, &oval); |
@@ -1128,7 +1123,7 @@ static int mixer_ctl_procunit_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1128 | } | 1123 | } |
1129 | 1124 | ||
1130 | /* alsa control interface for processing/extension unit */ | 1125 | /* alsa control interface for processing/extension unit */ |
1131 | static snd_kcontrol_new_t mixer_procunit_ctl = { | 1126 | static struct snd_kcontrol_new mixer_procunit_ctl = { |
1132 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1127 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1133 | .name = "", /* will be filled later */ | 1128 | .name = "", /* will be filled later */ |
1134 | .info = mixer_ctl_feature_info, | 1129 | .info = mixer_ctl_feature_info, |
@@ -1205,11 +1200,11 @@ static struct procunit_info procunits[] = { | |||
1205 | /* | 1200 | /* |
1206 | * build a processing/extension unit | 1201 | * build a processing/extension unit |
1207 | */ | 1202 | */ |
1208 | static int build_audio_procunit(mixer_build_t *state, int unitid, unsigned char *dsc, struct procunit_info *list, char *name) | 1203 | static int build_audio_procunit(struct mixer_build *state, int unitid, unsigned char *dsc, struct procunit_info *list, char *name) |
1209 | { | 1204 | { |
1210 | int num_ins = dsc[6]; | 1205 | int num_ins = dsc[6]; |
1211 | usb_mixer_elem_info_t *cval; | 1206 | struct usb_mixer_elem_info *cval; |
1212 | snd_kcontrol_t *kctl; | 1207 | struct snd_kcontrol *kctl; |
1213 | int i, err, nameid, type, len; | 1208 | int i, err, nameid, type, len; |
1214 | struct procunit_info *info; | 1209 | struct procunit_info *info; |
1215 | struct procunit_value_info *valinfo; | 1210 | struct procunit_value_info *valinfo; |
@@ -1297,12 +1292,12 @@ static int build_audio_procunit(mixer_build_t *state, int unitid, unsigned char | |||
1297 | } | 1292 | } |
1298 | 1293 | ||
1299 | 1294 | ||
1300 | static int parse_audio_processing_unit(mixer_build_t *state, int unitid, unsigned char *desc) | 1295 | static int parse_audio_processing_unit(struct mixer_build *state, int unitid, unsigned char *desc) |
1301 | { | 1296 | { |
1302 | return build_audio_procunit(state, unitid, desc, procunits, "Processing Unit"); | 1297 | return build_audio_procunit(state, unitid, desc, procunits, "Processing Unit"); |
1303 | } | 1298 | } |
1304 | 1299 | ||
1305 | static int parse_audio_extension_unit(mixer_build_t *state, int unitid, unsigned char *desc) | 1300 | static int parse_audio_extension_unit(struct mixer_build *state, int unitid, unsigned char *desc) |
1306 | { | 1301 | { |
1307 | return build_audio_procunit(state, unitid, desc, NULL, "Extension Unit"); | 1302 | return build_audio_procunit(state, unitid, desc, NULL, "Extension Unit"); |
1308 | } | 1303 | } |
@@ -1315,9 +1310,9 @@ static int parse_audio_extension_unit(mixer_build_t *state, int unitid, unsigned | |||
1315 | /* info callback for selector unit | 1310 | /* info callback for selector unit |
1316 | * use an enumerator type for routing | 1311 | * use an enumerator type for routing |
1317 | */ | 1312 | */ |
1318 | static int mixer_ctl_selector_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 1313 | static int mixer_ctl_selector_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1319 | { | 1314 | { |
1320 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 1315 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
1321 | char **itemlist = (char **)kcontrol->private_value; | 1316 | char **itemlist = (char **)kcontrol->private_value; |
1322 | 1317 | ||
1323 | snd_assert(itemlist, return -EINVAL); | 1318 | snd_assert(itemlist, return -EINVAL); |
@@ -1331,9 +1326,9 @@ static int mixer_ctl_selector_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1331 | } | 1326 | } |
1332 | 1327 | ||
1333 | /* get callback for selector unit */ | 1328 | /* get callback for selector unit */ |
1334 | static int mixer_ctl_selector_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1329 | static int mixer_ctl_selector_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1335 | { | 1330 | { |
1336 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 1331 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
1337 | int val, err; | 1332 | int val, err; |
1338 | 1333 | ||
1339 | err = get_cur_ctl_value(cval, 0, &val); | 1334 | err = get_cur_ctl_value(cval, 0, &val); |
@@ -1350,9 +1345,9 @@ static int mixer_ctl_selector_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1350 | } | 1345 | } |
1351 | 1346 | ||
1352 | /* put callback for selector unit */ | 1347 | /* put callback for selector unit */ |
1353 | static int mixer_ctl_selector_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1348 | static int mixer_ctl_selector_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1354 | { | 1349 | { |
1355 | usb_mixer_elem_info_t *cval = kcontrol->private_data; | 1350 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
1356 | int val, oval, err; | 1351 | int val, oval, err; |
1357 | 1352 | ||
1358 | err = get_cur_ctl_value(cval, 0, &oval); | 1353 | err = get_cur_ctl_value(cval, 0, &oval); |
@@ -1371,7 +1366,7 @@ static int mixer_ctl_selector_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1371 | } | 1366 | } |
1372 | 1367 | ||
1373 | /* alsa control interface for selector unit */ | 1368 | /* alsa control interface for selector unit */ |
1374 | static snd_kcontrol_new_t mixer_selectunit_ctl = { | 1369 | static struct snd_kcontrol_new mixer_selectunit_ctl = { |
1375 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1370 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1376 | .name = "", /* will be filled later */ | 1371 | .name = "", /* will be filled later */ |
1377 | .info = mixer_ctl_selector_info, | 1372 | .info = mixer_ctl_selector_info, |
@@ -1383,12 +1378,12 @@ static snd_kcontrol_new_t mixer_selectunit_ctl = { | |||
1383 | /* private free callback. | 1378 | /* private free callback. |
1384 | * free both private_data and private_value | 1379 | * free both private_data and private_value |
1385 | */ | 1380 | */ |
1386 | static void usb_mixer_selector_elem_free(snd_kcontrol_t *kctl) | 1381 | static void usb_mixer_selector_elem_free(struct snd_kcontrol *kctl) |
1387 | { | 1382 | { |
1388 | int i, num_ins = 0; | 1383 | int i, num_ins = 0; |
1389 | 1384 | ||
1390 | if (kctl->private_data) { | 1385 | if (kctl->private_data) { |
1391 | usb_mixer_elem_info_t *cval = kctl->private_data; | 1386 | struct usb_mixer_elem_info *cval = kctl->private_data; |
1392 | num_ins = cval->max; | 1387 | num_ins = cval->max; |
1393 | kfree(cval); | 1388 | kfree(cval); |
1394 | kctl->private_data = NULL; | 1389 | kctl->private_data = NULL; |
@@ -1405,13 +1400,13 @@ static void usb_mixer_selector_elem_free(snd_kcontrol_t *kctl) | |||
1405 | /* | 1400 | /* |
1406 | * parse a selector unit | 1401 | * parse a selector unit |
1407 | */ | 1402 | */ |
1408 | static int parse_audio_selector_unit(mixer_build_t *state, int unitid, unsigned char *desc) | 1403 | static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsigned char *desc) |
1409 | { | 1404 | { |
1410 | unsigned int num_ins = desc[4]; | 1405 | unsigned int num_ins = desc[4]; |
1411 | unsigned int i, nameid, len; | 1406 | unsigned int i, nameid, len; |
1412 | int err; | 1407 | int err; |
1413 | usb_mixer_elem_info_t *cval; | 1408 | struct usb_mixer_elem_info *cval; |
1414 | snd_kcontrol_t *kctl; | 1409 | struct snd_kcontrol *kctl; |
1415 | char **namelist; | 1410 | char **namelist; |
1416 | 1411 | ||
1417 | if (! num_ins || desc[0] < 6 + num_ins) { | 1412 | if (! num_ins || desc[0] < 6 + num_ins) { |
@@ -1452,7 +1447,7 @@ static int parse_audio_selector_unit(mixer_build_t *state, int unitid, unsigned | |||
1452 | } | 1447 | } |
1453 | #define MAX_ITEM_NAME_LEN 64 | 1448 | #define MAX_ITEM_NAME_LEN 64 |
1454 | for (i = 0; i < num_ins; i++) { | 1449 | for (i = 0; i < num_ins; i++) { |
1455 | usb_audio_term_t iterm; | 1450 | struct usb_audio_term iterm; |
1456 | len = 0; | 1451 | len = 0; |
1457 | namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL); | 1452 | namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL); |
1458 | if (! namelist[i]) { | 1453 | if (! namelist[i]) { |
@@ -1511,7 +1506,7 @@ static int parse_audio_selector_unit(mixer_build_t *state, int unitid, unsigned | |||
1511 | * parse an audio unit recursively | 1506 | * parse an audio unit recursively |
1512 | */ | 1507 | */ |
1513 | 1508 | ||
1514 | static int parse_audio_unit(mixer_build_t *state, int unitid) | 1509 | static int parse_audio_unit(struct mixer_build *state, int unitid) |
1515 | { | 1510 | { |
1516 | unsigned char *p1; | 1511 | unsigned char *p1; |
1517 | 1512 | ||
@@ -1556,7 +1551,7 @@ static void snd_usb_mixer_free(struct usb_mixer_interface *mixer) | |||
1556 | kfree(mixer); | 1551 | kfree(mixer); |
1557 | } | 1552 | } |
1558 | 1553 | ||
1559 | static int snd_usb_mixer_dev_free(snd_device_t *device) | 1554 | static int snd_usb_mixer_dev_free(struct snd_device *device) |
1560 | { | 1555 | { |
1561 | struct usb_mixer_interface *mixer = device->device_data; | 1556 | struct usb_mixer_interface *mixer = device->device_data; |
1562 | snd_usb_mixer_free(mixer); | 1557 | snd_usb_mixer_free(mixer); |
@@ -1571,7 +1566,7 @@ static int snd_usb_mixer_dev_free(snd_device_t *device) | |||
1571 | static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) | 1566 | static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) |
1572 | { | 1567 | { |
1573 | unsigned char *desc; | 1568 | unsigned char *desc; |
1574 | mixer_build_t state; | 1569 | struct mixer_build state; |
1575 | int err; | 1570 | int err; |
1576 | const struct usbmix_ctl_map *map; | 1571 | const struct usbmix_ctl_map *map; |
1577 | struct usb_host_interface *hostif; | 1572 | struct usb_host_interface *hostif; |
@@ -1611,7 +1606,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) | |||
1611 | static void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, | 1606 | static void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, |
1612 | int unitid) | 1607 | int unitid) |
1613 | { | 1608 | { |
1614 | usb_mixer_elem_info_t *info; | 1609 | struct usb_mixer_elem_info *info; |
1615 | 1610 | ||
1616 | for (info = mixer->id_elems[unitid]; info; info = info->next_id_elem) | 1611 | for (info = mixer->id_elems[unitid]; info; info = info->next_id_elem) |
1617 | snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, | 1612 | snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, |
@@ -1725,7 +1720,7 @@ static void snd_usb_soundblaster_remote_complete(struct urb *urb, | |||
1725 | wake_up(&mixer->rc_waitq); | 1720 | wake_up(&mixer->rc_waitq); |
1726 | } | 1721 | } |
1727 | 1722 | ||
1728 | static int snd_usb_sbrc_hwdep_open(snd_hwdep_t *hw, struct file *file) | 1723 | static int snd_usb_sbrc_hwdep_open(struct snd_hwdep *hw, struct file *file) |
1729 | { | 1724 | { |
1730 | struct usb_mixer_interface *mixer = hw->private_data; | 1725 | struct usb_mixer_interface *mixer = hw->private_data; |
1731 | 1726 | ||
@@ -1734,7 +1729,7 @@ static int snd_usb_sbrc_hwdep_open(snd_hwdep_t *hw, struct file *file) | |||
1734 | return 0; | 1729 | return 0; |
1735 | } | 1730 | } |
1736 | 1731 | ||
1737 | static int snd_usb_sbrc_hwdep_release(snd_hwdep_t *hw, struct file *file) | 1732 | static int snd_usb_sbrc_hwdep_release(struct snd_hwdep *hw, struct file *file) |
1738 | { | 1733 | { |
1739 | struct usb_mixer_interface *mixer = hw->private_data; | 1734 | struct usb_mixer_interface *mixer = hw->private_data; |
1740 | 1735 | ||
@@ -1743,7 +1738,7 @@ static int snd_usb_sbrc_hwdep_release(snd_hwdep_t *hw, struct file *file) | |||
1743 | return 0; | 1738 | return 0; |
1744 | } | 1739 | } |
1745 | 1740 | ||
1746 | static long snd_usb_sbrc_hwdep_read(snd_hwdep_t *hw, char __user *buf, | 1741 | static long snd_usb_sbrc_hwdep_read(struct snd_hwdep *hw, char __user *buf, |
1747 | long count, loff_t *offset) | 1742 | long count, loff_t *offset) |
1748 | { | 1743 | { |
1749 | struct usb_mixer_interface *mixer = hw->private_data; | 1744 | struct usb_mixer_interface *mixer = hw->private_data; |
@@ -1763,7 +1758,7 @@ static long snd_usb_sbrc_hwdep_read(snd_hwdep_t *hw, char __user *buf, | |||
1763 | return err < 0 ? err : count; | 1758 | return err < 0 ? err : count; |
1764 | } | 1759 | } |
1765 | 1760 | ||
1766 | static unsigned int snd_usb_sbrc_hwdep_poll(snd_hwdep_t *hw, struct file *file, | 1761 | static unsigned int snd_usb_sbrc_hwdep_poll(struct snd_hwdep *hw, struct file *file, |
1767 | poll_table *wait) | 1762 | poll_table *wait) |
1768 | { | 1763 | { |
1769 | struct usb_mixer_interface *mixer = hw->private_data; | 1764 | struct usb_mixer_interface *mixer = hw->private_data; |
@@ -1774,7 +1769,7 @@ static unsigned int snd_usb_sbrc_hwdep_poll(snd_hwdep_t *hw, struct file *file, | |||
1774 | 1769 | ||
1775 | static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer) | 1770 | static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer) |
1776 | { | 1771 | { |
1777 | snd_hwdep_t *hwdep; | 1772 | struct snd_hwdep *hwdep; |
1778 | int err, len; | 1773 | int err, len; |
1779 | 1774 | ||
1780 | switch (mixer->chip->usb_id) { | 1775 | switch (mixer->chip->usb_id) { |
@@ -1825,7 +1820,7 @@ static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer) | |||
1825 | return 0; | 1820 | return 0; |
1826 | } | 1821 | } |
1827 | 1822 | ||
1828 | static int snd_audigy2nx_led_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 1823 | static int snd_audigy2nx_led_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1829 | { | 1824 | { |
1830 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 1825 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
1831 | uinfo->count = 1; | 1826 | uinfo->count = 1; |
@@ -1834,7 +1829,7 @@ static int snd_audigy2nx_led_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1834 | return 0; | 1829 | return 0; |
1835 | } | 1830 | } |
1836 | 1831 | ||
1837 | static int snd_audigy2nx_led_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1832 | static int snd_audigy2nx_led_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1838 | { | 1833 | { |
1839 | struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol); | 1834 | struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol); |
1840 | int index = kcontrol->private_value; | 1835 | int index = kcontrol->private_value; |
@@ -1843,7 +1838,7 @@ static int snd_audigy2nx_led_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1843 | return 0; | 1838 | return 0; |
1844 | } | 1839 | } |
1845 | 1840 | ||
1846 | static int snd_audigy2nx_led_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1841 | static int snd_audigy2nx_led_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1847 | { | 1842 | { |
1848 | struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol); | 1843 | struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol); |
1849 | int index = kcontrol->private_value; | 1844 | int index = kcontrol->private_value; |
@@ -1863,7 +1858,7 @@ static int snd_audigy2nx_led_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
1863 | return changed; | 1858 | return changed; |
1864 | } | 1859 | } |
1865 | 1860 | ||
1866 | static snd_kcontrol_new_t snd_audigy2nx_controls[] = { | 1861 | static struct snd_kcontrol_new snd_audigy2nx_controls[] = { |
1867 | { | 1862 | { |
1868 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1863 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1869 | .name = "CMSS LED Switch", | 1864 | .name = "CMSS LED Switch", |
@@ -1904,8 +1899,8 @@ static int snd_audigy2nx_controls_create(struct usb_mixer_interface *mixer) | |||
1904 | return 0; | 1899 | return 0; |
1905 | } | 1900 | } |
1906 | 1901 | ||
1907 | static void snd_audigy2nx_proc_read(snd_info_entry_t *entry, | 1902 | static void snd_audigy2nx_proc_read(struct snd_info_entry *entry, |
1908 | snd_info_buffer_t *buffer) | 1903 | struct snd_info_buffer *buffer) |
1909 | { | 1904 | { |
1910 | static const struct { | 1905 | static const struct { |
1911 | int unitid; | 1906 | int unitid; |
@@ -1935,9 +1930,9 @@ static void snd_audigy2nx_proc_read(snd_info_entry_t *entry, | |||
1935 | } | 1930 | } |
1936 | } | 1931 | } |
1937 | 1932 | ||
1938 | int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif) | 1933 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif) |
1939 | { | 1934 | { |
1940 | static snd_device_ops_t dev_ops = { | 1935 | static struct snd_device_ops dev_ops = { |
1941 | .dev_free = snd_usb_mixer_dev_free | 1936 | .dev_free = snd_usb_mixer_dev_free |
1942 | }; | 1937 | }; |
1943 | struct usb_mixer_interface *mixer; | 1938 | struct usb_mixer_interface *mixer; |
@@ -1967,7 +1962,7 @@ int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif) | |||
1967 | goto _error; | 1962 | goto _error; |
1968 | 1963 | ||
1969 | if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020)) { | 1964 | if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020)) { |
1970 | snd_info_entry_t *entry; | 1965 | struct snd_info_entry *entry; |
1971 | 1966 | ||
1972 | if ((err = snd_audigy2nx_controls_create(mixer)) < 0) | 1967 | if ((err = snd_audigy2nx_controls_create(mixer)) < 0) |
1973 | goto _error; | 1968 | goto _error; |
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index ba506c3871f4..6190ada00e38 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | #define YAMAHA_DEVICE(id, name) { \ | 46 | #define YAMAHA_DEVICE(id, name) { \ |
47 | USB_DEVICE(0x0499, id), \ | 47 | USB_DEVICE(0x0499, id), \ |
48 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { \ | 48 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { \ |
49 | .vendor_name = "Yamaha", \ | 49 | .vendor_name = "Yamaha", \ |
50 | .product_name = name, \ | 50 | .product_name = name, \ |
51 | .ifnum = QUIRK_ANY_INTERFACE, \ | 51 | .ifnum = QUIRK_ANY_INTERFACE, \ |
@@ -54,7 +54,7 @@ | |||
54 | } | 54 | } |
55 | #define YAMAHA_INTERFACE(id, intf, name) { \ | 55 | #define YAMAHA_INTERFACE(id, intf, name) { \ |
56 | USB_DEVICE_VENDOR_SPEC(0x0499, id), \ | 56 | USB_DEVICE_VENDOR_SPEC(0x0499, id), \ |
57 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { \ | 57 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { \ |
58 | .vendor_name = "Yamaha", \ | 58 | .vendor_name = "Yamaha", \ |
59 | .product_name = name, \ | 59 | .product_name = name, \ |
60 | .ifnum = intf, \ | 60 | .ifnum = intf, \ |
@@ -149,12 +149,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
149 | */ | 149 | */ |
150 | { | 150 | { |
151 | USB_DEVICE(0x0582, 0x0000), | 151 | USB_DEVICE(0x0582, 0x0000), |
152 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 152 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
153 | .vendor_name = "Roland", | 153 | .vendor_name = "Roland", |
154 | .product_name = "UA-100", | 154 | .product_name = "UA-100", |
155 | .ifnum = QUIRK_ANY_INTERFACE, | 155 | .ifnum = QUIRK_ANY_INTERFACE, |
156 | .type = QUIRK_COMPOSITE, | 156 | .type = QUIRK_COMPOSITE, |
157 | .data = (const snd_usb_audio_quirk_t[]) { | 157 | .data = (const struct snd_usb_audio_quirk[]) { |
158 | { | 158 | { |
159 | .ifnum = 0, | 159 | .ifnum = 0, |
160 | .type = QUIRK_AUDIO_FIXED_ENDPOINT, | 160 | .type = QUIRK_AUDIO_FIXED_ENDPOINT, |
@@ -192,7 +192,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
192 | { | 192 | { |
193 | .ifnum = 2, | 193 | .ifnum = 2, |
194 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 194 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
195 | .data = & (const snd_usb_midi_endpoint_info_t) { | 195 | .data = & (const struct snd_usb_midi_endpoint_info) { |
196 | .out_cables = 0x0007, | 196 | .out_cables = 0x0007, |
197 | .in_cables = 0x0007 | 197 | .in_cables = 0x0007 |
198 | } | 198 | } |
@@ -205,12 +205,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
205 | }, | 205 | }, |
206 | { | 206 | { |
207 | USB_DEVICE(0x0582, 0x0002), | 207 | USB_DEVICE(0x0582, 0x0002), |
208 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 208 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
209 | .vendor_name = "EDIROL", | 209 | .vendor_name = "EDIROL", |
210 | .product_name = "UM-4", | 210 | .product_name = "UM-4", |
211 | .ifnum = QUIRK_ANY_INTERFACE, | 211 | .ifnum = QUIRK_ANY_INTERFACE, |
212 | .type = QUIRK_COMPOSITE, | 212 | .type = QUIRK_COMPOSITE, |
213 | .data = (const snd_usb_audio_quirk_t[]) { | 213 | .data = (const struct snd_usb_audio_quirk[]) { |
214 | { | 214 | { |
215 | .ifnum = 0, | 215 | .ifnum = 0, |
216 | .type = QUIRK_IGNORE_INTERFACE | 216 | .type = QUIRK_IGNORE_INTERFACE |
@@ -222,7 +222,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
222 | { | 222 | { |
223 | .ifnum = 2, | 223 | .ifnum = 2, |
224 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 224 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
225 | .data = & (const snd_usb_midi_endpoint_info_t) { | 225 | .data = & (const struct snd_usb_midi_endpoint_info) { |
226 | .out_cables = 0x000f, | 226 | .out_cables = 0x000f, |
227 | .in_cables = 0x000f | 227 | .in_cables = 0x000f |
228 | } | 228 | } |
@@ -235,12 +235,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
235 | }, | 235 | }, |
236 | { | 236 | { |
237 | USB_DEVICE(0x0582, 0x0003), | 237 | USB_DEVICE(0x0582, 0x0003), |
238 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 238 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
239 | .vendor_name = "Roland", | 239 | .vendor_name = "Roland", |
240 | .product_name = "SC-8850", | 240 | .product_name = "SC-8850", |
241 | .ifnum = QUIRK_ANY_INTERFACE, | 241 | .ifnum = QUIRK_ANY_INTERFACE, |
242 | .type = QUIRK_COMPOSITE, | 242 | .type = QUIRK_COMPOSITE, |
243 | .data = (const snd_usb_audio_quirk_t[]) { | 243 | .data = (const struct snd_usb_audio_quirk[]) { |
244 | { | 244 | { |
245 | .ifnum = 0, | 245 | .ifnum = 0, |
246 | .type = QUIRK_IGNORE_INTERFACE | 246 | .type = QUIRK_IGNORE_INTERFACE |
@@ -252,7 +252,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
252 | { | 252 | { |
253 | .ifnum = 2, | 253 | .ifnum = 2, |
254 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 254 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
255 | .data = & (const snd_usb_midi_endpoint_info_t) { | 255 | .data = & (const struct snd_usb_midi_endpoint_info) { |
256 | .out_cables = 0x003f, | 256 | .out_cables = 0x003f, |
257 | .in_cables = 0x003f | 257 | .in_cables = 0x003f |
258 | } | 258 | } |
@@ -265,12 +265,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
265 | }, | 265 | }, |
266 | { | 266 | { |
267 | USB_DEVICE(0x0582, 0x0004), | 267 | USB_DEVICE(0x0582, 0x0004), |
268 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 268 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
269 | .vendor_name = "Roland", | 269 | .vendor_name = "Roland", |
270 | .product_name = "U-8", | 270 | .product_name = "U-8", |
271 | .ifnum = QUIRK_ANY_INTERFACE, | 271 | .ifnum = QUIRK_ANY_INTERFACE, |
272 | .type = QUIRK_COMPOSITE, | 272 | .type = QUIRK_COMPOSITE, |
273 | .data = (const snd_usb_audio_quirk_t[]) { | 273 | .data = (const struct snd_usb_audio_quirk[]) { |
274 | { | 274 | { |
275 | .ifnum = 0, | 275 | .ifnum = 0, |
276 | .type = QUIRK_IGNORE_INTERFACE | 276 | .type = QUIRK_IGNORE_INTERFACE |
@@ -282,7 +282,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
282 | { | 282 | { |
283 | .ifnum = 2, | 283 | .ifnum = 2, |
284 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 284 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
285 | .data = & (const snd_usb_midi_endpoint_info_t) { | 285 | .data = & (const struct snd_usb_midi_endpoint_info) { |
286 | .out_cables = 0x0005, | 286 | .out_cables = 0x0005, |
287 | .in_cables = 0x0005 | 287 | .in_cables = 0x0005 |
288 | } | 288 | } |
@@ -296,12 +296,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
296 | { | 296 | { |
297 | /* a later revision uses ID 0x0099 */ | 297 | /* a later revision uses ID 0x0099 */ |
298 | USB_DEVICE(0x0582, 0x0005), | 298 | USB_DEVICE(0x0582, 0x0005), |
299 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 299 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
300 | .vendor_name = "EDIROL", | 300 | .vendor_name = "EDIROL", |
301 | .product_name = "UM-2", | 301 | .product_name = "UM-2", |
302 | .ifnum = QUIRK_ANY_INTERFACE, | 302 | .ifnum = QUIRK_ANY_INTERFACE, |
303 | .type = QUIRK_COMPOSITE, | 303 | .type = QUIRK_COMPOSITE, |
304 | .data = (const snd_usb_audio_quirk_t[]) { | 304 | .data = (const struct snd_usb_audio_quirk[]) { |
305 | { | 305 | { |
306 | .ifnum = 0, | 306 | .ifnum = 0, |
307 | .type = QUIRK_IGNORE_INTERFACE | 307 | .type = QUIRK_IGNORE_INTERFACE |
@@ -313,7 +313,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
313 | { | 313 | { |
314 | .ifnum = 2, | 314 | .ifnum = 2, |
315 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 315 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
316 | .data = & (const snd_usb_midi_endpoint_info_t) { | 316 | .data = & (const struct snd_usb_midi_endpoint_info) { |
317 | .out_cables = 0x0003, | 317 | .out_cables = 0x0003, |
318 | .in_cables = 0x0003 | 318 | .in_cables = 0x0003 |
319 | } | 319 | } |
@@ -326,12 +326,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
326 | }, | 326 | }, |
327 | { | 327 | { |
328 | USB_DEVICE(0x0582, 0x0007), | 328 | USB_DEVICE(0x0582, 0x0007), |
329 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 329 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
330 | .vendor_name = "Roland", | 330 | .vendor_name = "Roland", |
331 | .product_name = "SC-8820", | 331 | .product_name = "SC-8820", |
332 | .ifnum = QUIRK_ANY_INTERFACE, | 332 | .ifnum = QUIRK_ANY_INTERFACE, |
333 | .type = QUIRK_COMPOSITE, | 333 | .type = QUIRK_COMPOSITE, |
334 | .data = (const snd_usb_audio_quirk_t[]) { | 334 | .data = (const struct snd_usb_audio_quirk[]) { |
335 | { | 335 | { |
336 | .ifnum = 0, | 336 | .ifnum = 0, |
337 | .type = QUIRK_IGNORE_INTERFACE | 337 | .type = QUIRK_IGNORE_INTERFACE |
@@ -343,7 +343,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
343 | { | 343 | { |
344 | .ifnum = 2, | 344 | .ifnum = 2, |
345 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 345 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
346 | .data = & (const snd_usb_midi_endpoint_info_t) { | 346 | .data = & (const struct snd_usb_midi_endpoint_info) { |
347 | .out_cables = 0x0013, | 347 | .out_cables = 0x0013, |
348 | .in_cables = 0x0013 | 348 | .in_cables = 0x0013 |
349 | } | 349 | } |
@@ -356,12 +356,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
356 | }, | 356 | }, |
357 | { | 357 | { |
358 | USB_DEVICE(0x0582, 0x0008), | 358 | USB_DEVICE(0x0582, 0x0008), |
359 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 359 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
360 | .vendor_name = "Roland", | 360 | .vendor_name = "Roland", |
361 | .product_name = "PC-300", | 361 | .product_name = "PC-300", |
362 | .ifnum = QUIRK_ANY_INTERFACE, | 362 | .ifnum = QUIRK_ANY_INTERFACE, |
363 | .type = QUIRK_COMPOSITE, | 363 | .type = QUIRK_COMPOSITE, |
364 | .data = (const snd_usb_audio_quirk_t[]) { | 364 | .data = (const struct snd_usb_audio_quirk[]) { |
365 | { | 365 | { |
366 | .ifnum = 0, | 366 | .ifnum = 0, |
367 | .type = QUIRK_IGNORE_INTERFACE | 367 | .type = QUIRK_IGNORE_INTERFACE |
@@ -373,7 +373,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
373 | { | 373 | { |
374 | .ifnum = 2, | 374 | .ifnum = 2, |
375 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 375 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
376 | .data = & (const snd_usb_midi_endpoint_info_t) { | 376 | .data = & (const struct snd_usb_midi_endpoint_info) { |
377 | .out_cables = 0x0001, | 377 | .out_cables = 0x0001, |
378 | .in_cables = 0x0001 | 378 | .in_cables = 0x0001 |
379 | } | 379 | } |
@@ -387,12 +387,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
387 | { | 387 | { |
388 | /* a later revision uses ID 0x009d */ | 388 | /* a later revision uses ID 0x009d */ |
389 | USB_DEVICE(0x0582, 0x0009), | 389 | USB_DEVICE(0x0582, 0x0009), |
390 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 390 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
391 | .vendor_name = "EDIROL", | 391 | .vendor_name = "EDIROL", |
392 | .product_name = "UM-1", | 392 | .product_name = "UM-1", |
393 | .ifnum = QUIRK_ANY_INTERFACE, | 393 | .ifnum = QUIRK_ANY_INTERFACE, |
394 | .type = QUIRK_COMPOSITE, | 394 | .type = QUIRK_COMPOSITE, |
395 | .data = (const snd_usb_audio_quirk_t[]) { | 395 | .data = (const struct snd_usb_audio_quirk[]) { |
396 | { | 396 | { |
397 | .ifnum = 0, | 397 | .ifnum = 0, |
398 | .type = QUIRK_IGNORE_INTERFACE | 398 | .type = QUIRK_IGNORE_INTERFACE |
@@ -404,7 +404,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
404 | { | 404 | { |
405 | .ifnum = 2, | 405 | .ifnum = 2, |
406 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 406 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
407 | .data = & (const snd_usb_midi_endpoint_info_t) { | 407 | .data = & (const struct snd_usb_midi_endpoint_info) { |
408 | .out_cables = 0x0001, | 408 | .out_cables = 0x0001, |
409 | .in_cables = 0x0001 | 409 | .in_cables = 0x0001 |
410 | } | 410 | } |
@@ -417,12 +417,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
417 | }, | 417 | }, |
418 | { | 418 | { |
419 | USB_DEVICE(0x0582, 0x000b), | 419 | USB_DEVICE(0x0582, 0x000b), |
420 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 420 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
421 | .vendor_name = "Roland", | 421 | .vendor_name = "Roland", |
422 | .product_name = "SK-500", | 422 | .product_name = "SK-500", |
423 | .ifnum = QUIRK_ANY_INTERFACE, | 423 | .ifnum = QUIRK_ANY_INTERFACE, |
424 | .type = QUIRK_COMPOSITE, | 424 | .type = QUIRK_COMPOSITE, |
425 | .data = (const snd_usb_audio_quirk_t[]) { | 425 | .data = (const struct snd_usb_audio_quirk[]) { |
426 | { | 426 | { |
427 | .ifnum = 0, | 427 | .ifnum = 0, |
428 | .type = QUIRK_IGNORE_INTERFACE | 428 | .type = QUIRK_IGNORE_INTERFACE |
@@ -434,7 +434,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
434 | { | 434 | { |
435 | .ifnum = 2, | 435 | .ifnum = 2, |
436 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 436 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
437 | .data = & (const snd_usb_midi_endpoint_info_t) { | 437 | .data = & (const struct snd_usb_midi_endpoint_info) { |
438 | .out_cables = 0x0013, | 438 | .out_cables = 0x0013, |
439 | .in_cables = 0x0013 | 439 | .in_cables = 0x0013 |
440 | } | 440 | } |
@@ -449,12 +449,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
449 | /* thanks to Emiliano Grilli <emillo@libero.it> | 449 | /* thanks to Emiliano Grilli <emillo@libero.it> |
450 | * for helping researching this data */ | 450 | * for helping researching this data */ |
451 | USB_DEVICE(0x0582, 0x000c), | 451 | USB_DEVICE(0x0582, 0x000c), |
452 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 452 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
453 | .vendor_name = "Roland", | 453 | .vendor_name = "Roland", |
454 | .product_name = "SC-D70", | 454 | .product_name = "SC-D70", |
455 | .ifnum = QUIRK_ANY_INTERFACE, | 455 | .ifnum = QUIRK_ANY_INTERFACE, |
456 | .type = QUIRK_COMPOSITE, | 456 | .type = QUIRK_COMPOSITE, |
457 | .data = (const snd_usb_audio_quirk_t[]) { | 457 | .data = (const struct snd_usb_audio_quirk[]) { |
458 | { | 458 | { |
459 | .ifnum = 0, | 459 | .ifnum = 0, |
460 | .type = QUIRK_AUDIO_FIXED_ENDPOINT, | 460 | .type = QUIRK_AUDIO_FIXED_ENDPOINT, |
@@ -492,7 +492,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
492 | { | 492 | { |
493 | .ifnum = 2, | 493 | .ifnum = 2, |
494 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 494 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
495 | .data = & (const snd_usb_midi_endpoint_info_t) { | 495 | .data = & (const struct snd_usb_midi_endpoint_info) { |
496 | .out_cables = 0x0007, | 496 | .out_cables = 0x0007, |
497 | .in_cables = 0x0007 | 497 | .in_cables = 0x0007 |
498 | } | 498 | } |
@@ -513,12 +513,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
513 | * the 96kHz sample rate. | 513 | * the 96kHz sample rate. |
514 | */ | 514 | */ |
515 | USB_DEVICE(0x0582, 0x0010), | 515 | USB_DEVICE(0x0582, 0x0010), |
516 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 516 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
517 | .vendor_name = "EDIROL", | 517 | .vendor_name = "EDIROL", |
518 | .product_name = "UA-5", | 518 | .product_name = "UA-5", |
519 | .ifnum = QUIRK_ANY_INTERFACE, | 519 | .ifnum = QUIRK_ANY_INTERFACE, |
520 | .type = QUIRK_COMPOSITE, | 520 | .type = QUIRK_COMPOSITE, |
521 | .data = (const snd_usb_audio_quirk_t[]) { | 521 | .data = (const struct snd_usb_audio_quirk[]) { |
522 | { | 522 | { |
523 | .ifnum = 1, | 523 | .ifnum = 1, |
524 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | 524 | .type = QUIRK_AUDIO_STANDARD_INTERFACE |
@@ -536,12 +536,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
536 | { | 536 | { |
537 | /* has ID 0x0013 when not in "Advanced Driver" mode */ | 537 | /* has ID 0x0013 when not in "Advanced Driver" mode */ |
538 | USB_DEVICE(0x0582, 0x0012), | 538 | USB_DEVICE(0x0582, 0x0012), |
539 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 539 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
540 | .vendor_name = "Roland", | 540 | .vendor_name = "Roland", |
541 | .product_name = "XV-5050", | 541 | .product_name = "XV-5050", |
542 | .ifnum = 0, | 542 | .ifnum = 0, |
543 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 543 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
544 | .data = & (const snd_usb_midi_endpoint_info_t) { | 544 | .data = & (const struct snd_usb_midi_endpoint_info) { |
545 | .out_cables = 0x0001, | 545 | .out_cables = 0x0001, |
546 | .in_cables = 0x0001 | 546 | .in_cables = 0x0001 |
547 | } | 547 | } |
@@ -550,12 +550,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
550 | { | 550 | { |
551 | /* has ID 0x0015 when not in "Advanced Driver" mode */ | 551 | /* has ID 0x0015 when not in "Advanced Driver" mode */ |
552 | USB_DEVICE(0x0582, 0x0014), | 552 | USB_DEVICE(0x0582, 0x0014), |
553 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 553 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
554 | .vendor_name = "EDIROL", | 554 | .vendor_name = "EDIROL", |
555 | .product_name = "UM-880", | 555 | .product_name = "UM-880", |
556 | .ifnum = 0, | 556 | .ifnum = 0, |
557 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 557 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
558 | .data = & (const snd_usb_midi_endpoint_info_t) { | 558 | .data = & (const struct snd_usb_midi_endpoint_info) { |
559 | .out_cables = 0x01ff, | 559 | .out_cables = 0x01ff, |
560 | .in_cables = 0x01ff | 560 | .in_cables = 0x01ff |
561 | } | 561 | } |
@@ -564,12 +564,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
564 | { | 564 | { |
565 | /* has ID 0x0017 when not in "Advanced Driver" mode */ | 565 | /* has ID 0x0017 when not in "Advanced Driver" mode */ |
566 | USB_DEVICE(0x0582, 0x0016), | 566 | USB_DEVICE(0x0582, 0x0016), |
567 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 567 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
568 | .vendor_name = "EDIROL", | 568 | .vendor_name = "EDIROL", |
569 | .product_name = "SD-90", | 569 | .product_name = "SD-90", |
570 | .ifnum = QUIRK_ANY_INTERFACE, | 570 | .ifnum = QUIRK_ANY_INTERFACE, |
571 | .type = QUIRK_COMPOSITE, | 571 | .type = QUIRK_COMPOSITE, |
572 | .data = (const snd_usb_audio_quirk_t[]) { | 572 | .data = (const struct snd_usb_audio_quirk[]) { |
573 | { | 573 | { |
574 | .ifnum = 0, | 574 | .ifnum = 0, |
575 | .type = QUIRK_IGNORE_INTERFACE | 575 | .type = QUIRK_IGNORE_INTERFACE |
@@ -581,7 +581,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
581 | { | 581 | { |
582 | .ifnum = 2, | 582 | .ifnum = 2, |
583 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 583 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
584 | .data = & (const snd_usb_midi_endpoint_info_t) { | 584 | .data = & (const struct snd_usb_midi_endpoint_info) { |
585 | .out_cables = 0x000f, | 585 | .out_cables = 0x000f, |
586 | .in_cables = 0x000f | 586 | .in_cables = 0x000f |
587 | } | 587 | } |
@@ -595,12 +595,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
595 | { | 595 | { |
596 | /* has ID 0x001c when not in "Advanced Driver" mode */ | 596 | /* has ID 0x001c when not in "Advanced Driver" mode */ |
597 | USB_DEVICE(0x0582, 0x001b), | 597 | USB_DEVICE(0x0582, 0x001b), |
598 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 598 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
599 | .vendor_name = "Roland", | 599 | .vendor_name = "Roland", |
600 | .product_name = "MMP-2", | 600 | .product_name = "MMP-2", |
601 | .ifnum = QUIRK_ANY_INTERFACE, | 601 | .ifnum = QUIRK_ANY_INTERFACE, |
602 | .type = QUIRK_COMPOSITE, | 602 | .type = QUIRK_COMPOSITE, |
603 | .data = (const snd_usb_audio_quirk_t[]) { | 603 | .data = (const struct snd_usb_audio_quirk[]) { |
604 | { | 604 | { |
605 | .ifnum = 0, | 605 | .ifnum = 0, |
606 | .type = QUIRK_IGNORE_INTERFACE | 606 | .type = QUIRK_IGNORE_INTERFACE |
@@ -612,7 +612,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
612 | { | 612 | { |
613 | .ifnum = 2, | 613 | .ifnum = 2, |
614 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 614 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
615 | .data = & (const snd_usb_midi_endpoint_info_t) { | 615 | .data = & (const struct snd_usb_midi_endpoint_info) { |
616 | .out_cables = 0x0001, | 616 | .out_cables = 0x0001, |
617 | .in_cables = 0x0001 | 617 | .in_cables = 0x0001 |
618 | } | 618 | } |
@@ -626,12 +626,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
626 | { | 626 | { |
627 | /* has ID 0x001e when not in "Advanced Driver" mode */ | 627 | /* has ID 0x001e when not in "Advanced Driver" mode */ |
628 | USB_DEVICE(0x0582, 0x001d), | 628 | USB_DEVICE(0x0582, 0x001d), |
629 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 629 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
630 | .vendor_name = "Roland", | 630 | .vendor_name = "Roland", |
631 | .product_name = "V-SYNTH", | 631 | .product_name = "V-SYNTH", |
632 | .ifnum = 0, | 632 | .ifnum = 0, |
633 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 633 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
634 | .data = & (const snd_usb_midi_endpoint_info_t) { | 634 | .data = & (const struct snd_usb_midi_endpoint_info) { |
635 | .out_cables = 0x0001, | 635 | .out_cables = 0x0001, |
636 | .in_cables = 0x0001 | 636 | .in_cables = 0x0001 |
637 | } | 637 | } |
@@ -640,12 +640,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
640 | { | 640 | { |
641 | /* has ID 0x0024 when not in "Advanced Driver" mode */ | 641 | /* has ID 0x0024 when not in "Advanced Driver" mode */ |
642 | USB_DEVICE(0x0582, 0x0023), | 642 | USB_DEVICE(0x0582, 0x0023), |
643 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 643 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
644 | .vendor_name = "EDIROL", | 644 | .vendor_name = "EDIROL", |
645 | .product_name = "UM-550", | 645 | .product_name = "UM-550", |
646 | .ifnum = 0, | 646 | .ifnum = 0, |
647 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 647 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
648 | .data = & (const snd_usb_midi_endpoint_info_t) { | 648 | .data = & (const struct snd_usb_midi_endpoint_info) { |
649 | .out_cables = 0x003f, | 649 | .out_cables = 0x003f, |
650 | .in_cables = 0x003f | 650 | .in_cables = 0x003f |
651 | } | 651 | } |
@@ -658,23 +658,57 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
658 | * and no MIDI. | 658 | * and no MIDI. |
659 | */ | 659 | */ |
660 | USB_DEVICE(0x0582, 0x0025), | 660 | USB_DEVICE(0x0582, 0x0025), |
661 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 661 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
662 | .vendor_name = "EDIROL", | 662 | .vendor_name = "EDIROL", |
663 | .product_name = "UA-20", | 663 | .product_name = "UA-20", |
664 | .ifnum = QUIRK_ANY_INTERFACE, | 664 | .ifnum = QUIRK_ANY_INTERFACE, |
665 | .type = QUIRK_COMPOSITE, | 665 | .type = QUIRK_COMPOSITE, |
666 | .data = (const snd_usb_audio_quirk_t[]) { | 666 | .data = (const struct snd_usb_audio_quirk[]) { |
667 | { | ||
668 | .ifnum = 0, | ||
669 | .type = QUIRK_IGNORE_INTERFACE | ||
670 | }, | ||
667 | { | 671 | { |
668 | .ifnum = 1, | 672 | .ifnum = 1, |
669 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | 673 | .type = QUIRK_AUDIO_FIXED_ENDPOINT, |
674 | .data = & (const struct audioformat) { | ||
675 | .format = SNDRV_PCM_FORMAT_S24_3LE, | ||
676 | .channels = 2, | ||
677 | .iface = 1, | ||
678 | .altsetting = 1, | ||
679 | .altset_idx = 1, | ||
680 | .attributes = 0, | ||
681 | .endpoint = 0x01, | ||
682 | .ep_attr = 0x01, | ||
683 | .rates = SNDRV_PCM_RATE_CONTINUOUS, | ||
684 | .rate_min = 44100, | ||
685 | .rate_max = 44100, | ||
686 | } | ||
670 | }, | 687 | }, |
671 | { | 688 | { |
672 | .ifnum = 2, | 689 | .ifnum = 2, |
673 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | 690 | .type = QUIRK_AUDIO_FIXED_ENDPOINT, |
691 | .data = & (const struct audioformat) { | ||
692 | .format = SNDRV_PCM_FORMAT_S24_3LE, | ||
693 | .channels = 2, | ||
694 | .iface = 2, | ||
695 | .altsetting = 1, | ||
696 | .altset_idx = 1, | ||
697 | .attributes = 0, | ||
698 | .endpoint = 0x82, | ||
699 | .ep_attr = 0x01, | ||
700 | .rates = SNDRV_PCM_RATE_CONTINUOUS, | ||
701 | .rate_min = 44100, | ||
702 | .rate_max = 44100, | ||
703 | } | ||
674 | }, | 704 | }, |
675 | { | 705 | { |
676 | .ifnum = 3, | 706 | .ifnum = 3, |
677 | .type = QUIRK_MIDI_STANDARD_INTERFACE | 707 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
708 | .data = & (const struct snd_usb_midi_endpoint_info) { | ||
709 | .out_cables = 0x0001, | ||
710 | .in_cables = 0x0001 | ||
711 | } | ||
678 | }, | 712 | }, |
679 | { | 713 | { |
680 | .ifnum = -1 | 714 | .ifnum = -1 |
@@ -685,12 +719,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
685 | { | 719 | { |
686 | /* has ID 0x0028 when not in "Advanced Driver" mode */ | 720 | /* has ID 0x0028 when not in "Advanced Driver" mode */ |
687 | USB_DEVICE(0x0582, 0x0027), | 721 | USB_DEVICE(0x0582, 0x0027), |
688 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 722 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
689 | .vendor_name = "EDIROL", | 723 | .vendor_name = "EDIROL", |
690 | .product_name = "SD-20", | 724 | .product_name = "SD-20", |
691 | .ifnum = 0, | 725 | .ifnum = 0, |
692 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 726 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
693 | .data = & (const snd_usb_midi_endpoint_info_t) { | 727 | .data = & (const struct snd_usb_midi_endpoint_info) { |
694 | .out_cables = 0x0003, | 728 | .out_cables = 0x0003, |
695 | .in_cables = 0x0007 | 729 | .in_cables = 0x0007 |
696 | } | 730 | } |
@@ -699,12 +733,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
699 | { | 733 | { |
700 | /* has ID 0x002a when not in "Advanced Driver" mode */ | 734 | /* has ID 0x002a when not in "Advanced Driver" mode */ |
701 | USB_DEVICE(0x0582, 0x0029), | 735 | USB_DEVICE(0x0582, 0x0029), |
702 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 736 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
703 | .vendor_name = "EDIROL", | 737 | .vendor_name = "EDIROL", |
704 | .product_name = "SD-80", | 738 | .product_name = "SD-80", |
705 | .ifnum = 0, | 739 | .ifnum = 0, |
706 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 740 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
707 | .data = & (const snd_usb_midi_endpoint_info_t) { | 741 | .data = & (const struct snd_usb_midi_endpoint_info) { |
708 | .out_cables = 0x000f, | 742 | .out_cables = 0x000f, |
709 | .in_cables = 0x000f | 743 | .in_cables = 0x000f |
710 | } | 744 | } |
@@ -717,12 +751,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
717 | * but offers only 16-bit PCM and no MIDI. | 751 | * but offers only 16-bit PCM and no MIDI. |
718 | */ | 752 | */ |
719 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x002b), | 753 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x002b), |
720 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 754 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
721 | .vendor_name = "EDIROL", | 755 | .vendor_name = "EDIROL", |
722 | .product_name = "UA-700", | 756 | .product_name = "UA-700", |
723 | .ifnum = QUIRK_ANY_INTERFACE, | 757 | .ifnum = QUIRK_ANY_INTERFACE, |
724 | .type = QUIRK_COMPOSITE, | 758 | .type = QUIRK_COMPOSITE, |
725 | .data = (const snd_usb_audio_quirk_t[]) { | 759 | .data = (const struct snd_usb_audio_quirk[]) { |
726 | { | 760 | { |
727 | .ifnum = 1, | 761 | .ifnum = 1, |
728 | .type = QUIRK_AUDIO_EDIROL_UA700_UA25 | 762 | .type = QUIRK_AUDIO_EDIROL_UA700_UA25 |
@@ -744,12 +778,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
744 | { | 778 | { |
745 | /* has ID 0x002e when not in "Advanced Driver" mode */ | 779 | /* has ID 0x002e when not in "Advanced Driver" mode */ |
746 | USB_DEVICE(0x0582, 0x002d), | 780 | USB_DEVICE(0x0582, 0x002d), |
747 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 781 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
748 | .vendor_name = "Roland", | 782 | .vendor_name = "Roland", |
749 | .product_name = "XV-2020", | 783 | .product_name = "XV-2020", |
750 | .ifnum = 0, | 784 | .ifnum = 0, |
751 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 785 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
752 | .data = & (const snd_usb_midi_endpoint_info_t) { | 786 | .data = & (const struct snd_usb_midi_endpoint_info) { |
753 | .out_cables = 0x0001, | 787 | .out_cables = 0x0001, |
754 | .in_cables = 0x0001 | 788 | .in_cables = 0x0001 |
755 | } | 789 | } |
@@ -758,12 +792,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
758 | { | 792 | { |
759 | /* has ID 0x0030 when not in "Advanced Driver" mode */ | 793 | /* has ID 0x0030 when not in "Advanced Driver" mode */ |
760 | USB_DEVICE(0x0582, 0x002f), | 794 | USB_DEVICE(0x0582, 0x002f), |
761 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 795 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
762 | .vendor_name = "Roland", | 796 | .vendor_name = "Roland", |
763 | .product_name = "VariOS", | 797 | .product_name = "VariOS", |
764 | .ifnum = 0, | 798 | .ifnum = 0, |
765 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 799 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
766 | .data = & (const snd_usb_midi_endpoint_info_t) { | 800 | .data = & (const struct snd_usb_midi_endpoint_info) { |
767 | .out_cables = 0x0007, | 801 | .out_cables = 0x0007, |
768 | .in_cables = 0x0007 | 802 | .in_cables = 0x0007 |
769 | } | 803 | } |
@@ -772,12 +806,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
772 | { | 806 | { |
773 | /* has ID 0x0034 when not in "Advanced Driver" mode */ | 807 | /* has ID 0x0034 when not in "Advanced Driver" mode */ |
774 | USB_DEVICE(0x0582, 0x0033), | 808 | USB_DEVICE(0x0582, 0x0033), |
775 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 809 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
776 | .vendor_name = "EDIROL", | 810 | .vendor_name = "EDIROL", |
777 | .product_name = "PCR", | 811 | .product_name = "PCR", |
778 | .ifnum = 0, | 812 | .ifnum = 0, |
779 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 813 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
780 | .data = & (const snd_usb_midi_endpoint_info_t) { | 814 | .data = & (const struct snd_usb_midi_endpoint_info) { |
781 | .out_cables = 0x0003, | 815 | .out_cables = 0x0003, |
782 | .in_cables = 0x0007 | 816 | .in_cables = 0x0007 |
783 | } | 817 | } |
@@ -790,12 +824,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
790 | * later revisions use IDs 0x0054 and 0x00a2. | 824 | * later revisions use IDs 0x0054 and 0x00a2. |
791 | */ | 825 | */ |
792 | USB_DEVICE(0x0582, 0x0037), | 826 | USB_DEVICE(0x0582, 0x0037), |
793 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 827 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
794 | .vendor_name = "Roland", | 828 | .vendor_name = "Roland", |
795 | .product_name = "Digital Piano", | 829 | .product_name = "Digital Piano", |
796 | .ifnum = 0, | 830 | .ifnum = 0, |
797 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 831 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
798 | .data = & (const snd_usb_midi_endpoint_info_t) { | 832 | .data = & (const struct snd_usb_midi_endpoint_info) { |
799 | .out_cables = 0x0001, | 833 | .out_cables = 0x0001, |
800 | .in_cables = 0x0001 | 834 | .in_cables = 0x0001 |
801 | } | 835 | } |
@@ -808,12 +842,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
808 | * and no MIDI. | 842 | * and no MIDI. |
809 | */ | 843 | */ |
810 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x003b), | 844 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x003b), |
811 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 845 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
812 | .vendor_name = "BOSS", | 846 | .vendor_name = "BOSS", |
813 | .product_name = "GS-10", | 847 | .product_name = "GS-10", |
814 | .ifnum = QUIRK_ANY_INTERFACE, | 848 | .ifnum = QUIRK_ANY_INTERFACE, |
815 | .type = QUIRK_COMPOSITE, | 849 | .type = QUIRK_COMPOSITE, |
816 | .data = & (const snd_usb_audio_quirk_t[]) { | 850 | .data = & (const struct snd_usb_audio_quirk[]) { |
817 | { | 851 | { |
818 | .ifnum = 1, | 852 | .ifnum = 1, |
819 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | 853 | .type = QUIRK_AUDIO_STANDARD_INTERFACE |
@@ -835,12 +869,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
835 | { | 869 | { |
836 | /* has ID 0x0041 when not in "Advanced Driver" mode */ | 870 | /* has ID 0x0041 when not in "Advanced Driver" mode */ |
837 | USB_DEVICE(0x0582, 0x0040), | 871 | USB_DEVICE(0x0582, 0x0040), |
838 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 872 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
839 | .vendor_name = "Roland", | 873 | .vendor_name = "Roland", |
840 | .product_name = "GI-20", | 874 | .product_name = "GI-20", |
841 | .ifnum = 0, | 875 | .ifnum = 0, |
842 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 876 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
843 | .data = & (const snd_usb_midi_endpoint_info_t) { | 877 | .data = & (const struct snd_usb_midi_endpoint_info) { |
844 | .out_cables = 0x0001, | 878 | .out_cables = 0x0001, |
845 | .in_cables = 0x0001 | 879 | .in_cables = 0x0001 |
846 | } | 880 | } |
@@ -849,12 +883,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
849 | { | 883 | { |
850 | /* has ID 0x0043 when not in "Advanced Driver" mode */ | 884 | /* has ID 0x0043 when not in "Advanced Driver" mode */ |
851 | USB_DEVICE(0x0582, 0x0042), | 885 | USB_DEVICE(0x0582, 0x0042), |
852 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 886 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
853 | .vendor_name = "Roland", | 887 | .vendor_name = "Roland", |
854 | .product_name = "RS-70", | 888 | .product_name = "RS-70", |
855 | .ifnum = 0, | 889 | .ifnum = 0, |
856 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 890 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
857 | .data = & (const snd_usb_midi_endpoint_info_t) { | 891 | .data = & (const struct snd_usb_midi_endpoint_info) { |
858 | .out_cables = 0x0001, | 892 | .out_cables = 0x0001, |
859 | .in_cables = 0x0001 | 893 | .in_cables = 0x0001 |
860 | } | 894 | } |
@@ -862,12 +896,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
862 | }, | 896 | }, |
863 | { | 897 | { |
864 | USB_DEVICE(0x0582, 0x0044), | 898 | USB_DEVICE(0x0582, 0x0044), |
865 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 899 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
866 | .vendor_name = "Roland", | 900 | .vendor_name = "Roland", |
867 | .product_name = "UA-1000", | 901 | .product_name = "UA-1000", |
868 | .ifnum = QUIRK_ANY_INTERFACE, | 902 | .ifnum = QUIRK_ANY_INTERFACE, |
869 | .type = QUIRK_COMPOSITE, | 903 | .type = QUIRK_COMPOSITE, |
870 | .data = (const snd_usb_audio_quirk_t[]) { | 904 | .data = (const struct snd_usb_audio_quirk[]) { |
871 | { | 905 | { |
872 | .ifnum = 1, | 906 | .ifnum = 1, |
873 | .type = QUIRK_AUDIO_EDIROL_UA1000 | 907 | .type = QUIRK_AUDIO_EDIROL_UA1000 |
@@ -879,7 +913,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
879 | { | 913 | { |
880 | .ifnum = 3, | 914 | .ifnum = 3, |
881 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 915 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
882 | .data = & (const snd_usb_midi_endpoint_info_t) { | 916 | .data = & (const struct snd_usb_midi_endpoint_info) { |
883 | .out_cables = 0x0003, | 917 | .out_cables = 0x0003, |
884 | .in_cables = 0x0003 | 918 | .in_cables = 0x0003 |
885 | } | 919 | } |
@@ -893,12 +927,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
893 | { | 927 | { |
894 | /* has ID 0x004a when not in "Advanced Driver" mode */ | 928 | /* has ID 0x004a when not in "Advanced Driver" mode */ |
895 | USB_DEVICE(0x0582, 0x0048), | 929 | USB_DEVICE(0x0582, 0x0048), |
896 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 930 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
897 | .vendor_name = "EDIROL", | 931 | .vendor_name = "EDIROL", |
898 | .product_name = "UR-80", | 932 | .product_name = "UR-80", |
899 | .ifnum = 0, | 933 | .ifnum = 0, |
900 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 934 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
901 | .data = & (const snd_usb_midi_endpoint_info_t) { | 935 | .data = & (const struct snd_usb_midi_endpoint_info) { |
902 | .out_cables = 0x0003, | 936 | .out_cables = 0x0003, |
903 | .in_cables = 0x0007 | 937 | .in_cables = 0x0007 |
904 | } | 938 | } |
@@ -908,12 +942,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
908 | { | 942 | { |
909 | /* has ID 0x004f when not in "Advanced Driver" mode */ | 943 | /* has ID 0x004f when not in "Advanced Driver" mode */ |
910 | USB_DEVICE(0x0582, 0x004d), | 944 | USB_DEVICE(0x0582, 0x004d), |
911 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 945 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
912 | .vendor_name = "EDIROL", | 946 | .vendor_name = "EDIROL", |
913 | .product_name = "PCR-A", | 947 | .product_name = "PCR-A", |
914 | .ifnum = 0, | 948 | .ifnum = 0, |
915 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 949 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
916 | .data = & (const snd_usb_midi_endpoint_info_t) { | 950 | .data = & (const struct snd_usb_midi_endpoint_info) { |
917 | .out_cables = 0x0003, | 951 | .out_cables = 0x0003, |
918 | .in_cables = 0x0007 | 952 | .in_cables = 0x0007 |
919 | } | 953 | } |
@@ -925,12 +959,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
925 | * is standard compliant, but has only 16-bit PCM. | 959 | * is standard compliant, but has only 16-bit PCM. |
926 | */ | 960 | */ |
927 | USB_DEVICE(0x0582, 0x0050), | 961 | USB_DEVICE(0x0582, 0x0050), |
928 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 962 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
929 | .vendor_name = "EDIROL", | 963 | .vendor_name = "EDIROL", |
930 | .product_name = "UA-3FX", | 964 | .product_name = "UA-3FX", |
931 | .ifnum = QUIRK_ANY_INTERFACE, | 965 | .ifnum = QUIRK_ANY_INTERFACE, |
932 | .type = QUIRK_COMPOSITE, | 966 | .type = QUIRK_COMPOSITE, |
933 | .data = (const snd_usb_audio_quirk_t[]) { | 967 | .data = (const struct snd_usb_audio_quirk[]) { |
934 | { | 968 | { |
935 | .ifnum = 1, | 969 | .ifnum = 1, |
936 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | 970 | .type = QUIRK_AUDIO_STANDARD_INTERFACE |
@@ -947,7 +981,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
947 | }, | 981 | }, |
948 | { | 982 | { |
949 | USB_DEVICE(0x0582, 0x0052), | 983 | USB_DEVICE(0x0582, 0x0052), |
950 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 984 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
951 | .vendor_name = "EDIROL", | 985 | .vendor_name = "EDIROL", |
952 | .product_name = "UM-1SX", | 986 | .product_name = "UM-1SX", |
953 | .ifnum = 0, | 987 | .ifnum = 0, |
@@ -958,12 +992,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
958 | { | 992 | { |
959 | /* has ID 0x0067 when not in "Advanced Driver" mode */ | 993 | /* has ID 0x0067 when not in "Advanced Driver" mode */ |
960 | USB_DEVICE(0x0582, 0x0065), | 994 | USB_DEVICE(0x0582, 0x0065), |
961 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 995 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
962 | .vendor_name = "EDIROL", | 996 | .vendor_name = "EDIROL", |
963 | .product_name = "PCR-1", | 997 | .product_name = "PCR-1", |
964 | .ifnum = 0, | 998 | .ifnum = 0, |
965 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 999 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
966 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1000 | .data = & (const struct snd_usb_midi_endpoint_info) { |
967 | .out_cables = 0x0001, | 1001 | .out_cables = 0x0001, |
968 | .in_cables = 0x0003 | 1002 | .in_cables = 0x0003 |
969 | } | 1003 | } |
@@ -972,12 +1006,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
972 | { | 1006 | { |
973 | /* has ID 0x006b when not in "Advanced Driver" mode */ | 1007 | /* has ID 0x006b when not in "Advanced Driver" mode */ |
974 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x006a), | 1008 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x006a), |
975 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1009 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
976 | .vendor_name = "Roland", | 1010 | .vendor_name = "Roland", |
977 | .product_name = "SP-606", | 1011 | .product_name = "SP-606", |
978 | .ifnum = 3, | 1012 | .ifnum = 3, |
979 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 1013 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
980 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1014 | .data = & (const struct snd_usb_midi_endpoint_info) { |
981 | .out_cables = 0x0001, | 1015 | .out_cables = 0x0001, |
982 | .in_cables = 0x0001 | 1016 | .in_cables = 0x0001 |
983 | } | 1017 | } |
@@ -986,12 +1020,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
986 | { | 1020 | { |
987 | /* has ID 0x006e when not in "Advanced Driver" mode */ | 1021 | /* has ID 0x006e when not in "Advanced Driver" mode */ |
988 | USB_DEVICE(0x0582, 0x006d), | 1022 | USB_DEVICE(0x0582, 0x006d), |
989 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1023 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
990 | .vendor_name = "Roland", | 1024 | .vendor_name = "Roland", |
991 | .product_name = "FANTOM-X", | 1025 | .product_name = "FANTOM-X", |
992 | .ifnum = 0, | 1026 | .ifnum = 0, |
993 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 1027 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
994 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1028 | .data = & (const struct snd_usb_midi_endpoint_info) { |
995 | .out_cables = 0x0001, | 1029 | .out_cables = 0x0001, |
996 | .in_cables = 0x0001 | 1030 | .in_cables = 0x0001 |
997 | } | 1031 | } |
@@ -1004,12 +1038,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1004 | * offers only 16-bit PCM at 44.1 kHz and no MIDI. | 1038 | * offers only 16-bit PCM at 44.1 kHz and no MIDI. |
1005 | */ | 1039 | */ |
1006 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x0074), | 1040 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x0074), |
1007 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1041 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1008 | .vendor_name = "EDIROL", | 1042 | .vendor_name = "EDIROL", |
1009 | .product_name = "UA-25", | 1043 | .product_name = "UA-25", |
1010 | .ifnum = QUIRK_ANY_INTERFACE, | 1044 | .ifnum = QUIRK_ANY_INTERFACE, |
1011 | .type = QUIRK_COMPOSITE, | 1045 | .type = QUIRK_COMPOSITE, |
1012 | .data = (const snd_usb_audio_quirk_t[]) { | 1046 | .data = (const struct snd_usb_audio_quirk[]) { |
1013 | { | 1047 | { |
1014 | .ifnum = 0, | 1048 | .ifnum = 0, |
1015 | .type = QUIRK_AUDIO_EDIROL_UA700_UA25 | 1049 | .type = QUIRK_AUDIO_EDIROL_UA700_UA25 |
@@ -1031,12 +1065,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1031 | { | 1065 | { |
1032 | /* has ID 0x0076 when not in "Advanced Driver" mode */ | 1066 | /* has ID 0x0076 when not in "Advanced Driver" mode */ |
1033 | USB_DEVICE(0x0582, 0x0075), | 1067 | USB_DEVICE(0x0582, 0x0075), |
1034 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1068 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1035 | .vendor_name = "BOSS", | 1069 | .vendor_name = "BOSS", |
1036 | .product_name = "DR-880", | 1070 | .product_name = "DR-880", |
1037 | .ifnum = 0, | 1071 | .ifnum = 0, |
1038 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 1072 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
1039 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1073 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1040 | .out_cables = 0x0001, | 1074 | .out_cables = 0x0001, |
1041 | .in_cables = 0x0001 | 1075 | .in_cables = 0x0001 |
1042 | } | 1076 | } |
@@ -1045,12 +1079,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1045 | { | 1079 | { |
1046 | /* has ID 0x007b when not in "Advanced Driver" mode */ | 1080 | /* has ID 0x007b when not in "Advanced Driver" mode */ |
1047 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x007a), | 1081 | USB_DEVICE_VENDOR_SPEC(0x0582, 0x007a), |
1048 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1082 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1049 | .vendor_name = "Roland", | 1083 | .vendor_name = "Roland", |
1050 | /* "RD" or "RD-700SX"? */ | 1084 | /* "RD" or "RD-700SX"? */ |
1051 | .ifnum = 0, | 1085 | .ifnum = 0, |
1052 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 1086 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
1053 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1087 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1054 | .out_cables = 0x0003, | 1088 | .out_cables = 0x0003, |
1055 | .in_cables = 0x0003 | 1089 | .in_cables = 0x0003 |
1056 | } | 1090 | } |
@@ -1066,12 +1100,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1066 | * compliant USB MIDI ports for external MIDI and controls. | 1100 | * compliant USB MIDI ports for external MIDI and controls. |
1067 | */ | 1101 | */ |
1068 | USB_DEVICE_VENDOR_SPEC(0x06f8, 0xb000), | 1102 | USB_DEVICE_VENDOR_SPEC(0x06f8, 0xb000), |
1069 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1103 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1070 | .vendor_name = "Hercules", | 1104 | .vendor_name = "Hercules", |
1071 | .product_name = "DJ Console (WE)", | 1105 | .product_name = "DJ Console (WE)", |
1072 | .ifnum = 4, | 1106 | .ifnum = 4, |
1073 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 1107 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
1074 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1108 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1075 | .out_cables = 0x0001, | 1109 | .out_cables = 0x0001, |
1076 | .in_cables = 0x0001 | 1110 | .in_cables = 0x0001 |
1077 | } | 1111 | } |
@@ -1090,12 +1124,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1090 | /* Midiman/M-Audio devices */ | 1124 | /* Midiman/M-Audio devices */ |
1091 | { | 1125 | { |
1092 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1002), | 1126 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1002), |
1093 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1127 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1094 | .vendor_name = "M-Audio", | 1128 | .vendor_name = "M-Audio", |
1095 | .product_name = "MidiSport 2x2", | 1129 | .product_name = "MidiSport 2x2", |
1096 | .ifnum = QUIRK_ANY_INTERFACE, | 1130 | .ifnum = QUIRK_ANY_INTERFACE, |
1097 | .type = QUIRK_MIDI_MIDIMAN, | 1131 | .type = QUIRK_MIDI_MIDIMAN, |
1098 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1132 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1099 | .out_cables = 0x0003, | 1133 | .out_cables = 0x0003, |
1100 | .in_cables = 0x0003 | 1134 | .in_cables = 0x0003 |
1101 | } | 1135 | } |
@@ -1103,12 +1137,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1103 | }, | 1137 | }, |
1104 | { | 1138 | { |
1105 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1011), | 1139 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1011), |
1106 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1140 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1107 | .vendor_name = "M-Audio", | 1141 | .vendor_name = "M-Audio", |
1108 | .product_name = "MidiSport 1x1", | 1142 | .product_name = "MidiSport 1x1", |
1109 | .ifnum = QUIRK_ANY_INTERFACE, | 1143 | .ifnum = QUIRK_ANY_INTERFACE, |
1110 | .type = QUIRK_MIDI_MIDIMAN, | 1144 | .type = QUIRK_MIDI_MIDIMAN, |
1111 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1145 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1112 | .out_cables = 0x0001, | 1146 | .out_cables = 0x0001, |
1113 | .in_cables = 0x0001 | 1147 | .in_cables = 0x0001 |
1114 | } | 1148 | } |
@@ -1116,12 +1150,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1116 | }, | 1150 | }, |
1117 | { | 1151 | { |
1118 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1015), | 1152 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1015), |
1119 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1153 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1120 | .vendor_name = "M-Audio", | 1154 | .vendor_name = "M-Audio", |
1121 | .product_name = "Keystation", | 1155 | .product_name = "Keystation", |
1122 | .ifnum = QUIRK_ANY_INTERFACE, | 1156 | .ifnum = QUIRK_ANY_INTERFACE, |
1123 | .type = QUIRK_MIDI_MIDIMAN, | 1157 | .type = QUIRK_MIDI_MIDIMAN, |
1124 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1158 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1125 | .out_cables = 0x0001, | 1159 | .out_cables = 0x0001, |
1126 | .in_cables = 0x0001 | 1160 | .in_cables = 0x0001 |
1127 | } | 1161 | } |
@@ -1129,12 +1163,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1129 | }, | 1163 | }, |
1130 | { | 1164 | { |
1131 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1021), | 1165 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1021), |
1132 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1166 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1133 | .vendor_name = "M-Audio", | 1167 | .vendor_name = "M-Audio", |
1134 | .product_name = "MidiSport 4x4", | 1168 | .product_name = "MidiSport 4x4", |
1135 | .ifnum = QUIRK_ANY_INTERFACE, | 1169 | .ifnum = QUIRK_ANY_INTERFACE, |
1136 | .type = QUIRK_MIDI_MIDIMAN, | 1170 | .type = QUIRK_MIDI_MIDIMAN, |
1137 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1171 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1138 | .out_cables = 0x000f, | 1172 | .out_cables = 0x000f, |
1139 | .in_cables = 0x000f | 1173 | .in_cables = 0x000f |
1140 | } | 1174 | } |
@@ -1147,12 +1181,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1147 | * Thanks to Olaf Giesbrecht <Olaf_Giesbrecht@yahoo.de> | 1181 | * Thanks to Olaf Giesbrecht <Olaf_Giesbrecht@yahoo.de> |
1148 | */ | 1182 | */ |
1149 | USB_DEVICE_VER(0x0763, 0x1031, 0x0100, 0x0109), | 1183 | USB_DEVICE_VER(0x0763, 0x1031, 0x0100, 0x0109), |
1150 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1184 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1151 | .vendor_name = "M-Audio", | 1185 | .vendor_name = "M-Audio", |
1152 | .product_name = "MidiSport 8x8", | 1186 | .product_name = "MidiSport 8x8", |
1153 | .ifnum = QUIRK_ANY_INTERFACE, | 1187 | .ifnum = QUIRK_ANY_INTERFACE, |
1154 | .type = QUIRK_MIDI_MIDIMAN, | 1188 | .type = QUIRK_MIDI_MIDIMAN, |
1155 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1189 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1156 | .out_cables = 0x01ff, | 1190 | .out_cables = 0x01ff, |
1157 | .in_cables = 0x01ff | 1191 | .in_cables = 0x01ff |
1158 | } | 1192 | } |
@@ -1160,12 +1194,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1160 | }, | 1194 | }, |
1161 | { | 1195 | { |
1162 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1033), | 1196 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1033), |
1163 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1197 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1164 | .vendor_name = "M-Audio", | 1198 | .vendor_name = "M-Audio", |
1165 | .product_name = "MidiSport 8x8", | 1199 | .product_name = "MidiSport 8x8", |
1166 | .ifnum = QUIRK_ANY_INTERFACE, | 1200 | .ifnum = QUIRK_ANY_INTERFACE, |
1167 | .type = QUIRK_MIDI_MIDIMAN, | 1201 | .type = QUIRK_MIDI_MIDIMAN, |
1168 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1202 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1169 | .out_cables = 0x01ff, | 1203 | .out_cables = 0x01ff, |
1170 | .in_cables = 0x01ff | 1204 | .in_cables = 0x01ff |
1171 | } | 1205 | } |
@@ -1173,12 +1207,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1173 | }, | 1207 | }, |
1174 | { | 1208 | { |
1175 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1041), | 1209 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x1041), |
1176 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1210 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1177 | .vendor_name = "M-Audio", | 1211 | .vendor_name = "M-Audio", |
1178 | .product_name = "MidiSport 2x4", | 1212 | .product_name = "MidiSport 2x4", |
1179 | .ifnum = QUIRK_ANY_INTERFACE, | 1213 | .ifnum = QUIRK_ANY_INTERFACE, |
1180 | .type = QUIRK_MIDI_MIDIMAN, | 1214 | .type = QUIRK_MIDI_MIDIMAN, |
1181 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1215 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1182 | .out_cables = 0x000f, | 1216 | .out_cables = 0x000f, |
1183 | .in_cables = 0x0003 | 1217 | .in_cables = 0x0003 |
1184 | } | 1218 | } |
@@ -1186,12 +1220,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1186 | }, | 1220 | }, |
1187 | { | 1221 | { |
1188 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x2001), | 1222 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x2001), |
1189 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1223 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1190 | .vendor_name = "M-Audio", | 1224 | .vendor_name = "M-Audio", |
1191 | .product_name = "Quattro", | 1225 | .product_name = "Quattro", |
1192 | .ifnum = QUIRK_ANY_INTERFACE, | 1226 | .ifnum = QUIRK_ANY_INTERFACE, |
1193 | .type = QUIRK_COMPOSITE, | 1227 | .type = QUIRK_COMPOSITE, |
1194 | .data = & (const snd_usb_audio_quirk_t[]) { | 1228 | .data = & (const struct snd_usb_audio_quirk[]) { |
1195 | /* | 1229 | /* |
1196 | * Interfaces 0-2 are "Windows-compatible", 16-bit only, | 1230 | * Interfaces 0-2 are "Windows-compatible", 16-bit only, |
1197 | * and share endpoints with the other interfaces. | 1231 | * and share endpoints with the other interfaces. |
@@ -1237,7 +1271,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1237 | { | 1271 | { |
1238 | .ifnum = 9, | 1272 | .ifnum = 9, |
1239 | .type = QUIRK_MIDI_MIDIMAN, | 1273 | .type = QUIRK_MIDI_MIDIMAN, |
1240 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1274 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1241 | .out_cables = 0x0001, | 1275 | .out_cables = 0x0001, |
1242 | .in_cables = 0x0001 | 1276 | .in_cables = 0x0001 |
1243 | } | 1277 | } |
@@ -1250,12 +1284,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1250 | }, | 1284 | }, |
1251 | { | 1285 | { |
1252 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x2003), | 1286 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x2003), |
1253 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1287 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1254 | .vendor_name = "M-Audio", | 1288 | .vendor_name = "M-Audio", |
1255 | .product_name = "AudioPhile", | 1289 | .product_name = "AudioPhile", |
1256 | .ifnum = 6, | 1290 | .ifnum = 6, |
1257 | .type = QUIRK_MIDI_MIDIMAN, | 1291 | .type = QUIRK_MIDI_MIDIMAN, |
1258 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1292 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1259 | .out_cables = 0x0001, | 1293 | .out_cables = 0x0001, |
1260 | .in_cables = 0x0001 | 1294 | .in_cables = 0x0001 |
1261 | } | 1295 | } |
@@ -1263,12 +1297,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1263 | }, | 1297 | }, |
1264 | { | 1298 | { |
1265 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x2008), | 1299 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x2008), |
1266 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1300 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1267 | .vendor_name = "M-Audio", | 1301 | .vendor_name = "M-Audio", |
1268 | .product_name = "Ozone", | 1302 | .product_name = "Ozone", |
1269 | .ifnum = 3, | 1303 | .ifnum = 3, |
1270 | .type = QUIRK_MIDI_MIDIMAN, | 1304 | .type = QUIRK_MIDI_MIDIMAN, |
1271 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1305 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1272 | .out_cables = 0x0001, | 1306 | .out_cables = 0x0001, |
1273 | .in_cables = 0x0001 | 1307 | .in_cables = 0x0001 |
1274 | } | 1308 | } |
@@ -1276,12 +1310,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1276 | }, | 1310 | }, |
1277 | { | 1311 | { |
1278 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x200d), | 1312 | USB_DEVICE_VENDOR_SPEC(0x0763, 0x200d), |
1279 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1313 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1280 | .vendor_name = "M-Audio", | 1314 | .vendor_name = "M-Audio", |
1281 | .product_name = "OmniStudio", | 1315 | .product_name = "OmniStudio", |
1282 | .ifnum = QUIRK_ANY_INTERFACE, | 1316 | .ifnum = QUIRK_ANY_INTERFACE, |
1283 | .type = QUIRK_COMPOSITE, | 1317 | .type = QUIRK_COMPOSITE, |
1284 | .data = & (const snd_usb_audio_quirk_t[]) { | 1318 | .data = & (const struct snd_usb_audio_quirk[]) { |
1285 | { | 1319 | { |
1286 | .ifnum = 0, | 1320 | .ifnum = 0, |
1287 | .type = QUIRK_IGNORE_INTERFACE | 1321 | .type = QUIRK_IGNORE_INTERFACE |
@@ -1321,7 +1355,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1321 | { | 1355 | { |
1322 | .ifnum = 9, | 1356 | .ifnum = 9, |
1323 | .type = QUIRK_MIDI_MIDIMAN, | 1357 | .type = QUIRK_MIDI_MIDIMAN, |
1324 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1358 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1325 | .out_cables = 0x0001, | 1359 | .out_cables = 0x0001, |
1326 | .in_cables = 0x0001 | 1360 | .in_cables = 0x0001 |
1327 | } | 1361 | } |
@@ -1342,12 +1376,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1342 | .idVendor = 0x07fd, | 1376 | .idVendor = 0x07fd, |
1343 | .idProduct = 0x0001, | 1377 | .idProduct = 0x0001, |
1344 | .bDeviceSubClass = 2, | 1378 | .bDeviceSubClass = 2, |
1345 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1379 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1346 | .vendor_name = "MOTU", | 1380 | .vendor_name = "MOTU", |
1347 | .product_name = "Fastlane", | 1381 | .product_name = "Fastlane", |
1348 | .ifnum = QUIRK_ANY_INTERFACE, | 1382 | .ifnum = QUIRK_ANY_INTERFACE, |
1349 | .type = QUIRK_COMPOSITE, | 1383 | .type = QUIRK_COMPOSITE, |
1350 | .data = & (const snd_usb_audio_quirk_t[]) { | 1384 | .data = & (const struct snd_usb_audio_quirk[]) { |
1351 | { | 1385 | { |
1352 | .ifnum = 0, | 1386 | .ifnum = 0, |
1353 | .type = QUIRK_MIDI_RAW | 1387 | .type = QUIRK_MIDI_RAW |
@@ -1366,7 +1400,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1366 | { | 1400 | { |
1367 | /* Creative Sound Blaster MP3+ */ | 1401 | /* Creative Sound Blaster MP3+ */ |
1368 | USB_DEVICE(0x041e, 0x3010), | 1402 | USB_DEVICE(0x041e, 0x3010), |
1369 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1403 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1370 | .vendor_name = "Creative Labs", | 1404 | .vendor_name = "Creative Labs", |
1371 | .product_name = "Sound Blaster MP3+", | 1405 | .product_name = "Sound Blaster MP3+", |
1372 | .ifnum = QUIRK_NO_INTERFACE | 1406 | .ifnum = QUIRK_NO_INTERFACE |
@@ -1377,12 +1411,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1377 | /* Emagic devices */ | 1411 | /* Emagic devices */ |
1378 | { | 1412 | { |
1379 | USB_DEVICE(0x086a, 0x0001), | 1413 | USB_DEVICE(0x086a, 0x0001), |
1380 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1414 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1381 | .vendor_name = "Emagic", | 1415 | .vendor_name = "Emagic", |
1382 | /* .product_name = "Unitor8", */ | 1416 | /* .product_name = "Unitor8", */ |
1383 | .ifnum = 2, | 1417 | .ifnum = 2, |
1384 | .type = QUIRK_MIDI_EMAGIC, | 1418 | .type = QUIRK_MIDI_EMAGIC, |
1385 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1419 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1386 | .out_cables = 0x80ff, | 1420 | .out_cables = 0x80ff, |
1387 | .in_cables = 0x80ff | 1421 | .in_cables = 0x80ff |
1388 | } | 1422 | } |
@@ -1390,12 +1424,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1390 | }, | 1424 | }, |
1391 | { | 1425 | { |
1392 | USB_DEVICE(0x086a, 0x0002), | 1426 | USB_DEVICE(0x086a, 0x0002), |
1393 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1427 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1394 | .vendor_name = "Emagic", | 1428 | .vendor_name = "Emagic", |
1395 | /* .product_name = "AMT8", */ | 1429 | /* .product_name = "AMT8", */ |
1396 | .ifnum = 2, | 1430 | .ifnum = 2, |
1397 | .type = QUIRK_MIDI_EMAGIC, | 1431 | .type = QUIRK_MIDI_EMAGIC, |
1398 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1432 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1399 | .out_cables = 0x80ff, | 1433 | .out_cables = 0x80ff, |
1400 | .in_cables = 0x80ff | 1434 | .in_cables = 0x80ff |
1401 | } | 1435 | } |
@@ -1403,12 +1437,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1403 | }, | 1437 | }, |
1404 | { | 1438 | { |
1405 | USB_DEVICE(0x086a, 0x0003), | 1439 | USB_DEVICE(0x086a, 0x0003), |
1406 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1440 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1407 | .vendor_name = "Emagic", | 1441 | .vendor_name = "Emagic", |
1408 | /* .product_name = "MT4", */ | 1442 | /* .product_name = "MT4", */ |
1409 | .ifnum = 2, | 1443 | .ifnum = 2, |
1410 | .type = QUIRK_MIDI_EMAGIC, | 1444 | .type = QUIRK_MIDI_EMAGIC, |
1411 | .data = & (const snd_usb_midi_endpoint_info_t) { | 1445 | .data = & (const struct snd_usb_midi_endpoint_info) { |
1412 | .out_cables = 0x800f, | 1446 | .out_cables = 0x800f, |
1413 | .in_cables = 0x8003 | 1447 | .in_cables = 0x8003 |
1414 | } | 1448 | } |
@@ -1418,7 +1452,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1418 | /* TerraTec devices */ | 1452 | /* TerraTec devices */ |
1419 | { | 1453 | { |
1420 | USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0012), | 1454 | USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0012), |
1421 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1455 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1422 | .vendor_name = "TerraTec", | 1456 | .vendor_name = "TerraTec", |
1423 | .product_name = "PHASE 26", | 1457 | .product_name = "PHASE 26", |
1424 | .ifnum = 3, | 1458 | .ifnum = 3, |
@@ -1427,7 +1461,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1427 | }, | 1461 | }, |
1428 | { | 1462 | { |
1429 | USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0013), | 1463 | USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0013), |
1430 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1464 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1431 | .vendor_name = "TerraTec", | 1465 | .vendor_name = "TerraTec", |
1432 | .product_name = "PHASE 26", | 1466 | .product_name = "PHASE 26", |
1433 | .ifnum = 3, | 1467 | .ifnum = 3, |
@@ -1438,7 +1472,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1438 | /* Novation EMS devices */ | 1472 | /* Novation EMS devices */ |
1439 | { | 1473 | { |
1440 | USB_DEVICE_VENDOR_SPEC(0x1235, 0x0001), | 1474 | USB_DEVICE_VENDOR_SPEC(0x1235, 0x0001), |
1441 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1475 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1442 | .vendor_name = "Novation", | 1476 | .vendor_name = "Novation", |
1443 | .product_name = "ReMOTE Audio/XStation", | 1477 | .product_name = "ReMOTE Audio/XStation", |
1444 | .ifnum = 4, | 1478 | .ifnum = 4, |
@@ -1447,7 +1481,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1447 | }, | 1481 | }, |
1448 | { | 1482 | { |
1449 | USB_DEVICE_VENDOR_SPEC(0x1235, 0x0002), | 1483 | USB_DEVICE_VENDOR_SPEC(0x1235, 0x0002), |
1450 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1484 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1451 | .vendor_name = "Novation", | 1485 | .vendor_name = "Novation", |
1452 | .product_name = "Speedio", | 1486 | .product_name = "Speedio", |
1453 | .ifnum = 3, | 1487 | .ifnum = 3, |
@@ -1456,7 +1490,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1456 | }, | 1490 | }, |
1457 | { | 1491 | { |
1458 | USB_DEVICE_VENDOR_SPEC(0x1235, 0x4661), | 1492 | USB_DEVICE_VENDOR_SPEC(0x1235, 0x4661), |
1459 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1493 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1460 | .vendor_name = "Novation", | 1494 | .vendor_name = "Novation", |
1461 | .product_name = "ReMOTE25", | 1495 | .product_name = "ReMOTE25", |
1462 | .ifnum = 0, | 1496 | .ifnum = 0, |
@@ -1466,7 +1500,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1466 | 1500 | ||
1467 | { | 1501 | { |
1468 | USB_DEVICE(0x4752, 0x0011), | 1502 | USB_DEVICE(0x4752, 0x0011), |
1469 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1503 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1470 | .vendor_name = "Miditech", | 1504 | .vendor_name = "Miditech", |
1471 | .product_name = "Midistart-2", | 1505 | .product_name = "Midistart-2", |
1472 | .ifnum = 0, | 1506 | .ifnum = 0, |
@@ -1475,7 +1509,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1475 | }, | 1509 | }, |
1476 | { | 1510 | { |
1477 | USB_DEVICE(0x7104, 0x2202), | 1511 | USB_DEVICE(0x7104, 0x2202), |
1478 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1512 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1479 | .vendor_name = "Miditech", | 1513 | .vendor_name = "Miditech", |
1480 | .product_name = "MidiStudio-2", | 1514 | .product_name = "MidiStudio-2", |
1481 | .ifnum = 0, | 1515 | .ifnum = 0, |
@@ -1492,7 +1526,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1492 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 1526 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
1493 | .bInterfaceClass = USB_CLASS_AUDIO, | 1527 | .bInterfaceClass = USB_CLASS_AUDIO, |
1494 | .bInterfaceSubClass = USB_SUBCLASS_MIDI_STREAMING, | 1528 | .bInterfaceSubClass = USB_SUBCLASS_MIDI_STREAMING, |
1495 | .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { | 1529 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1496 | .ifnum = QUIRK_ANY_INTERFACE, | 1530 | .ifnum = QUIRK_ANY_INTERFACE, |
1497 | .type = QUIRK_MIDI_STANDARD_INTERFACE | 1531 | .type = QUIRK_MIDI_STANDARD_INTERFACE |
1498 | } | 1532 | } |
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 8abe08611df6..4b52d18dcd53 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include "usbusx2y.h" | 31 | #include "usbusx2y.h" |
32 | #include "usX2Yhwdep.h" | 32 | #include "usX2Yhwdep.h" |
33 | 33 | ||
34 | int usX2Y_hwdep_pcm_new(snd_card_t* card); | 34 | int usX2Y_hwdep_pcm_new(struct snd_card *card); |
35 | 35 | ||
36 | 36 | ||
37 | static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsigned long address, int *type) | 37 | static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsigned long address, int *type) |
@@ -49,7 +49,7 @@ static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsign | |||
49 | offset = area->vm_pgoff << PAGE_SHIFT; | 49 | offset = area->vm_pgoff << PAGE_SHIFT; |
50 | offset += address - area->vm_start; | 50 | offset += address - area->vm_start; |
51 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); | 51 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); |
52 | vaddr = (char*)((usX2Ydev_t*)area->vm_private_data)->us428ctls_sharedmem + offset; | 52 | vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset; |
53 | page = virt_to_page(vaddr); | 53 | page = virt_to_page(vaddr); |
54 | get_page(page); | 54 | get_page(page); |
55 | snd_printdd( "vaddr=%p made us428ctls_vm_nopage() return %p; offset=%lX\n", vaddr, page, offset); | 55 | snd_printdd( "vaddr=%p made us428ctls_vm_nopage() return %p; offset=%lX\n", vaddr, page, offset); |
@@ -64,27 +64,27 @@ static struct vm_operations_struct us428ctls_vm_ops = { | |||
64 | .nopage = snd_us428ctls_vm_nopage, | 64 | .nopage = snd_us428ctls_vm_nopage, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | static int snd_us428ctls_mmap(snd_hwdep_t * hw, struct file *filp, struct vm_area_struct *area) | 67 | static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct vm_area_struct *area) |
68 | { | 68 | { |
69 | unsigned long size = (unsigned long)(area->vm_end - area->vm_start); | 69 | unsigned long size = (unsigned long)(area->vm_end - area->vm_start); |
70 | usX2Ydev_t *us428 = (usX2Ydev_t*)hw->private_data; | 70 | struct usX2Ydev *us428 = hw->private_data; |
71 | 71 | ||
72 | // FIXME this hwdep interface is used twice: fpga download and mmap for controlling Lights etc. Maybe better using 2 hwdep devs? | 72 | // FIXME this hwdep interface is used twice: fpga download and mmap for controlling Lights etc. Maybe better using 2 hwdep devs? |
73 | // so as long as the device isn't fully initialised yet we return -EBUSY here. | 73 | // so as long as the device isn't fully initialised yet we return -EBUSY here. |
74 | if (!(((usX2Ydev_t*)hw->private_data)->chip_status & USX2Y_STAT_CHIP_INIT)) | 74 | if (!(us428->chip_status & USX2Y_STAT_CHIP_INIT)) |
75 | return -EBUSY; | 75 | return -EBUSY; |
76 | 76 | ||
77 | /* if userspace tries to mmap beyond end of our buffer, fail */ | 77 | /* if userspace tries to mmap beyond end of our buffer, fail */ |
78 | if (size > ((PAGE_SIZE - 1 + sizeof(us428ctls_sharedmem_t)) / PAGE_SIZE) * PAGE_SIZE) { | 78 | if (size > PAGE_ALIGN(sizeof(struct us428ctls_sharedmem))) { |
79 | snd_printd( "%lu > %lu\n", size, (unsigned long)sizeof(us428ctls_sharedmem_t)); | 79 | snd_printd( "%lu > %lu\n", size, (unsigned long)sizeof(struct us428ctls_sharedmem)); |
80 | return -EINVAL; | 80 | return -EINVAL; |
81 | } | 81 | } |
82 | 82 | ||
83 | if (!us428->us428ctls_sharedmem) { | 83 | if (!us428->us428ctls_sharedmem) { |
84 | init_waitqueue_head(&us428->us428ctls_wait_queue_head); | 84 | init_waitqueue_head(&us428->us428ctls_wait_queue_head); |
85 | if(!(us428->us428ctls_sharedmem = snd_malloc_pages(sizeof(us428ctls_sharedmem_t), GFP_KERNEL))) | 85 | if(!(us428->us428ctls_sharedmem = snd_malloc_pages(sizeof(struct us428ctls_sharedmem), GFP_KERNEL))) |
86 | return -ENOMEM; | 86 | return -ENOMEM; |
87 | memset(us428->us428ctls_sharedmem, -1, sizeof(us428ctls_sharedmem_t)); | 87 | memset(us428->us428ctls_sharedmem, -1, sizeof(struct us428ctls_sharedmem)); |
88 | us428->us428ctls_sharedmem->CtlSnapShotLast = -2; | 88 | us428->us428ctls_sharedmem->CtlSnapShotLast = -2; |
89 | } | 89 | } |
90 | area->vm_ops = &us428ctls_vm_ops; | 90 | area->vm_ops = &us428ctls_vm_ops; |
@@ -93,11 +93,11 @@ static int snd_us428ctls_mmap(snd_hwdep_t * hw, struct file *filp, struct vm_are | |||
93 | return 0; | 93 | return 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | static unsigned int snd_us428ctls_poll(snd_hwdep_t *hw, struct file *file, poll_table *wait) | 96 | static unsigned int snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file, poll_table *wait) |
97 | { | 97 | { |
98 | unsigned int mask = 0; | 98 | unsigned int mask = 0; |
99 | usX2Ydev_t *us428 = (usX2Ydev_t*)hw->private_data; | 99 | struct usX2Ydev *us428 = hw->private_data; |
100 | us428ctls_sharedmem_t *shm = us428->us428ctls_sharedmem; | 100 | struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem; |
101 | if (us428->chip_status & USX2Y_STAT_CHIP_HUP) | 101 | if (us428->chip_status & USX2Y_STAT_CHIP_HUP) |
102 | return POLLHUP; | 102 | return POLLHUP; |
103 | 103 | ||
@@ -110,26 +110,28 @@ static unsigned int snd_us428ctls_poll(snd_hwdep_t *hw, struct file *file, poll_ | |||
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
113 | static int snd_usX2Y_hwdep_open(snd_hwdep_t *hw, struct file *file) | 113 | static int snd_usX2Y_hwdep_open(struct snd_hwdep *hw, struct file *file) |
114 | { | 114 | { |
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static int snd_usX2Y_hwdep_release(snd_hwdep_t *hw, struct file *file) | 118 | static int snd_usX2Y_hwdep_release(struct snd_hwdep *hw, struct file *file) |
119 | { | 119 | { |
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | static int snd_usX2Y_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info) | 123 | static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, |
124 | struct snd_hwdep_dsp_status *info) | ||
124 | { | 125 | { |
125 | static char *type_ids[USX2Y_TYPE_NUMS] = { | 126 | static char *type_ids[USX2Y_TYPE_NUMS] = { |
126 | [USX2Y_TYPE_122] = "us122", | 127 | [USX2Y_TYPE_122] = "us122", |
127 | [USX2Y_TYPE_224] = "us224", | 128 | [USX2Y_TYPE_224] = "us224", |
128 | [USX2Y_TYPE_428] = "us428", | 129 | [USX2Y_TYPE_428] = "us428", |
129 | }; | 130 | }; |
131 | struct usX2Ydev *us428 = hw->private_data; | ||
130 | int id = -1; | 132 | int id = -1; |
131 | 133 | ||
132 | switch (le16_to_cpu(((usX2Ydev_t*)hw->private_data)->chip.dev->descriptor.idProduct)) { | 134 | switch (le16_to_cpu(us428->chip.dev->descriptor.idProduct)) { |
133 | case USB_ID_US122: | 135 | case USB_ID_US122: |
134 | id = USX2Y_TYPE_122; | 136 | id = USX2Y_TYPE_122; |
135 | break; | 137 | break; |
@@ -144,35 +146,35 @@ static int snd_usX2Y_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *i | |||
144 | return -ENODEV; | 146 | return -ENODEV; |
145 | strcpy(info->id, type_ids[id]); | 147 | strcpy(info->id, type_ids[id]); |
146 | info->num_dsps = 2; // 0: Prepad Data, 1: FPGA Code | 148 | info->num_dsps = 2; // 0: Prepad Data, 1: FPGA Code |
147 | if (((usX2Ydev_t*)hw->private_data)->chip_status & USX2Y_STAT_CHIP_INIT) | 149 | if (us428->chip_status & USX2Y_STAT_CHIP_INIT) |
148 | info->chip_ready = 1; | 150 | info->chip_ready = 1; |
149 | info->version = USX2Y_DRIVER_VERSION; | 151 | info->version = USX2Y_DRIVER_VERSION; |
150 | return 0; | 152 | return 0; |
151 | } | 153 | } |
152 | 154 | ||
153 | 155 | ||
154 | static int usX2Y_create_usbmidi(snd_card_t* card ) | 156 | static int usX2Y_create_usbmidi(struct snd_card *card) |
155 | { | 157 | { |
156 | static snd_usb_midi_endpoint_info_t quirk_data_1 = { | 158 | static struct snd_usb_midi_endpoint_info quirk_data_1 = { |
157 | .out_ep =0x06, | 159 | .out_ep = 0x06, |
158 | .in_ep = 0x06, | 160 | .in_ep = 0x06, |
159 | .out_cables = 0x001, | 161 | .out_cables = 0x001, |
160 | .in_cables = 0x001 | 162 | .in_cables = 0x001 |
161 | }; | 163 | }; |
162 | static snd_usb_audio_quirk_t quirk_1 = { | 164 | static struct snd_usb_audio_quirk quirk_1 = { |
163 | .vendor_name = "TASCAM", | 165 | .vendor_name = "TASCAM", |
164 | .product_name = NAME_ALLCAPS, | 166 | .product_name = NAME_ALLCAPS, |
165 | .ifnum = 0, | 167 | .ifnum = 0, |
166 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 168 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
167 | .data = &quirk_data_1 | 169 | .data = &quirk_data_1 |
168 | }; | 170 | }; |
169 | static snd_usb_midi_endpoint_info_t quirk_data_2 = { | 171 | static struct snd_usb_midi_endpoint_info quirk_data_2 = { |
170 | .out_ep =0x06, | 172 | .out_ep = 0x06, |
171 | .in_ep = 0x06, | 173 | .in_ep = 0x06, |
172 | .out_cables = 0x003, | 174 | .out_cables = 0x003, |
173 | .in_cables = 0x003 | 175 | .in_cables = 0x003 |
174 | }; | 176 | }; |
175 | static snd_usb_audio_quirk_t quirk_2 = { | 177 | static struct snd_usb_audio_quirk quirk_2 = { |
176 | .vendor_name = "TASCAM", | 178 | .vendor_name = "TASCAM", |
177 | .product_name = "US428", | 179 | .product_name = "US428", |
178 | .ifnum = 0, | 180 | .ifnum = 0, |
@@ -181,13 +183,15 @@ static int usX2Y_create_usbmidi(snd_card_t* card ) | |||
181 | }; | 183 | }; |
182 | struct usb_device *dev = usX2Y(card)->chip.dev; | 184 | struct usb_device *dev = usX2Y(card)->chip.dev; |
183 | struct usb_interface *iface = usb_ifnum_to_if(dev, 0); | 185 | struct usb_interface *iface = usb_ifnum_to_if(dev, 0); |
184 | snd_usb_audio_quirk_t *quirk = le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ? &quirk_2 : &quirk_1; | 186 | struct snd_usb_audio_quirk *quirk = |
187 | le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ? | ||
188 | &quirk_2 : &quirk_1; | ||
185 | 189 | ||
186 | snd_printdd("usX2Y_create_usbmidi \n"); | 190 | snd_printdd("usX2Y_create_usbmidi \n"); |
187 | return snd_usb_create_midi_interface(&usX2Y(card)->chip, iface, quirk); | 191 | return snd_usb_create_midi_interface(&usX2Y(card)->chip, iface, quirk); |
188 | } | 192 | } |
189 | 193 | ||
190 | static int usX2Y_create_alsa_devices(snd_card_t* card) | 194 | static int usX2Y_create_alsa_devices(struct snd_card *card) |
191 | { | 195 | { |
192 | int err; | 196 | int err; |
193 | 197 | ||
@@ -207,9 +211,10 @@ static int usX2Y_create_alsa_devices(snd_card_t* card) | |||
207 | return err; | 211 | return err; |
208 | } | 212 | } |
209 | 213 | ||
210 | static int snd_usX2Y_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | 214 | static int snd_usX2Y_hwdep_dsp_load(struct snd_hwdep *hw, |
215 | struct snd_hwdep_dsp_image *dsp) | ||
211 | { | 216 | { |
212 | usX2Ydev_t *priv = hw->private_data; | 217 | struct usX2Ydev *priv = hw->private_data; |
213 | int lret, err = -EINVAL; | 218 | int lret, err = -EINVAL; |
214 | snd_printdd( "dsp_load %s\n", dsp->name); | 219 | snd_printdd( "dsp_load %s\n", dsp->name); |
215 | 220 | ||
@@ -256,10 +261,10 @@ static int snd_usX2Y_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | |||
256 | } | 261 | } |
257 | 262 | ||
258 | 263 | ||
259 | int usX2Y_hwdep_new(snd_card_t* card, struct usb_device* device) | 264 | int usX2Y_hwdep_new(struct snd_card *card, struct usb_device* device) |
260 | { | 265 | { |
261 | int err; | 266 | int err; |
262 | snd_hwdep_t *hw; | 267 | struct snd_hwdep *hw; |
263 | 268 | ||
264 | if ((err = snd_hwdep_new(card, SND_USX2Y_LOADER_ID, 0, &hw)) < 0) | 269 | if ((err = snd_hwdep_new(card, SND_USX2Y_LOADER_ID, 0, &hw)) < 0) |
265 | return err; | 270 | return err; |
diff --git a/sound/usb/usx2y/usX2Yhwdep.h b/sound/usb/usx2y/usX2Yhwdep.h index d612a26eb77c..c095d5bf1220 100644 --- a/sound/usb/usx2y/usX2Yhwdep.h +++ b/sound/usb/usx2y/usX2Yhwdep.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifndef USX2YHWDEP_H | 1 | #ifndef USX2YHWDEP_H |
2 | #define USX2YHWDEP_H | 2 | #define USX2YHWDEP_H |
3 | 3 | ||
4 | int usX2Y_hwdep_new(snd_card_t* card, struct usb_device* device); | 4 | int usX2Y_hwdep_new(struct snd_card *card, struct usb_device* device); |
5 | 5 | ||
6 | #endif | 6 | #endif |
diff --git a/sound/usb/usx2y/usbus428ctldefs.h b/sound/usb/usx2y/usbus428ctldefs.h index 6af16438d2c7..b864e7e262e5 100644 --- a/sound/usb/usx2y/usbus428ctldefs.h +++ b/sound/usb/usx2y/usbus428ctldefs.h | |||
@@ -51,7 +51,7 @@ enum E_In84{ | |||
51 | #define T_NULL 0x80 | 51 | #define T_NULL 0x80 |
52 | 52 | ||
53 | 53 | ||
54 | struct us428_ctls{ | 54 | struct us428_ctls { |
55 | unsigned char Fader[9]; | 55 | unsigned char Fader[9]; |
56 | unsigned char Transport; | 56 | unsigned char Transport; |
57 | unsigned char Modifier; | 57 | unsigned char Modifier; |
@@ -63,46 +63,42 @@ struct us428_ctls{ | |||
63 | unsigned char Wheel[5]; | 63 | unsigned char Wheel[5]; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | typedef struct us428_ctls us428_ctls_t; | 66 | struct us428_setByte { |
67 | |||
68 | typedef struct us428_setByte{ | ||
69 | unsigned char Offset, | 67 | unsigned char Offset, |
70 | Value; | 68 | Value; |
71 | }us428_setByte_t; | 69 | }; |
72 | 70 | ||
73 | enum { | 71 | enum { |
74 | eLT_Volume = 0, | 72 | eLT_Volume = 0, |
75 | eLT_Light | 73 | eLT_Light |
76 | }; | 74 | }; |
77 | 75 | ||
78 | typedef struct usX2Y_volume { | 76 | struct usX2Y_volume { |
79 | unsigned char Channel, | 77 | unsigned char Channel, |
80 | LH, | 78 | LH, |
81 | LL, | 79 | LL, |
82 | RH, | 80 | RH, |
83 | RL; | 81 | RL; |
84 | } usX2Y_volume_t; | 82 | }; |
85 | 83 | ||
86 | struct us428_lights{ | 84 | struct us428_lights { |
87 | us428_setByte_t Light[7]; | 85 | struct us428_setByte Light[7]; |
88 | }; | 86 | }; |
89 | typedef struct us428_lights us428_lights_t; | ||
90 | 87 | ||
91 | typedef struct { | 88 | struct us428_p4out { |
92 | char type; | 89 | char type; |
93 | union { | 90 | union { |
94 | usX2Y_volume_t vol; | 91 | struct usX2Y_volume vol; |
95 | us428_lights_t lights; | 92 | struct us428_lights lights; |
96 | } val; | 93 | } val; |
97 | } us428_p4out_t; | 94 | }; |
98 | 95 | ||
99 | #define N_us428_ctl_BUFS 16 | 96 | #define N_us428_ctl_BUFS 16 |
100 | #define N_us428_p4out_BUFS 16 | 97 | #define N_us428_p4out_BUFS 16 |
101 | struct us428ctls_sharedmem{ | 98 | struct us428ctls_sharedmem{ |
102 | us428_ctls_t CtlSnapShot[N_us428_ctl_BUFS]; | 99 | struct us428_ctls CtlSnapShot[N_us428_ctl_BUFS]; |
103 | int CtlSnapShotDiffersAt[N_us428_ctl_BUFS]; | 100 | int CtlSnapShotDiffersAt[N_us428_ctl_BUFS]; |
104 | int CtlSnapShotLast, CtlSnapShotRed; | 101 | int CtlSnapShotLast, CtlSnapShotRed; |
105 | us428_p4out_t p4out[N_us428_p4out_BUFS]; | 102 | struct us428_p4out p4out[N_us428_p4out_BUFS]; |
106 | int p4outLast, p4outSent; | 103 | int p4outLast, p4outSent; |
107 | }; | 104 | }; |
108 | typedef struct us428ctls_sharedmem us428ctls_sharedmem_t; | ||
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index a3967f72ab4e..e0abb56bbe49 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -167,28 +167,28 @@ MODULE_PARM_DESC(enable, "Enable "NAME_ALLCAPS"."); | |||
167 | static int snd_usX2Y_card_used[SNDRV_CARDS]; | 167 | static int snd_usX2Y_card_used[SNDRV_CARDS]; |
168 | 168 | ||
169 | static void usX2Y_usb_disconnect(struct usb_device* usb_device, void* ptr); | 169 | static void usX2Y_usb_disconnect(struct usb_device* usb_device, void* ptr); |
170 | static void snd_usX2Y_card_private_free(snd_card_t *card); | 170 | static void snd_usX2Y_card_private_free(struct snd_card *card); |
171 | 171 | ||
172 | /* | 172 | /* |
173 | * pipe 4 is used for switching the lamps, setting samplerate, volumes .... | 173 | * pipe 4 is used for switching the lamps, setting samplerate, volumes .... |
174 | */ | 174 | */ |
175 | static void i_usX2Y_Out04Int(struct urb* urb, struct pt_regs *regs) | 175 | static void i_usX2Y_Out04Int(struct urb *urb, struct pt_regs *regs) |
176 | { | 176 | { |
177 | #ifdef CONFIG_SND_DEBUG | 177 | #ifdef CONFIG_SND_DEBUG |
178 | if (urb->status) { | 178 | if (urb->status) { |
179 | int i; | 179 | int i; |
180 | usX2Ydev_t* usX2Y = urb->context; | 180 | struct usX2Ydev *usX2Y = urb->context; |
181 | for (i = 0; i < 10 && usX2Y->AS04.urb[i] != urb; i++); | 181 | for (i = 0; i < 10 && usX2Y->AS04.urb[i] != urb; i++); |
182 | snd_printdd("i_usX2Y_Out04Int() urb %i status=%i\n", i, urb->status); | 182 | snd_printdd("i_usX2Y_Out04Int() urb %i status=%i\n", i, urb->status); |
183 | } | 183 | } |
184 | #endif | 184 | #endif |
185 | } | 185 | } |
186 | 186 | ||
187 | static void i_usX2Y_In04Int(struct urb* urb, struct pt_regs *regs) | 187 | static void i_usX2Y_In04Int(struct urb *urb, struct pt_regs *regs) |
188 | { | 188 | { |
189 | int err = 0; | 189 | int err = 0; |
190 | usX2Ydev_t *usX2Y = urb->context; | 190 | struct usX2Ydev *usX2Y = urb->context; |
191 | us428ctls_sharedmem_t *us428ctls = usX2Y->us428ctls_sharedmem; | 191 | struct us428ctls_sharedmem *us428ctls = usX2Y->us428ctls_sharedmem; |
192 | 192 | ||
193 | usX2Y->In04IntCalls++; | 193 | usX2Y->In04IntCalls++; |
194 | 194 | ||
@@ -239,10 +239,10 @@ static void i_usX2Y_In04Int(struct urb* urb, struct pt_regs *regs) | |||
239 | send = 0; | 239 | send = 0; |
240 | for (j = 0; j < URBS_AsyncSeq && !err; ++j) | 240 | for (j = 0; j < URBS_AsyncSeq && !err; ++j) |
241 | if (0 == usX2Y->AS04.urb[j]->status) { | 241 | if (0 == usX2Y->AS04.urb[j]->status) { |
242 | us428_p4out_t *p4out = us428ctls->p4out + send; // FIXME if more then 1 p4out is new, 1 gets lost. | 242 | struct us428_p4out *p4out = us428ctls->p4out + send; // FIXME if more then 1 p4out is new, 1 gets lost. |
243 | usb_fill_bulk_urb(usX2Y->AS04.urb[j], usX2Y->chip.dev, | 243 | usb_fill_bulk_urb(usX2Y->AS04.urb[j], usX2Y->chip.dev, |
244 | usb_sndbulkpipe(usX2Y->chip.dev, 0x04), &p4out->val.vol, | 244 | usb_sndbulkpipe(usX2Y->chip.dev, 0x04), &p4out->val.vol, |
245 | p4out->type == eLT_Light ? sizeof(us428_lights_t) : 5, | 245 | p4out->type == eLT_Light ? sizeof(struct us428_lights) : 5, |
246 | i_usX2Y_Out04Int, usX2Y); | 246 | i_usX2Y_Out04Int, usX2Y); |
247 | err = usb_submit_urb(usX2Y->AS04.urb[j], GFP_ATOMIC); | 247 | err = usb_submit_urb(usX2Y->AS04.urb[j], GFP_ATOMIC); |
248 | us428ctls->p4outSent = send; | 248 | us428ctls->p4outSent = send; |
@@ -261,7 +261,7 @@ static void i_usX2Y_In04Int(struct urb* urb, struct pt_regs *regs) | |||
261 | /* | 261 | /* |
262 | * Prepare some urbs | 262 | * Prepare some urbs |
263 | */ | 263 | */ |
264 | int usX2Y_AsyncSeq04_init(usX2Ydev_t* usX2Y) | 264 | int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y) |
265 | { | 265 | { |
266 | int err = 0, | 266 | int err = 0, |
267 | i; | 267 | i; |
@@ -283,9 +283,8 @@ int usX2Y_AsyncSeq04_init(usX2Ydev_t* usX2Y) | |||
283 | return err; | 283 | return err; |
284 | } | 284 | } |
285 | 285 | ||
286 | int usX2Y_In04_init(usX2Ydev_t* usX2Y) | 286 | int usX2Y_In04_init(struct usX2Ydev *usX2Y) |
287 | { | 287 | { |
288 | int err = 0; | ||
289 | if (! (usX2Y->In04urb = usb_alloc_urb(0, GFP_KERNEL))) | 288 | if (! (usX2Y->In04urb = usb_alloc_urb(0, GFP_KERNEL))) |
290 | return -ENOMEM; | 289 | return -ENOMEM; |
291 | 290 | ||
@@ -299,11 +298,10 @@ int usX2Y_In04_init(usX2Ydev_t* usX2Y) | |||
299 | usX2Y->In04Buf, 21, | 298 | usX2Y->In04Buf, 21, |
300 | i_usX2Y_In04Int, usX2Y, | 299 | i_usX2Y_In04Int, usX2Y, |
301 | 10); | 300 | 10); |
302 | err = usb_submit_urb(usX2Y->In04urb, GFP_KERNEL); | 301 | return usb_submit_urb(usX2Y->In04urb, GFP_KERNEL); |
303 | return err; | ||
304 | } | 302 | } |
305 | 303 | ||
306 | static void usX2Y_unlinkSeq(snd_usX2Y_AsyncSeq_t* S) | 304 | static void usX2Y_unlinkSeq(struct snd_usX2Y_AsyncSeq *S) |
307 | { | 305 | { |
308 | int i; | 306 | int i; |
309 | for (i = 0; i < URBS_AsyncSeq; ++i) { | 307 | for (i = 0; i < URBS_AsyncSeq; ++i) { |
@@ -336,16 +334,16 @@ static struct usb_device_id snd_usX2Y_usb_id_table[] = { | |||
336 | { /* terminator */ } | 334 | { /* terminator */ } |
337 | }; | 335 | }; |
338 | 336 | ||
339 | static snd_card_t* usX2Y_create_card(struct usb_device* device) | 337 | static struct snd_card *usX2Y_create_card(struct usb_device *device) |
340 | { | 338 | { |
341 | int dev; | 339 | int dev; |
342 | snd_card_t* card; | 340 | struct snd_card * card; |
343 | for (dev = 0; dev < SNDRV_CARDS; ++dev) | 341 | for (dev = 0; dev < SNDRV_CARDS; ++dev) |
344 | if (enable[dev] && !snd_usX2Y_card_used[dev]) | 342 | if (enable[dev] && !snd_usX2Y_card_used[dev]) |
345 | break; | 343 | break; |
346 | if (dev >= SNDRV_CARDS) | 344 | if (dev >= SNDRV_CARDS) |
347 | return NULL; | 345 | return NULL; |
348 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(usX2Ydev_t)); | 346 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct usX2Ydev)); |
349 | if (!card) | 347 | if (!card) |
350 | return NULL; | 348 | return NULL; |
351 | snd_usX2Y_card_used[usX2Y(card)->chip.index = dev] = 1; | 349 | snd_usX2Y_card_used[usX2Y(card)->chip.index = dev] = 1; |
@@ -369,10 +367,10 @@ static snd_card_t* usX2Y_create_card(struct usb_device* device) | |||
369 | } | 367 | } |
370 | 368 | ||
371 | 369 | ||
372 | static void* usX2Y_usb_probe(struct usb_device* device, struct usb_interface *intf, const struct usb_device_id* device_id) | 370 | static void *usX2Y_usb_probe(struct usb_device *device, struct usb_interface *intf, const struct usb_device_id *device_id) |
373 | { | 371 | { |
374 | int err; | 372 | int err; |
375 | snd_card_t* card; | 373 | struct snd_card * card; |
376 | if (le16_to_cpu(device->descriptor.idVendor) != 0x1604 || | 374 | if (le16_to_cpu(device->descriptor.idVendor) != 0x1604 || |
377 | (le16_to_cpu(device->descriptor.idProduct) != USB_ID_US122 && | 375 | (le16_to_cpu(device->descriptor.idProduct) != USB_ID_US122 && |
378 | le16_to_cpu(device->descriptor.idProduct) != USB_ID_US224 && | 376 | le16_to_cpu(device->descriptor.idProduct) != USB_ID_US224 && |
@@ -415,7 +413,7 @@ static struct usb_driver snd_usX2Y_usb_driver = { | |||
415 | .id_table = snd_usX2Y_usb_id_table, | 413 | .id_table = snd_usX2Y_usb_id_table, |
416 | }; | 414 | }; |
417 | 415 | ||
418 | static void snd_usX2Y_card_private_free(snd_card_t *card) | 416 | static void snd_usX2Y_card_private_free(struct snd_card *card) |
419 | { | 417 | { |
420 | kfree(usX2Y(card)->In04Buf); | 418 | kfree(usX2Y(card)->In04Buf); |
421 | usb_free_urb(usX2Y(card)->In04urb); | 419 | usb_free_urb(usX2Y(card)->In04urb); |
@@ -428,23 +426,24 @@ static void snd_usX2Y_card_private_free(snd_card_t *card) | |||
428 | /* | 426 | /* |
429 | * Frees the device. | 427 | * Frees the device. |
430 | */ | 428 | */ |
431 | static void usX2Y_usb_disconnect(struct usb_device* device, void* ptr) | 429 | static void usX2Y_usb_disconnect(struct usb_device *device, void* ptr) |
432 | { | 430 | { |
433 | if (ptr) { | 431 | if (ptr) { |
434 | usX2Ydev_t* usX2Y = usX2Y((snd_card_t*)ptr); | 432 | struct snd_card *card = ptr; |
435 | struct list_head* p; | 433 | struct usX2Ydev *usX2Y = usX2Y(card); |
434 | struct list_head *p; | ||
436 | usX2Y->chip.shutdown = 1; | 435 | usX2Y->chip.shutdown = 1; |
437 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; | 436 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; |
438 | usX2Y_unlinkSeq(&usX2Y->AS04); | 437 | usX2Y_unlinkSeq(&usX2Y->AS04); |
439 | usb_kill_urb(usX2Y->In04urb); | 438 | usb_kill_urb(usX2Y->In04urb); |
440 | snd_card_disconnect((snd_card_t*)ptr); | 439 | snd_card_disconnect(card); |
441 | /* release the midi resources */ | 440 | /* release the midi resources */ |
442 | list_for_each(p, &usX2Y->chip.midi_list) { | 441 | list_for_each(p, &usX2Y->chip.midi_list) { |
443 | snd_usbmidi_disconnect(p); | 442 | snd_usbmidi_disconnect(p); |
444 | } | 443 | } |
445 | if (usX2Y->us428ctls_sharedmem) | 444 | if (usX2Y->us428ctls_sharedmem) |
446 | wake_up(&usX2Y->us428ctls_wait_queue_head); | 445 | wake_up(&usX2Y->us428ctls_wait_queue_head); |
447 | snd_card_free((snd_card_t*)ptr); | 446 | snd_card_free(card); |
448 | } | 447 | } |
449 | } | 448 | } |
450 | 449 | ||
diff --git a/sound/usb/usx2y/usbusx2y.h b/sound/usb/usx2y/usbusx2y.h index f65f3a7194ca..435c1feda9df 100644 --- a/sound/usb/usx2y/usbusx2y.h +++ b/sound/usb/usx2y/usbusx2y.h | |||
@@ -8,47 +8,46 @@ | |||
8 | 8 | ||
9 | #define URBS_AsyncSeq 10 | 9 | #define URBS_AsyncSeq 10 |
10 | #define URB_DataLen_AsyncSeq 32 | 10 | #define URB_DataLen_AsyncSeq 32 |
11 | typedef struct { | 11 | struct snd_usX2Y_AsyncSeq { |
12 | struct urb* urb[URBS_AsyncSeq]; | 12 | struct urb *urb[URBS_AsyncSeq]; |
13 | char* buffer; | 13 | char *buffer; |
14 | } snd_usX2Y_AsyncSeq_t; | 14 | }; |
15 | 15 | ||
16 | typedef struct { | 16 | struct snd_usX2Y_urbSeq { |
17 | int submitted; | 17 | int submitted; |
18 | int len; | 18 | int len; |
19 | struct urb* urb[0]; | 19 | struct urb *urb[0]; |
20 | } snd_usX2Y_urbSeq_t; | 20 | }; |
21 | 21 | ||
22 | typedef struct snd_usX2Y_substream snd_usX2Y_substream_t; | ||
23 | #include "usx2yhwdeppcm.h" | 22 | #include "usx2yhwdeppcm.h" |
24 | 23 | ||
25 | typedef struct { | 24 | struct usX2Ydev { |
26 | snd_usb_audio_t chip; | 25 | struct snd_usb_audio chip; |
27 | int stride; | 26 | int stride; |
28 | struct urb *In04urb; | 27 | struct urb *In04urb; |
29 | void *In04Buf; | 28 | void *In04Buf; |
30 | char In04Last[24]; | 29 | char In04Last[24]; |
31 | unsigned In04IntCalls; | 30 | unsigned In04IntCalls; |
32 | snd_usX2Y_urbSeq_t *US04; | 31 | struct snd_usX2Y_urbSeq *US04; |
33 | wait_queue_head_t In04WaitQueue; | 32 | wait_queue_head_t In04WaitQueue; |
34 | snd_usX2Y_AsyncSeq_t AS04; | 33 | struct snd_usX2Y_AsyncSeq AS04; |
35 | unsigned int rate, | 34 | unsigned int rate, |
36 | format; | 35 | format; |
37 | int chip_status; | 36 | int chip_status; |
38 | struct semaphore prepare_mutex; | 37 | struct semaphore prepare_mutex; |
39 | us428ctls_sharedmem_t *us428ctls_sharedmem; | 38 | struct us428ctls_sharedmem *us428ctls_sharedmem; |
40 | int wait_iso_frame; | 39 | int wait_iso_frame; |
41 | wait_queue_head_t us428ctls_wait_queue_head; | 40 | wait_queue_head_t us428ctls_wait_queue_head; |
42 | snd_usX2Y_hwdep_pcm_shm_t *hwdep_pcm_shm; | 41 | struct snd_usX2Y_hwdep_pcm_shm *hwdep_pcm_shm; |
43 | snd_usX2Y_substream_t *subs[4]; | 42 | struct snd_usX2Y_substream *subs[4]; |
44 | snd_usX2Y_substream_t * volatile prepare_subs; | 43 | struct snd_usX2Y_substream * volatile prepare_subs; |
45 | wait_queue_head_t prepare_wait_queue; | 44 | wait_queue_head_t prepare_wait_queue; |
46 | } usX2Ydev_t; | 45 | }; |
47 | 46 | ||
48 | 47 | ||
49 | struct snd_usX2Y_substream { | 48 | struct snd_usX2Y_substream { |
50 | usX2Ydev_t *usX2Y; | 49 | struct usX2Ydev *usX2Y; |
51 | snd_pcm_substream_t *pcm_substream; | 50 | struct snd_pcm_substream *pcm_substream; |
52 | 51 | ||
53 | int endpoint; | 52 | int endpoint; |
54 | unsigned int maxpacksize; /* max packet size in bytes */ | 53 | unsigned int maxpacksize; /* max packet size in bytes */ |
@@ -72,12 +71,12 @@ struct snd_usX2Y_substream { | |||
72 | }; | 71 | }; |
73 | 72 | ||
74 | 73 | ||
75 | #define usX2Y(c) ((usX2Ydev_t*)(c)->private_data) | 74 | #define usX2Y(c) ((struct usX2Ydev *)(c)->private_data) |
76 | 75 | ||
77 | int usX2Y_audio_create(snd_card_t* card); | 76 | int usX2Y_audio_create(struct snd_card *card); |
78 | 77 | ||
79 | int usX2Y_AsyncSeq04_init(usX2Ydev_t* usX2Y); | 78 | int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y); |
80 | int usX2Y_In04_init(usX2Ydev_t* usX2Y); | 79 | int usX2Y_In04_init(struct usX2Ydev *usX2Y); |
81 | 80 | ||
82 | #define NAME_ALLCAPS "US-X2Y" | 81 | #define NAME_ALLCAPS "US-X2Y" |
83 | 82 | ||
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index affda973cece..a6bbc7a6348f 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c | |||
@@ -67,18 +67,20 @@ | |||
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | 69 | ||
70 | static int usX2Y_urb_capt_retire(snd_usX2Y_substream_t *subs) | 70 | static int usX2Y_urb_capt_retire(struct snd_usX2Y_substream *subs) |
71 | { | 71 | { |
72 | struct urb *urb = subs->completed_urb; | 72 | struct urb *urb = subs->completed_urb; |
73 | snd_pcm_runtime_t *runtime = subs->pcm_substream->runtime; | 73 | struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; |
74 | unsigned char *cp; | 74 | unsigned char *cp; |
75 | int i, len, lens = 0, hwptr_done = subs->hwptr_done; | 75 | int i, len, lens = 0, hwptr_done = subs->hwptr_done; |
76 | usX2Ydev_t *usX2Y = subs->usX2Y; | 76 | struct usX2Ydev *usX2Y = subs->usX2Y; |
77 | 77 | ||
78 | for (i = 0; i < nr_of_packs(); i++) { | 78 | for (i = 0; i < nr_of_packs(); i++) { |
79 | cp = (unsigned char*)urb->transfer_buffer + urb->iso_frame_desc[i].offset; | 79 | cp = (unsigned char*)urb->transfer_buffer + urb->iso_frame_desc[i].offset; |
80 | if (urb->iso_frame_desc[i].status) { /* active? hmm, skip this */ | 80 | if (urb->iso_frame_desc[i].status) { /* active? hmm, skip this */ |
81 | snd_printk(KERN_ERR "activ frame status %i. Most propably some hardware problem.\n", urb->iso_frame_desc[i].status); | 81 | snd_printk(KERN_ERR "active frame status %i. " |
82 | "Most propably some hardware problem.\n", | ||
83 | urb->iso_frame_desc[i].status); | ||
82 | return urb->iso_frame_desc[i].status; | 84 | return urb->iso_frame_desc[i].status; |
83 | } | 85 | } |
84 | len = urb->iso_frame_desc[i].actual_length / usX2Y->stride; | 86 | len = urb->iso_frame_desc[i].actual_length / usX2Y->stride; |
@@ -94,7 +96,8 @@ static int usX2Y_urb_capt_retire(snd_usX2Y_substream_t *subs) | |||
94 | memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, blen); | 96 | memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, blen); |
95 | memcpy(runtime->dma_area, cp + blen, len * usX2Y->stride - blen); | 97 | memcpy(runtime->dma_area, cp + blen, len * usX2Y->stride - blen); |
96 | } else { | 98 | } else { |
97 | memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, len * usX2Y->stride); | 99 | memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, |
100 | len * usX2Y->stride); | ||
98 | } | 101 | } |
99 | lens += len; | 102 | lens += len; |
100 | if ((hwptr_done += len) >= runtime->buffer_size) | 103 | if ((hwptr_done += len) >= runtime->buffer_size) |
@@ -120,13 +123,13 @@ static int usX2Y_urb_capt_retire(snd_usX2Y_substream_t *subs) | |||
120 | * it directly from the buffer. thus the data is once copied to | 123 | * it directly from the buffer. thus the data is once copied to |
121 | * a temporary buffer and urb points to that. | 124 | * a temporary buffer and urb points to that. |
122 | */ | 125 | */ |
123 | static int usX2Y_urb_play_prepare(snd_usX2Y_substream_t *subs, | 126 | static int usX2Y_urb_play_prepare(struct snd_usX2Y_substream *subs, |
124 | struct urb *cap_urb, | 127 | struct urb *cap_urb, |
125 | struct urb *urb) | 128 | struct urb *urb) |
126 | { | 129 | { |
127 | int count, counts, pack; | 130 | int count, counts, pack; |
128 | usX2Ydev_t* usX2Y = subs->usX2Y; | 131 | struct usX2Ydev *usX2Y = subs->usX2Y; |
129 | snd_pcm_runtime_t *runtime = subs->pcm_substream->runtime; | 132 | struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; |
130 | 133 | ||
131 | count = 0; | 134 | count = 0; |
132 | for (pack = 0; pack < nr_of_packs(); pack++) { | 135 | for (pack = 0; pack < nr_of_packs(); pack++) { |
@@ -139,7 +142,8 @@ static int usX2Y_urb_play_prepare(snd_usX2Y_substream_t *subs, | |||
139 | } | 142 | } |
140 | /* set up descriptor */ | 143 | /* set up descriptor */ |
141 | urb->iso_frame_desc[pack].offset = pack ? | 144 | urb->iso_frame_desc[pack].offset = pack ? |
142 | urb->iso_frame_desc[pack - 1].offset + urb->iso_frame_desc[pack - 1].length : | 145 | urb->iso_frame_desc[pack - 1].offset + |
146 | urb->iso_frame_desc[pack - 1].length : | ||
143 | 0; | 147 | 0; |
144 | urb->iso_frame_desc[pack].length = cap_urb->iso_frame_desc[pack].actual_length; | 148 | urb->iso_frame_desc[pack].length = cap_urb->iso_frame_desc[pack].actual_length; |
145 | } | 149 | } |
@@ -151,8 +155,10 @@ static int usX2Y_urb_play_prepare(snd_usX2Y_substream_t *subs, | |||
151 | int len; | 155 | int len; |
152 | len = runtime->buffer_size - subs->hwptr; | 156 | len = runtime->buffer_size - subs->hwptr; |
153 | urb->transfer_buffer = subs->tmpbuf; | 157 | urb->transfer_buffer = subs->tmpbuf; |
154 | memcpy(subs->tmpbuf, runtime->dma_area + subs->hwptr * usX2Y->stride, len * usX2Y->stride); | 158 | memcpy(subs->tmpbuf, runtime->dma_area + |
155 | memcpy(subs->tmpbuf + len * usX2Y->stride, runtime->dma_area, (count - len) * usX2Y->stride); | 159 | subs->hwptr * usX2Y->stride, len * usX2Y->stride); |
160 | memcpy(subs->tmpbuf + len * usX2Y->stride, | ||
161 | runtime->dma_area, (count - len) * usX2Y->stride); | ||
156 | subs->hwptr += count; | 162 | subs->hwptr += count; |
157 | subs->hwptr -= runtime->buffer_size; | 163 | subs->hwptr -= runtime->buffer_size; |
158 | } else { | 164 | } else { |
@@ -172,9 +178,9 @@ static int usX2Y_urb_play_prepare(snd_usX2Y_substream_t *subs, | |||
172 | * | 178 | * |
173 | * update the current position and call callback if a period is processed. | 179 | * update the current position and call callback if a period is processed. |
174 | */ | 180 | */ |
175 | static void usX2Y_urb_play_retire(snd_usX2Y_substream_t *subs, struct urb *urb) | 181 | static void usX2Y_urb_play_retire(struct snd_usX2Y_substream *subs, struct urb *urb) |
176 | { | 182 | { |
177 | snd_pcm_runtime_t *runtime = subs->pcm_substream->runtime; | 183 | struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; |
178 | int len = urb->actual_length / subs->usX2Y->stride; | 184 | int len = urb->actual_length / subs->usX2Y->stride; |
179 | 185 | ||
180 | subs->transfer_done += len; | 186 | subs->transfer_done += len; |
@@ -187,7 +193,7 @@ static void usX2Y_urb_play_retire(snd_usX2Y_substream_t *subs, struct urb *urb) | |||
187 | } | 193 | } |
188 | } | 194 | } |
189 | 195 | ||
190 | static int usX2Y_urb_submit(snd_usX2Y_substream_t *subs, struct urb *urb, int frame) | 196 | static int usX2Y_urb_submit(struct snd_usX2Y_substream *subs, struct urb *urb, int frame) |
191 | { | 197 | { |
192 | int err; | 198 | int err; |
193 | if (!urb) | 199 | if (!urb) |
@@ -202,50 +208,47 @@ static int usX2Y_urb_submit(snd_usX2Y_substream_t *subs, struct urb *urb, int fr | |||
202 | return 0; | 208 | return 0; |
203 | } | 209 | } |
204 | 210 | ||
205 | static inline int usX2Y_usbframe_complete(snd_usX2Y_substream_t *capsubs, snd_usX2Y_substream_t *playbacksubs, int frame) | 211 | static inline int usX2Y_usbframe_complete(struct snd_usX2Y_substream *capsubs, |
212 | struct snd_usX2Y_substream *playbacksubs, | ||
213 | int frame) | ||
206 | { | 214 | { |
207 | int err, state; | 215 | int err, state; |
208 | { | 216 | struct urb *urb = playbacksubs->completed_urb; |
209 | struct urb *urb = playbacksubs->completed_urb; | 217 | |
210 | 218 | state = atomic_read(&playbacksubs->state); | |
211 | state = atomic_read(&playbacksubs->state); | 219 | if (NULL != urb) { |
212 | if (NULL != urb) { | 220 | if (state == state_RUNNING) |
213 | if (state == state_RUNNING) | 221 | usX2Y_urb_play_retire(playbacksubs, urb); |
214 | usX2Y_urb_play_retire(playbacksubs, urb); | 222 | else if (state >= state_PRERUNNING) |
215 | else | 223 | atomic_inc(&playbacksubs->state); |
216 | if (state >= state_PRERUNNING) { | 224 | } else { |
217 | atomic_inc(&playbacksubs->state); | 225 | switch (state) { |
218 | } | 226 | case state_STARTING1: |
219 | } else { | 227 | urb = playbacksubs->urb[0]; |
220 | switch (state) { | 228 | atomic_inc(&playbacksubs->state); |
221 | case state_STARTING1: | 229 | break; |
222 | urb = playbacksubs->urb[0]; | 230 | case state_STARTING2: |
223 | atomic_inc(&playbacksubs->state); | 231 | urb = playbacksubs->urb[1]; |
224 | break; | 232 | atomic_inc(&playbacksubs->state); |
225 | case state_STARTING2: | 233 | break; |
226 | urb = playbacksubs->urb[1]; | ||
227 | atomic_inc(&playbacksubs->state); | ||
228 | break; | ||
229 | } | ||
230 | } | 234 | } |
231 | if (urb) { | 235 | } |
232 | if ((err = usX2Y_urb_play_prepare(playbacksubs, capsubs->completed_urb, urb)) || | 236 | if (urb) { |
233 | (err = usX2Y_urb_submit(playbacksubs, urb, frame))) { | 237 | if ((err = usX2Y_urb_play_prepare(playbacksubs, capsubs->completed_urb, urb)) || |
234 | return err; | 238 | (err = usX2Y_urb_submit(playbacksubs, urb, frame))) { |
235 | } | 239 | return err; |
236 | } | 240 | } |
237 | |||
238 | playbacksubs->completed_urb = NULL; | ||
239 | } | 241 | } |
242 | |||
243 | playbacksubs->completed_urb = NULL; | ||
244 | |||
240 | state = atomic_read(&capsubs->state); | 245 | state = atomic_read(&capsubs->state); |
241 | if (state >= state_PREPARED) { | 246 | if (state >= state_PREPARED) { |
242 | if (state == state_RUNNING) { | 247 | if (state == state_RUNNING) { |
243 | if ((err = usX2Y_urb_capt_retire(capsubs))) | 248 | if ((err = usX2Y_urb_capt_retire(capsubs))) |
244 | return err; | 249 | return err; |
245 | } else | 250 | } else if (state >= state_PRERUNNING) |
246 | if (state >= state_PRERUNNING) { | 251 | atomic_inc(&capsubs->state); |
247 | atomic_inc(&capsubs->state); | ||
248 | } | ||
249 | if ((err = usX2Y_urb_submit(capsubs, capsubs->completed_urb, frame))) | 252 | if ((err = usX2Y_urb_submit(capsubs, capsubs->completed_urb, frame))) |
250 | return err; | 253 | return err; |
251 | } | 254 | } |
@@ -254,18 +257,19 @@ static inline int usX2Y_usbframe_complete(snd_usX2Y_substream_t *capsubs, snd_us | |||
254 | } | 257 | } |
255 | 258 | ||
256 | 259 | ||
257 | static void usX2Y_clients_stop(usX2Ydev_t *usX2Y) | 260 | static void usX2Y_clients_stop(struct usX2Ydev *usX2Y) |
258 | { | 261 | { |
259 | int s, u; | 262 | int s, u; |
263 | |||
260 | for (s = 0; s < 4; s++) { | 264 | for (s = 0; s < 4; s++) { |
261 | snd_usX2Y_substream_t *subs = usX2Y->subs[s]; | 265 | struct snd_usX2Y_substream *subs = usX2Y->subs[s]; |
262 | if (subs) { | 266 | if (subs) { |
263 | snd_printdd("%i %p state=%i\n", s, subs, atomic_read(&subs->state)); | 267 | snd_printdd("%i %p state=%i\n", s, subs, atomic_read(&subs->state)); |
264 | atomic_set(&subs->state, state_STOPPED); | 268 | atomic_set(&subs->state, state_STOPPED); |
265 | } | 269 | } |
266 | } | 270 | } |
267 | for (s = 0; s < 4; s++) { | 271 | for (s = 0; s < 4; s++) { |
268 | snd_usX2Y_substream_t *subs = usX2Y->subs[s]; | 272 | struct snd_usX2Y_substream *subs = usX2Y->subs[s]; |
269 | if (subs) { | 273 | if (subs) { |
270 | if (atomic_read(&subs->state) >= state_PRERUNNING) { | 274 | if (atomic_read(&subs->state) >= state_PRERUNNING) { |
271 | snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN); | 275 | snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN); |
@@ -273,7 +277,8 @@ static void usX2Y_clients_stop(usX2Ydev_t *usX2Y) | |||
273 | for (u = 0; u < NRURBS; u++) { | 277 | for (u = 0; u < NRURBS; u++) { |
274 | struct urb *urb = subs->urb[u]; | 278 | struct urb *urb = subs->urb[u]; |
275 | if (NULL != urb) | 279 | if (NULL != urb) |
276 | snd_printdd("%i status=%i start_frame=%i\n", u, urb->status, urb->start_frame); | 280 | snd_printdd("%i status=%i start_frame=%i\n", |
281 | u, urb->status, urb->start_frame); | ||
277 | } | 282 | } |
278 | } | 283 | } |
279 | } | 284 | } |
@@ -281,30 +286,36 @@ static void usX2Y_clients_stop(usX2Ydev_t *usX2Y) | |||
281 | wake_up(&usX2Y->prepare_wait_queue); | 286 | wake_up(&usX2Y->prepare_wait_queue); |
282 | } | 287 | } |
283 | 288 | ||
284 | static void usX2Y_error_urb_status(usX2Ydev_t *usX2Y, snd_usX2Y_substream_t *subs, struct urb *urb) | 289 | static void usX2Y_error_urb_status(struct usX2Ydev *usX2Y, |
290 | struct snd_usX2Y_substream *subs, struct urb *urb) | ||
285 | { | 291 | { |
286 | snd_printk(KERN_ERR "ep=%i stalled with status=%i\n", subs->endpoint, urb->status); | 292 | snd_printk(KERN_ERR "ep=%i stalled with status=%i\n", subs->endpoint, urb->status); |
287 | urb->status = 0; | 293 | urb->status = 0; |
288 | usX2Y_clients_stop(usX2Y); | 294 | usX2Y_clients_stop(usX2Y); |
289 | } | 295 | } |
290 | 296 | ||
291 | static void usX2Y_error_sequence(usX2Ydev_t *usX2Y, snd_usX2Y_substream_t *subs, struct urb *urb) | 297 | static void usX2Y_error_sequence(struct usX2Ydev *usX2Y, |
298 | struct snd_usX2Y_substream *subs, struct urb *urb) | ||
292 | { | 299 | { |
293 | snd_printk(KERN_ERR "Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n" | 300 | snd_printk(KERN_ERR "Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n" |
294 | KERN_ERR "Most propably some urb of usb-frame %i is still missing.\n" | 301 | KERN_ERR "Most propably some urb of usb-frame %i is still missing.\n" |
295 | KERN_ERR "Cause could be too long delays in usb-hcd interrupt handling.\n", | 302 | KERN_ERR "Cause could be too long delays in usb-hcd interrupt handling.\n", |
296 | usb_get_current_frame_number(usX2Y->chip.dev), | 303 | usb_get_current_frame_number(usX2Y->chip.dev), |
297 | subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame); | 304 | subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", |
305 | usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame); | ||
298 | usX2Y_clients_stop(usX2Y); | 306 | usX2Y_clients_stop(usX2Y); |
299 | } | 307 | } |
300 | 308 | ||
301 | static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) | 309 | static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) |
302 | { | 310 | { |
303 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t*)urb->context; | 311 | struct snd_usX2Y_substream *subs = urb->context; |
304 | usX2Ydev_t *usX2Y = subs->usX2Y; | 312 | struct usX2Ydev *usX2Y = subs->usX2Y; |
305 | 313 | ||
306 | if (unlikely(atomic_read(&subs->state) < state_PREPARED)) { | 314 | if (unlikely(atomic_read(&subs->state) < state_PREPARED)) { |
307 | snd_printdd("hcd_frame=%i ep=%i%s status=%i start_frame=%i\n", usb_get_current_frame_number(usX2Y->chip.dev), subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", urb->status, urb->start_frame); | 315 | snd_printdd("hcd_frame=%i ep=%i%s status=%i start_frame=%i\n", |
316 | usb_get_current_frame_number(usX2Y->chip.dev), | ||
317 | subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", | ||
318 | urb->status, urb->start_frame); | ||
308 | return; | 319 | return; |
309 | } | 320 | } |
310 | if (unlikely(urb->status)) { | 321 | if (unlikely(urb->status)) { |
@@ -318,10 +329,12 @@ static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) | |||
318 | return; | 329 | return; |
319 | } | 330 | } |
320 | { | 331 | { |
321 | snd_usX2Y_substream_t *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], | 332 | struct snd_usX2Y_substream *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], |
322 | *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; | 333 | *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; |
323 | if (capsubs->completed_urb && atomic_read(&capsubs->state) >= state_PREPARED && | 334 | if (capsubs->completed_urb && |
324 | (playbacksubs->completed_urb || atomic_read(&playbacksubs->state) < state_PREPARED)) { | 335 | atomic_read(&capsubs->state) >= state_PREPARED && |
336 | (playbacksubs->completed_urb || | ||
337 | atomic_read(&playbacksubs->state) < state_PREPARED)) { | ||
325 | if (!usX2Y_usbframe_complete(capsubs, playbacksubs, urb->start_frame)) { | 338 | if (!usX2Y_usbframe_complete(capsubs, playbacksubs, urb->start_frame)) { |
326 | if (nr_of_packs() <= urb->start_frame && | 339 | if (nr_of_packs() <= urb->start_frame && |
327 | urb->start_frame <= (2 * nr_of_packs() - 1)) // uhci and ohci | 340 | urb->start_frame <= (2 * nr_of_packs() - 1)) // uhci and ohci |
@@ -336,11 +349,12 @@ static void i_usX2Y_urb_complete(struct urb *urb, struct pt_regs *regs) | |||
336 | } | 349 | } |
337 | } | 350 | } |
338 | 351 | ||
339 | static void usX2Y_urbs_set_complete(usX2Ydev_t * usX2Y, void (*complete)(struct urb *, struct pt_regs *)) | 352 | static void usX2Y_urbs_set_complete(struct usX2Ydev * usX2Y, |
353 | void (*complete)(struct urb *, struct pt_regs *)) | ||
340 | { | 354 | { |
341 | int s, u; | 355 | int s, u; |
342 | for (s = 0; s < 4; s++) { | 356 | for (s = 0; s < 4; s++) { |
343 | snd_usX2Y_substream_t *subs = usX2Y->subs[s]; | 357 | struct snd_usX2Y_substream *subs = usX2Y->subs[s]; |
344 | if (NULL != subs) | 358 | if (NULL != subs) |
345 | for (u = 0; u < NRURBS; u++) { | 359 | for (u = 0; u < NRURBS; u++) { |
346 | struct urb * urb = subs->urb[u]; | 360 | struct urb * urb = subs->urb[u]; |
@@ -350,7 +364,7 @@ static void usX2Y_urbs_set_complete(usX2Ydev_t * usX2Y, void (*complete)(struct | |||
350 | } | 364 | } |
351 | } | 365 | } |
352 | 366 | ||
353 | static void usX2Y_subs_startup_finish(usX2Ydev_t * usX2Y) | 367 | static void usX2Y_subs_startup_finish(struct usX2Ydev * usX2Y) |
354 | { | 368 | { |
355 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_urb_complete); | 369 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_urb_complete); |
356 | usX2Y->prepare_subs = NULL; | 370 | usX2Y->prepare_subs = NULL; |
@@ -358,9 +372,9 @@ static void usX2Y_subs_startup_finish(usX2Ydev_t * usX2Y) | |||
358 | 372 | ||
359 | static void i_usX2Y_subs_startup(struct urb *urb, struct pt_regs *regs) | 373 | static void i_usX2Y_subs_startup(struct urb *urb, struct pt_regs *regs) |
360 | { | 374 | { |
361 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t*)urb->context; | 375 | struct snd_usX2Y_substream *subs = urb->context; |
362 | usX2Ydev_t *usX2Y = subs->usX2Y; | 376 | struct usX2Ydev *usX2Y = subs->usX2Y; |
363 | snd_usX2Y_substream_t *prepare_subs = usX2Y->prepare_subs; | 377 | struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs; |
364 | if (NULL != prepare_subs) | 378 | if (NULL != prepare_subs) |
365 | if (urb->start_frame == prepare_subs->urb[0]->start_frame) { | 379 | if (urb->start_frame == prepare_subs->urb[0]->start_frame) { |
366 | usX2Y_subs_startup_finish(usX2Y); | 380 | usX2Y_subs_startup_finish(usX2Y); |
@@ -371,9 +385,10 @@ static void i_usX2Y_subs_startup(struct urb *urb, struct pt_regs *regs) | |||
371 | i_usX2Y_urb_complete(urb, regs); | 385 | i_usX2Y_urb_complete(urb, regs); |
372 | } | 386 | } |
373 | 387 | ||
374 | static void usX2Y_subs_prepare(snd_usX2Y_substream_t *subs) | 388 | static void usX2Y_subs_prepare(struct snd_usX2Y_substream *subs) |
375 | { | 389 | { |
376 | snd_printdd("usX2Y_substream_prepare(%p) ep=%i urb0=%p urb1=%p\n", subs, subs->endpoint, subs->urb[0], subs->urb[1]); | 390 | snd_printdd("usX2Y_substream_prepare(%p) ep=%i urb0=%p urb1=%p\n", |
391 | subs, subs->endpoint, subs->urb[0], subs->urb[1]); | ||
377 | /* reset the pointer */ | 392 | /* reset the pointer */ |
378 | subs->hwptr = 0; | 393 | subs->hwptr = 0; |
379 | subs->hwptr_done = 0; | 394 | subs->hwptr_done = 0; |
@@ -381,7 +396,7 @@ static void usX2Y_subs_prepare(snd_usX2Y_substream_t *subs) | |||
381 | } | 396 | } |
382 | 397 | ||
383 | 398 | ||
384 | static void usX2Y_urb_release(struct urb** urb, int free_tb) | 399 | static void usX2Y_urb_release(struct urb **urb, int free_tb) |
385 | { | 400 | { |
386 | if (*urb) { | 401 | if (*urb) { |
387 | usb_kill_urb(*urb); | 402 | usb_kill_urb(*urb); |
@@ -394,12 +409,13 @@ static void usX2Y_urb_release(struct urb** urb, int free_tb) | |||
394 | /* | 409 | /* |
395 | * release a substreams urbs | 410 | * release a substreams urbs |
396 | */ | 411 | */ |
397 | static void usX2Y_urbs_release(snd_usX2Y_substream_t *subs) | 412 | static void usX2Y_urbs_release(struct snd_usX2Y_substream *subs) |
398 | { | 413 | { |
399 | int i; | 414 | int i; |
400 | snd_printdd("usX2Y_urbs_release() %i\n", subs->endpoint); | 415 | snd_printdd("usX2Y_urbs_release() %i\n", subs->endpoint); |
401 | for (i = 0; i < NRURBS; i++) | 416 | for (i = 0; i < NRURBS; i++) |
402 | usX2Y_urb_release(subs->urb + i, subs != subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]); | 417 | usX2Y_urb_release(subs->urb + i, |
418 | subs != subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]); | ||
403 | 419 | ||
404 | kfree(subs->tmpbuf); | 420 | kfree(subs->tmpbuf); |
405 | subs->tmpbuf = NULL; | 421 | subs->tmpbuf = NULL; |
@@ -407,7 +423,7 @@ static void usX2Y_urbs_release(snd_usX2Y_substream_t *subs) | |||
407 | /* | 423 | /* |
408 | * initialize a substream's urbs | 424 | * initialize a substream's urbs |
409 | */ | 425 | */ |
410 | static int usX2Y_urbs_allocate(snd_usX2Y_substream_t *subs) | 426 | static int usX2Y_urbs_allocate(struct snd_usX2Y_substream *subs) |
411 | { | 427 | { |
412 | int i; | 428 | int i; |
413 | unsigned int pipe; | 429 | unsigned int pipe; |
@@ -429,7 +445,7 @@ static int usX2Y_urbs_allocate(snd_usX2Y_substream_t *subs) | |||
429 | } | 445 | } |
430 | /* allocate and initialize data urbs */ | 446 | /* allocate and initialize data urbs */ |
431 | for (i = 0; i < NRURBS; i++) { | 447 | for (i = 0; i < NRURBS; i++) { |
432 | struct urb** purb = subs->urb + i; | 448 | struct urb **purb = subs->urb + i; |
433 | if (*purb) { | 449 | if (*purb) { |
434 | usb_kill_urb(*purb); | 450 | usb_kill_urb(*purb); |
435 | continue; | 451 | continue; |
@@ -457,70 +473,68 @@ static int usX2Y_urbs_allocate(snd_usX2Y_substream_t *subs) | |||
457 | return 0; | 473 | return 0; |
458 | } | 474 | } |
459 | 475 | ||
460 | static void usX2Y_subs_startup(snd_usX2Y_substream_t *subs) | 476 | static void usX2Y_subs_startup(struct snd_usX2Y_substream *subs) |
461 | { | 477 | { |
462 | usX2Ydev_t *usX2Y = subs->usX2Y; | 478 | struct usX2Ydev *usX2Y = subs->usX2Y; |
463 | usX2Y->prepare_subs = subs; | 479 | usX2Y->prepare_subs = subs; |
464 | subs->urb[0]->start_frame = -1; | 480 | subs->urb[0]->start_frame = -1; |
465 | wmb(); | 481 | wmb(); |
466 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_subs_startup); | 482 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_subs_startup); |
467 | } | 483 | } |
468 | 484 | ||
469 | static int usX2Y_urbs_start(snd_usX2Y_substream_t *subs) | 485 | static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs) |
470 | { | 486 | { |
471 | int i, err; | 487 | int i, err; |
472 | usX2Ydev_t *usX2Y = subs->usX2Y; | 488 | struct usX2Ydev *usX2Y = subs->usX2Y; |
473 | 489 | ||
474 | if ((err = usX2Y_urbs_allocate(subs)) < 0) | 490 | if ((err = usX2Y_urbs_allocate(subs)) < 0) |
475 | return err; | 491 | return err; |
476 | subs->completed_urb = NULL; | 492 | subs->completed_urb = NULL; |
477 | for (i = 0; i < 4; i++) { | 493 | for (i = 0; i < 4; i++) { |
478 | snd_usX2Y_substream_t *subs = usX2Y->subs[i]; | 494 | struct snd_usX2Y_substream *subs = usX2Y->subs[i]; |
479 | if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) | 495 | if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) |
480 | goto start; | 496 | goto start; |
481 | } | 497 | } |
482 | usX2Y->wait_iso_frame = -1; | 498 | usX2Y->wait_iso_frame = -1; |
499 | |||
483 | start: | 500 | start: |
484 | { | 501 | usX2Y_subs_startup(subs); |
485 | usX2Y_subs_startup(subs); | 502 | for (i = 0; i < NRURBS; i++) { |
486 | for (i = 0; i < NRURBS; i++) { | 503 | struct urb *urb = subs->urb[i]; |
487 | struct urb *urb = subs->urb[i]; | 504 | if (usb_pipein(urb->pipe)) { |
488 | if (usb_pipein(urb->pipe)) { | 505 | unsigned long pack; |
489 | unsigned long pack; | 506 | if (0 == i) |
490 | if (0 == i) | 507 | atomic_set(&subs->state, state_STARTING3); |
491 | atomic_set(&subs->state, state_STARTING3); | 508 | urb->dev = usX2Y->chip.dev; |
492 | urb->dev = usX2Y->chip.dev; | 509 | urb->transfer_flags = URB_ISO_ASAP; |
493 | urb->transfer_flags = URB_ISO_ASAP; | 510 | for (pack = 0; pack < nr_of_packs(); pack++) { |
494 | for (pack = 0; pack < nr_of_packs(); pack++) { | 511 | urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack; |
495 | urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack; | 512 | urb->iso_frame_desc[pack].length = subs->maxpacksize; |
496 | urb->iso_frame_desc[pack].length = subs->maxpacksize; | 513 | } |
497 | } | 514 | urb->transfer_buffer_length = subs->maxpacksize * nr_of_packs(); |
498 | urb->transfer_buffer_length = subs->maxpacksize * nr_of_packs(); | 515 | if ((err = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { |
499 | if ((err = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { | 516 | snd_printk (KERN_ERR "cannot submit datapipe for urb %d, err = %d\n", i, err); |
500 | snd_printk (KERN_ERR "cannot submit datapipe for urb %d, err = %d\n", i, err); | 517 | err = -EPIPE; |
501 | err = -EPIPE; | 518 | goto cleanup; |
502 | goto cleanup; | ||
503 | } else { | ||
504 | if (0 > usX2Y->wait_iso_frame) | ||
505 | usX2Y->wait_iso_frame = urb->start_frame; | ||
506 | } | ||
507 | urb->transfer_flags = 0; | ||
508 | } else { | 519 | } else { |
509 | atomic_set(&subs->state, state_STARTING1); | 520 | if (0 > usX2Y->wait_iso_frame) |
510 | break; | 521 | usX2Y->wait_iso_frame = urb->start_frame; |
511 | } | 522 | } |
523 | urb->transfer_flags = 0; | ||
524 | } else { | ||
525 | atomic_set(&subs->state, state_STARTING1); | ||
526 | break; | ||
512 | } | 527 | } |
513 | err = 0; | 528 | } |
514 | wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs); | 529 | err = 0; |
515 | if (atomic_read(&subs->state) != state_PREPARED) { | 530 | wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs); |
516 | err = -EPIPE; | 531 | if (atomic_read(&subs->state) != state_PREPARED) |
517 | } | 532 | err = -EPIPE; |
518 | 533 | ||
519 | cleanup: | 534 | cleanup: |
520 | if (err) { | 535 | if (err) { |
521 | usX2Y_subs_startup_finish(usX2Y); | 536 | usX2Y_subs_startup_finish(usX2Y); |
522 | usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything | 537 | usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything |
523 | } | ||
524 | } | 538 | } |
525 | return err; | 539 | return err; |
526 | } | 540 | } |
@@ -528,17 +542,17 @@ static int usX2Y_urbs_start(snd_usX2Y_substream_t *subs) | |||
528 | /* | 542 | /* |
529 | * return the current pcm pointer. just return the hwptr_done value. | 543 | * return the current pcm pointer. just return the hwptr_done value. |
530 | */ | 544 | */ |
531 | static snd_pcm_uframes_t snd_usX2Y_pcm_pointer(snd_pcm_substream_t *substream) | 545 | static snd_pcm_uframes_t snd_usX2Y_pcm_pointer(struct snd_pcm_substream *substream) |
532 | { | 546 | { |
533 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)substream->runtime->private_data; | 547 | struct snd_usX2Y_substream *subs = substream->runtime->private_data; |
534 | return subs->hwptr_done; | 548 | return subs->hwptr_done; |
535 | } | 549 | } |
536 | /* | 550 | /* |
537 | * start/stop substream | 551 | * start/stop substream |
538 | */ | 552 | */ |
539 | static int snd_usX2Y_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | 553 | static int snd_usX2Y_pcm_trigger(struct snd_pcm_substream *substream, int cmd) |
540 | { | 554 | { |
541 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)substream->runtime->private_data; | 555 | struct snd_usX2Y_substream *subs = substream->runtime->private_data; |
542 | 556 | ||
543 | switch (cmd) { | 557 | switch (cmd) { |
544 | case SNDRV_PCM_TRIGGER_START: | 558 | case SNDRV_PCM_TRIGGER_START: |
@@ -649,9 +663,9 @@ static struct s_c2 SetRate48000[] = | |||
649 | }; | 663 | }; |
650 | #define NOOF_SETRATE_URBS ARRAY_SIZE(SetRate48000) | 664 | #define NOOF_SETRATE_URBS ARRAY_SIZE(SetRate48000) |
651 | 665 | ||
652 | static void i_usX2Y_04Int(struct urb* urb, struct pt_regs *regs) | 666 | static void i_usX2Y_04Int(struct urb *urb, struct pt_regs *regs) |
653 | { | 667 | { |
654 | usX2Ydev_t* usX2Y = urb->context; | 668 | struct usX2Ydev *usX2Y = urb->context; |
655 | 669 | ||
656 | if (urb->status) | 670 | if (urb->status) |
657 | snd_printk(KERN_ERR "snd_usX2Y_04Int() urb->status=%i\n", urb->status); | 671 | snd_printk(KERN_ERR "snd_usX2Y_04Int() urb->status=%i\n", urb->status); |
@@ -659,21 +673,20 @@ static void i_usX2Y_04Int(struct urb* urb, struct pt_regs *regs) | |||
659 | wake_up(&usX2Y->In04WaitQueue); | 673 | wake_up(&usX2Y->In04WaitQueue); |
660 | } | 674 | } |
661 | 675 | ||
662 | static int usX2Y_rate_set(usX2Ydev_t *usX2Y, int rate) | 676 | static int usX2Y_rate_set(struct usX2Ydev *usX2Y, int rate) |
663 | { | 677 | { |
664 | int err = 0, i; | 678 | int err = 0, i; |
665 | snd_usX2Y_urbSeq_t *us = NULL; | 679 | struct snd_usX2Y_urbSeq *us = NULL; |
666 | int *usbdata = NULL; | 680 | int *usbdata = NULL; |
667 | struct s_c2 *ra = rate == 48000 ? SetRate48000 : SetRate44100; | 681 | struct s_c2 *ra = rate == 48000 ? SetRate48000 : SetRate44100; |
668 | 682 | ||
669 | if (usX2Y->rate != rate) { | 683 | if (usX2Y->rate != rate) { |
670 | us = kmalloc(sizeof(*us) + sizeof(struct urb*) * NOOF_SETRATE_URBS, GFP_KERNEL); | 684 | us = kzalloc(sizeof(*us) + sizeof(struct urb*) * NOOF_SETRATE_URBS, GFP_KERNEL); |
671 | if (NULL == us) { | 685 | if (NULL == us) { |
672 | err = -ENOMEM; | 686 | err = -ENOMEM; |
673 | goto cleanup; | 687 | goto cleanup; |
674 | } | 688 | } |
675 | memset(us, 0, sizeof(*us) + sizeof(struct urb*) * NOOF_SETRATE_URBS); | 689 | usbdata = kmalloc(sizeof(int) * NOOF_SETRATE_URBS, GFP_KERNEL); |
676 | usbdata = kmalloc(sizeof(int)*NOOF_SETRATE_URBS, GFP_KERNEL); | ||
677 | if (NULL == usbdata) { | 690 | if (NULL == usbdata) { |
678 | err = -ENOMEM; | 691 | err = -ENOMEM; |
679 | goto cleanup; | 692 | goto cleanup; |
@@ -713,9 +726,8 @@ static int usX2Y_rate_set(usX2Ydev_t *usX2Y, int rate) | |||
713 | usX2Y->US04 = NULL; | 726 | usX2Y->US04 = NULL; |
714 | kfree(usbdata); | 727 | kfree(usbdata); |
715 | kfree(us); | 728 | kfree(us); |
716 | if (!err) { | 729 | if (!err) |
717 | usX2Y->rate = rate; | 730 | usX2Y->rate = rate; |
718 | } | ||
719 | } | 731 | } |
720 | } | 732 | } |
721 | 733 | ||
@@ -723,7 +735,7 @@ static int usX2Y_rate_set(usX2Ydev_t *usX2Y, int rate) | |||
723 | } | 735 | } |
724 | 736 | ||
725 | 737 | ||
726 | static int usX2Y_format_set(usX2Ydev_t *usX2Y, snd_pcm_format_t format) | 738 | static int usX2Y_format_set(struct usX2Ydev *usX2Y, snd_pcm_format_t format) |
727 | { | 739 | { |
728 | int alternate, err; | 740 | int alternate, err; |
729 | struct list_head* p; | 741 | struct list_head* p; |
@@ -753,40 +765,40 @@ static int usX2Y_format_set(usX2Ydev_t *usX2Y, snd_pcm_format_t format) | |||
753 | } | 765 | } |
754 | 766 | ||
755 | 767 | ||
756 | static int snd_usX2Y_pcm_hw_params(snd_pcm_substream_t *substream, | 768 | static int snd_usX2Y_pcm_hw_params(struct snd_pcm_substream *substream, |
757 | snd_pcm_hw_params_t *hw_params) | 769 | struct snd_pcm_hw_params *hw_params) |
758 | { | 770 | { |
759 | int err = 0; | 771 | int err = 0; |
760 | unsigned int rate = params_rate(hw_params); | 772 | unsigned int rate = params_rate(hw_params); |
761 | snd_pcm_format_t format = params_format(hw_params); | 773 | snd_pcm_format_t format = params_format(hw_params); |
762 | snd_printdd("snd_usX2Y_hw_params(%p, %p)\n", substream, hw_params); | 774 | struct snd_card *card = substream->pstr->pcm->card; |
775 | struct list_head *list; | ||
763 | 776 | ||
764 | { // all pcm substreams off one usX2Y have to operate at the same rate & format | 777 | snd_printdd("snd_usX2Y_hw_params(%p, %p)\n", substream, hw_params); |
765 | snd_card_t *card = substream->pstr->pcm->card; | 778 | // all pcm substreams off one usX2Y have to operate at the same rate & format |
766 | struct list_head *list; | 779 | list_for_each(list, &card->devices) { |
767 | list_for_each(list, &card->devices) { | 780 | struct snd_device *dev; |
768 | snd_device_t *dev; | 781 | struct snd_pcm *pcm; |
769 | snd_pcm_t *pcm; | 782 | int s; |
770 | int s; | 783 | dev = snd_device(list); |
771 | dev = snd_device(list); | 784 | if (dev->type != SNDRV_DEV_PCM) |
772 | if (dev->type != SNDRV_DEV_PCM) | 785 | continue; |
773 | continue; | 786 | pcm = dev->device_data; |
774 | pcm = dev->device_data; | 787 | for (s = 0; s < 2; ++s) { |
775 | for (s = 0; s < 2; ++s) { | 788 | struct snd_pcm_substream *test_substream; |
776 | snd_pcm_substream_t *test_substream; | 789 | test_substream = pcm->streams[s].substream; |
777 | test_substream = pcm->streams[s].substream; | 790 | if (test_substream && test_substream != substream && |
778 | if (test_substream && test_substream != substream && | 791 | test_substream->runtime && |
779 | test_substream->runtime && | 792 | ((test_substream->runtime->format && |
780 | ((test_substream->runtime->format && | 793 | test_substream->runtime->format != format) || |
781 | test_substream->runtime->format != format) || | 794 | (test_substream->runtime->rate && |
782 | (test_substream->runtime->rate && | 795 | test_substream->runtime->rate != rate))) |
783 | test_substream->runtime->rate != rate))) | 796 | return -EINVAL; |
784 | return -EINVAL; | ||
785 | } | ||
786 | } | 797 | } |
787 | } | 798 | } |
788 | if (0 > (err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)))) { | 799 | if (0 > (err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)))) { |
789 | snd_printk(KERN_ERR "snd_pcm_lib_malloc_pages(%p, %i) returned %i\n", substream, params_buffer_bytes(hw_params), err); | 800 | snd_printk(KERN_ERR "snd_pcm_lib_malloc_pages(%p, %i) returned %i\n", |
801 | substream, params_buffer_bytes(hw_params), err); | ||
790 | return err; | 802 | return err; |
791 | } | 803 | } |
792 | return 0; | 804 | return 0; |
@@ -795,15 +807,15 @@ static int snd_usX2Y_pcm_hw_params(snd_pcm_substream_t *substream, | |||
795 | /* | 807 | /* |
796 | * free the buffer | 808 | * free the buffer |
797 | */ | 809 | */ |
798 | static int snd_usX2Y_pcm_hw_free(snd_pcm_substream_t *substream) | 810 | static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream) |
799 | { | 811 | { |
800 | snd_pcm_runtime_t *runtime = substream->runtime; | 812 | struct snd_pcm_runtime *runtime = substream->runtime; |
801 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)runtime->private_data; | 813 | struct snd_usX2Y_substream *subs = runtime->private_data; |
802 | down(&subs->usX2Y->prepare_mutex); | 814 | down(&subs->usX2Y->prepare_mutex); |
803 | snd_printdd("snd_usX2Y_hw_free(%p)\n", substream); | 815 | snd_printdd("snd_usX2Y_hw_free(%p)\n", substream); |
804 | 816 | ||
805 | if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { | 817 | if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { |
806 | snd_usX2Y_substream_t *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; | 818 | struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; |
807 | atomic_set(&subs->state, state_STOPPED); | 819 | atomic_set(&subs->state, state_STOPPED); |
808 | usX2Y_urbs_release(subs); | 820 | usX2Y_urbs_release(subs); |
809 | if (!cap_subs->pcm_substream || | 821 | if (!cap_subs->pcm_substream || |
@@ -814,7 +826,7 @@ static int snd_usX2Y_pcm_hw_free(snd_pcm_substream_t *substream) | |||
814 | usX2Y_urbs_release(cap_subs); | 826 | usX2Y_urbs_release(cap_subs); |
815 | } | 827 | } |
816 | } else { | 828 | } else { |
817 | snd_usX2Y_substream_t *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; | 829 | struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; |
818 | if (atomic_read(&playback_subs->state) < state_PREPARED) { | 830 | if (atomic_read(&playback_subs->state) < state_PREPARED) { |
819 | atomic_set(&subs->state, state_STOPPED); | 831 | atomic_set(&subs->state, state_STOPPED); |
820 | usX2Y_urbs_release(subs); | 832 | usX2Y_urbs_release(subs); |
@@ -828,12 +840,12 @@ static int snd_usX2Y_pcm_hw_free(snd_pcm_substream_t *substream) | |||
828 | * | 840 | * |
829 | * set format and initialize urbs | 841 | * set format and initialize urbs |
830 | */ | 842 | */ |
831 | static int snd_usX2Y_pcm_prepare(snd_pcm_substream_t *substream) | 843 | static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream) |
832 | { | 844 | { |
833 | snd_pcm_runtime_t *runtime = substream->runtime; | 845 | struct snd_pcm_runtime *runtime = substream->runtime; |
834 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)runtime->private_data; | 846 | struct snd_usX2Y_substream *subs = runtime->private_data; |
835 | usX2Ydev_t *usX2Y = subs->usX2Y; | 847 | struct usX2Ydev *usX2Y = subs->usX2Y; |
836 | snd_usX2Y_substream_t *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; | 848 | struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; |
837 | int err = 0; | 849 | int err = 0; |
838 | snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); | 850 | snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); |
839 | 851 | ||
@@ -861,7 +873,7 @@ static int snd_usX2Y_pcm_prepare(snd_pcm_substream_t *substream) | |||
861 | return err; | 873 | return err; |
862 | } | 874 | } |
863 | 875 | ||
864 | static snd_pcm_hardware_t snd_usX2Y_2c = | 876 | static struct snd_pcm_hardware snd_usX2Y_2c = |
865 | { | 877 | { |
866 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 878 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
867 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 879 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -882,11 +894,11 @@ static snd_pcm_hardware_t snd_usX2Y_2c = | |||
882 | 894 | ||
883 | 895 | ||
884 | 896 | ||
885 | static int snd_usX2Y_pcm_open(snd_pcm_substream_t *substream) | 897 | static int snd_usX2Y_pcm_open(struct snd_pcm_substream *substream) |
886 | { | 898 | { |
887 | snd_usX2Y_substream_t *subs = ((snd_usX2Y_substream_t **) | 899 | struct snd_usX2Y_substream *subs = ((struct snd_usX2Y_substream **) |
888 | snd_pcm_substream_chip(substream))[substream->stream]; | 900 | snd_pcm_substream_chip(substream))[substream->stream]; |
889 | snd_pcm_runtime_t *runtime = substream->runtime; | 901 | struct snd_pcm_runtime *runtime = substream->runtime; |
890 | 902 | ||
891 | if (subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS) | 903 | if (subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS) |
892 | return -EBUSY; | 904 | return -EBUSY; |
@@ -900,19 +912,18 @@ static int snd_usX2Y_pcm_open(snd_pcm_substream_t *substream) | |||
900 | 912 | ||
901 | 913 | ||
902 | 914 | ||
903 | static int snd_usX2Y_pcm_close(snd_pcm_substream_t *substream) | 915 | static int snd_usX2Y_pcm_close(struct snd_pcm_substream *substream) |
904 | { | 916 | { |
905 | snd_pcm_runtime_t *runtime = substream->runtime; | 917 | struct snd_pcm_runtime *runtime = substream->runtime; |
906 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)runtime->private_data; | 918 | struct snd_usX2Y_substream *subs = runtime->private_data; |
907 | int err = 0; | ||
908 | 919 | ||
909 | subs->pcm_substream = NULL; | 920 | subs->pcm_substream = NULL; |
910 | 921 | ||
911 | return err; | 922 | return 0; |
912 | } | 923 | } |
913 | 924 | ||
914 | 925 | ||
915 | static snd_pcm_ops_t snd_usX2Y_pcm_ops = | 926 | static struct snd_pcm_ops snd_usX2Y_pcm_ops = |
916 | { | 927 | { |
917 | .open = snd_usX2Y_pcm_open, | 928 | .open = snd_usX2Y_pcm_open, |
918 | .close = snd_usX2Y_pcm_close, | 929 | .close = snd_usX2Y_pcm_close, |
@@ -928,7 +939,7 @@ static snd_pcm_ops_t snd_usX2Y_pcm_ops = | |||
928 | /* | 939 | /* |
929 | * free a usb stream instance | 940 | * free a usb stream instance |
930 | */ | 941 | */ |
931 | static void usX2Y_audio_stream_free(snd_usX2Y_substream_t **usX2Y_substream) | 942 | static void usX2Y_audio_stream_free(struct snd_usX2Y_substream **usX2Y_substream) |
932 | { | 943 | { |
933 | if (NULL != usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]) { | 944 | if (NULL != usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]) { |
934 | kfree(usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]); | 945 | kfree(usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]); |
@@ -938,25 +949,23 @@ static void usX2Y_audio_stream_free(snd_usX2Y_substream_t **usX2Y_substream) | |||
938 | usX2Y_substream[SNDRV_PCM_STREAM_CAPTURE] = NULL; | 949 | usX2Y_substream[SNDRV_PCM_STREAM_CAPTURE] = NULL; |
939 | } | 950 | } |
940 | 951 | ||
941 | static void snd_usX2Y_pcm_private_free(snd_pcm_t *pcm) | 952 | static void snd_usX2Y_pcm_private_free(struct snd_pcm *pcm) |
942 | { | 953 | { |
943 | snd_usX2Y_substream_t **usX2Y_stream = pcm->private_data; | 954 | struct snd_usX2Y_substream **usX2Y_stream = pcm->private_data; |
944 | if (usX2Y_stream) { | 955 | if (usX2Y_stream) |
945 | snd_pcm_lib_preallocate_free_for_all(pcm); | ||
946 | usX2Y_audio_stream_free(usX2Y_stream); | 956 | usX2Y_audio_stream_free(usX2Y_stream); |
947 | } | ||
948 | } | 957 | } |
949 | 958 | ||
950 | static int usX2Y_audio_stream_new(snd_card_t *card, int playback_endpoint, int capture_endpoint) | 959 | static int usX2Y_audio_stream_new(struct snd_card *card, int playback_endpoint, int capture_endpoint) |
951 | { | 960 | { |
952 | snd_pcm_t *pcm; | 961 | struct snd_pcm *pcm; |
953 | int err, i; | 962 | int err, i; |
954 | snd_usX2Y_substream_t **usX2Y_substream = | 963 | struct snd_usX2Y_substream **usX2Y_substream = |
955 | usX2Y(card)->subs + 2 * usX2Y(card)->chip.pcm_devs; | 964 | usX2Y(card)->subs + 2 * usX2Y(card)->chip.pcm_devs; |
956 | 965 | ||
957 | for (i = playback_endpoint ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; | 966 | for (i = playback_endpoint ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; |
958 | i <= SNDRV_PCM_STREAM_CAPTURE; ++i) { | 967 | i <= SNDRV_PCM_STREAM_CAPTURE; ++i) { |
959 | usX2Y_substream[i] = kzalloc(sizeof(snd_usX2Y_substream_t), GFP_KERNEL); | 968 | usX2Y_substream[i] = kzalloc(sizeof(struct snd_usX2Y_substream), GFP_KERNEL); |
960 | if (NULL == usX2Y_substream[i]) { | 969 | if (NULL == usX2Y_substream[i]) { |
961 | snd_printk(KERN_ERR "cannot malloc\n"); | 970 | snd_printk(KERN_ERR "cannot malloc\n"); |
962 | return -ENOMEM; | 971 | return -ENOMEM; |
@@ -1006,7 +1015,7 @@ static int usX2Y_audio_stream_new(snd_card_t *card, int playback_endpoint, int c | |||
1006 | /* | 1015 | /* |
1007 | * create a chip instance and set its names. | 1016 | * create a chip instance and set its names. |
1008 | */ | 1017 | */ |
1009 | int usX2Y_audio_create(snd_card_t* card) | 1018 | int usX2Y_audio_create(struct snd_card *card) |
1010 | { | 1019 | { |
1011 | int err = 0; | 1020 | int err = 0; |
1012 | 1021 | ||
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index c9136a98755f..796a7dcef09d 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c | |||
@@ -58,12 +58,12 @@ | |||
58 | #include <sound/hwdep.h> | 58 | #include <sound/hwdep.h> |
59 | 59 | ||
60 | 60 | ||
61 | static int usX2Y_usbpcm_urb_capt_retire(snd_usX2Y_substream_t *subs) | 61 | static int usX2Y_usbpcm_urb_capt_retire(struct snd_usX2Y_substream *subs) |
62 | { | 62 | { |
63 | struct urb *urb = subs->completed_urb; | 63 | struct urb *urb = subs->completed_urb; |
64 | snd_pcm_runtime_t *runtime = subs->pcm_substream->runtime; | 64 | struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; |
65 | int i, lens = 0, hwptr_done = subs->hwptr_done; | 65 | int i, lens = 0, hwptr_done = subs->hwptr_done; |
66 | usX2Ydev_t *usX2Y = subs->usX2Y; | 66 | struct usX2Ydev *usX2Y = subs->usX2Y; |
67 | if (0 > usX2Y->hwdep_pcm_shm->capture_iso_start) { //FIXME | 67 | if (0 > usX2Y->hwdep_pcm_shm->capture_iso_start) { //FIXME |
68 | int head = usX2Y->hwdep_pcm_shm->captured_iso_head + 1; | 68 | int head = usX2Y->hwdep_pcm_shm->captured_iso_head + 1; |
69 | if (head >= ARRAY_SIZE(usX2Y->hwdep_pcm_shm->captured_iso)) | 69 | if (head >= ARRAY_SIZE(usX2Y->hwdep_pcm_shm->captured_iso)) |
@@ -90,7 +90,8 @@ static int usX2Y_usbpcm_urb_capt_retire(snd_usX2Y_substream_t *subs) | |||
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | static inline int usX2Y_iso_frames_per_buffer(snd_pcm_runtime_t *runtime, usX2Ydev_t * usX2Y) | 93 | static inline int usX2Y_iso_frames_per_buffer(struct snd_pcm_runtime *runtime, |
94 | struct usX2Ydev * usX2Y) | ||
94 | { | 95 | { |
95 | return (runtime->buffer_size * 1000) / usX2Y->rate + 1; //FIXME: so far only correct period_size == 2^x ? | 96 | return (runtime->buffer_size * 1000) / usX2Y->rate + 1; //FIXME: so far only correct period_size == 2^x ? |
96 | } | 97 | } |
@@ -105,13 +106,13 @@ static inline int usX2Y_iso_frames_per_buffer(snd_pcm_runtime_t *runtime, usX2Yd | |||
105 | * it directly from the buffer. thus the data is once copied to | 106 | * it directly from the buffer. thus the data is once copied to |
106 | * a temporary buffer and urb points to that. | 107 | * a temporary buffer and urb points to that. |
107 | */ | 108 | */ |
108 | static int usX2Y_hwdep_urb_play_prepare(snd_usX2Y_substream_t *subs, | 109 | static int usX2Y_hwdep_urb_play_prepare(struct snd_usX2Y_substream *subs, |
109 | struct urb *urb) | 110 | struct urb *urb) |
110 | { | 111 | { |
111 | int count, counts, pack; | 112 | int count, counts, pack; |
112 | usX2Ydev_t *usX2Y = subs->usX2Y; | 113 | struct usX2Ydev *usX2Y = subs->usX2Y; |
113 | struct snd_usX2Y_hwdep_pcm_shm *shm = usX2Y->hwdep_pcm_shm; | 114 | struct snd_usX2Y_hwdep_pcm_shm *shm = usX2Y->hwdep_pcm_shm; |
114 | snd_pcm_runtime_t *runtime = subs->pcm_substream->runtime; | 115 | struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; |
115 | 116 | ||
116 | if (0 > shm->playback_iso_start) { | 117 | if (0 > shm->playback_iso_start) { |
117 | shm->playback_iso_start = shm->captured_iso_head - | 118 | shm->playback_iso_start = shm->captured_iso_head - |
@@ -144,13 +145,14 @@ static int usX2Y_hwdep_urb_play_prepare(snd_usX2Y_substream_t *subs, | |||
144 | } | 145 | } |
145 | 146 | ||
146 | 147 | ||
147 | static inline void usX2Y_usbpcm_urb_capt_iso_advance(snd_usX2Y_substream_t *subs, struct urb *urb) | 148 | static inline void usX2Y_usbpcm_urb_capt_iso_advance(struct snd_usX2Y_substream *subs, |
149 | struct urb *urb) | ||
148 | { | 150 | { |
149 | int pack; | 151 | int pack; |
150 | for (pack = 0; pack < nr_of_packs(); ++pack) { | 152 | for (pack = 0; pack < nr_of_packs(); ++pack) { |
151 | struct usb_iso_packet_descriptor *desc = urb->iso_frame_desc + pack; | 153 | struct usb_iso_packet_descriptor *desc = urb->iso_frame_desc + pack; |
152 | if (NULL != subs) { | 154 | if (NULL != subs) { |
153 | snd_usX2Y_hwdep_pcm_shm_t *shm = subs->usX2Y->hwdep_pcm_shm; | 155 | struct snd_usX2Y_hwdep_pcm_shm *shm = subs->usX2Y->hwdep_pcm_shm; |
154 | int head = shm->captured_iso_head + 1; | 156 | int head = shm->captured_iso_head + 1; |
155 | if (head >= ARRAY_SIZE(shm->captured_iso)) | 157 | if (head >= ARRAY_SIZE(shm->captured_iso)) |
156 | head = 0; | 158 | head = 0; |
@@ -166,9 +168,10 @@ static inline void usX2Y_usbpcm_urb_capt_iso_advance(snd_usX2Y_substream_t *subs | |||
166 | } | 168 | } |
167 | } | 169 | } |
168 | 170 | ||
169 | static inline int usX2Y_usbpcm_usbframe_complete(snd_usX2Y_substream_t *capsubs, | 171 | static inline int usX2Y_usbpcm_usbframe_complete(struct snd_usX2Y_substream *capsubs, |
170 | snd_usX2Y_substream_t *capsubs2, | 172 | struct snd_usX2Y_substream *capsubs2, |
171 | snd_usX2Y_substream_t *playbacksubs, int frame) | 173 | struct snd_usX2Y_substream *playbacksubs, |
174 | int frame) | ||
172 | { | 175 | { |
173 | int err, state; | 176 | int err, state; |
174 | struct urb *urb = playbacksubs->completed_urb; | 177 | struct urb *urb = playbacksubs->completed_urb; |
@@ -177,10 +180,8 @@ static inline int usX2Y_usbpcm_usbframe_complete(snd_usX2Y_substream_t *capsubs, | |||
177 | if (NULL != urb) { | 180 | if (NULL != urb) { |
178 | if (state == state_RUNNING) | 181 | if (state == state_RUNNING) |
179 | usX2Y_urb_play_retire(playbacksubs, urb); | 182 | usX2Y_urb_play_retire(playbacksubs, urb); |
180 | else | 183 | else if (state >= state_PRERUNNING) |
181 | if (state >= state_PRERUNNING) { | 184 | atomic_inc(&playbacksubs->state); |
182 | atomic_inc(&playbacksubs->state); | ||
183 | } | ||
184 | } else { | 185 | } else { |
185 | switch (state) { | 186 | switch (state) { |
186 | case state_STARTING1: | 187 | case state_STARTING1: |
@@ -207,10 +208,8 @@ static inline int usX2Y_usbpcm_usbframe_complete(snd_usX2Y_substream_t *capsubs, | |||
207 | if (state == state_RUNNING) { | 208 | if (state == state_RUNNING) { |
208 | if ((err = usX2Y_usbpcm_urb_capt_retire(capsubs))) | 209 | if ((err = usX2Y_usbpcm_urb_capt_retire(capsubs))) |
209 | return err; | 210 | return err; |
210 | } else { | 211 | } else if (state >= state_PRERUNNING) |
211 | if (state >= state_PRERUNNING) | 212 | atomic_inc(&capsubs->state); |
212 | atomic_inc(&capsubs->state); | ||
213 | } | ||
214 | usX2Y_usbpcm_urb_capt_iso_advance(capsubs, capsubs->completed_urb); | 213 | usX2Y_usbpcm_urb_capt_iso_advance(capsubs, capsubs->completed_urb); |
215 | if (NULL != capsubs2) | 214 | if (NULL != capsubs2) |
216 | usX2Y_usbpcm_urb_capt_iso_advance(NULL, capsubs2->completed_urb); | 215 | usX2Y_usbpcm_urb_capt_iso_advance(NULL, capsubs2->completed_urb); |
@@ -229,12 +228,15 @@ static inline int usX2Y_usbpcm_usbframe_complete(snd_usX2Y_substream_t *capsubs, | |||
229 | 228 | ||
230 | static void i_usX2Y_usbpcm_urb_complete(struct urb *urb, struct pt_regs *regs) | 229 | static void i_usX2Y_usbpcm_urb_complete(struct urb *urb, struct pt_regs *regs) |
231 | { | 230 | { |
232 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t*)urb->context; | 231 | struct snd_usX2Y_substream *subs = urb->context; |
233 | usX2Ydev_t *usX2Y = subs->usX2Y; | 232 | struct usX2Ydev *usX2Y = subs->usX2Y; |
234 | snd_usX2Y_substream_t *capsubs, *capsubs2, *playbacksubs; | 233 | struct snd_usX2Y_substream *capsubs, *capsubs2, *playbacksubs; |
235 | 234 | ||
236 | if (unlikely(atomic_read(&subs->state) < state_PREPARED)) { | 235 | if (unlikely(atomic_read(&subs->state) < state_PREPARED)) { |
237 | snd_printdd("hcd_frame=%i ep=%i%s status=%i start_frame=%i\n", usb_get_current_frame_number(usX2Y->chip.dev), subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", urb->status, urb->start_frame); | 236 | snd_printdd("hcd_frame=%i ep=%i%s status=%i start_frame=%i\n", |
237 | usb_get_current_frame_number(usX2Y->chip.dev), | ||
238 | subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", | ||
239 | urb->status, urb->start_frame); | ||
238 | return; | 240 | return; |
239 | } | 241 | } |
240 | if (unlikely(urb->status)) { | 242 | if (unlikely(urb->status)) { |
@@ -268,7 +270,7 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb *urb, struct pt_regs *regs) | |||
268 | } | 270 | } |
269 | 271 | ||
270 | 272 | ||
271 | static void usX2Y_hwdep_urb_release(struct urb** urb) | 273 | static void usX2Y_hwdep_urb_release(struct urb **urb) |
272 | { | 274 | { |
273 | usb_kill_urb(*urb); | 275 | usb_kill_urb(*urb); |
274 | usb_free_urb(*urb); | 276 | usb_free_urb(*urb); |
@@ -278,7 +280,7 @@ static void usX2Y_hwdep_urb_release(struct urb** urb) | |||
278 | /* | 280 | /* |
279 | * release a substream | 281 | * release a substream |
280 | */ | 282 | */ |
281 | static void usX2Y_usbpcm_urbs_release(snd_usX2Y_substream_t *subs) | 283 | static void usX2Y_usbpcm_urbs_release(struct snd_usX2Y_substream *subs) |
282 | { | 284 | { |
283 | int i; | 285 | int i; |
284 | snd_printdd("snd_usX2Y_urbs_release() %i\n", subs->endpoint); | 286 | snd_printdd("snd_usX2Y_urbs_release() %i\n", subs->endpoint); |
@@ -286,7 +288,7 @@ static void usX2Y_usbpcm_urbs_release(snd_usX2Y_substream_t *subs) | |||
286 | usX2Y_hwdep_urb_release(subs->urb + i); | 288 | usX2Y_hwdep_urb_release(subs->urb + i); |
287 | } | 289 | } |
288 | 290 | ||
289 | static void usX2Y_usbpcm_subs_startup_finish(usX2Ydev_t * usX2Y) | 291 | static void usX2Y_usbpcm_subs_startup_finish(struct usX2Ydev * usX2Y) |
290 | { | 292 | { |
291 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_urb_complete); | 293 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_urb_complete); |
292 | usX2Y->prepare_subs = NULL; | 294 | usX2Y->prepare_subs = NULL; |
@@ -294,14 +296,14 @@ static void usX2Y_usbpcm_subs_startup_finish(usX2Ydev_t * usX2Y) | |||
294 | 296 | ||
295 | static void i_usX2Y_usbpcm_subs_startup(struct urb *urb, struct pt_regs *regs) | 297 | static void i_usX2Y_usbpcm_subs_startup(struct urb *urb, struct pt_regs *regs) |
296 | { | 298 | { |
297 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t*)urb->context; | 299 | struct snd_usX2Y_substream *subs = urb->context; |
298 | usX2Ydev_t *usX2Y = subs->usX2Y; | 300 | struct usX2Ydev *usX2Y = subs->usX2Y; |
299 | snd_usX2Y_substream_t *prepare_subs = usX2Y->prepare_subs; | 301 | struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs; |
300 | if (NULL != prepare_subs && | 302 | if (NULL != prepare_subs && |
301 | urb->start_frame == prepare_subs->urb[0]->start_frame) { | 303 | urb->start_frame == prepare_subs->urb[0]->start_frame) { |
302 | atomic_inc(&prepare_subs->state); | 304 | atomic_inc(&prepare_subs->state); |
303 | if (prepare_subs == usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]) { | 305 | if (prepare_subs == usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]) { |
304 | snd_usX2Y_substream_t *cap_subs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; | 306 | struct snd_usX2Y_substream *cap_subs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; |
305 | if (cap_subs2 != NULL) | 307 | if (cap_subs2 != NULL) |
306 | atomic_inc(&cap_subs2->state); | 308 | atomic_inc(&cap_subs2->state); |
307 | } | 309 | } |
@@ -315,7 +317,7 @@ static void i_usX2Y_usbpcm_subs_startup(struct urb *urb, struct pt_regs *regs) | |||
315 | /* | 317 | /* |
316 | * initialize a substream's urbs | 318 | * initialize a substream's urbs |
317 | */ | 319 | */ |
318 | static int usX2Y_usbpcm_urbs_allocate(snd_usX2Y_substream_t *subs) | 320 | static int usX2Y_usbpcm_urbs_allocate(struct snd_usX2Y_substream *subs) |
319 | { | 321 | { |
320 | int i; | 322 | int i; |
321 | unsigned int pipe; | 323 | unsigned int pipe; |
@@ -330,7 +332,7 @@ static int usX2Y_usbpcm_urbs_allocate(snd_usX2Y_substream_t *subs) | |||
330 | 332 | ||
331 | /* allocate and initialize data urbs */ | 333 | /* allocate and initialize data urbs */ |
332 | for (i = 0; i < NRURBS; i++) { | 334 | for (i = 0; i < NRURBS; i++) { |
333 | struct urb** purb = subs->urb + i; | 335 | struct urb **purb = subs->urb + i; |
334 | if (*purb) { | 336 | if (*purb) { |
335 | usb_kill_urb(*purb); | 337 | usb_kill_urb(*purb); |
336 | continue; | 338 | continue; |
@@ -359,16 +361,16 @@ static int usX2Y_usbpcm_urbs_allocate(snd_usX2Y_substream_t *subs) | |||
359 | /* | 361 | /* |
360 | * free the buffer | 362 | * free the buffer |
361 | */ | 363 | */ |
362 | static int snd_usX2Y_usbpcm_hw_free(snd_pcm_substream_t *substream) | 364 | static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream) |
363 | { | 365 | { |
364 | snd_pcm_runtime_t *runtime = substream->runtime; | 366 | struct snd_pcm_runtime *runtime = substream->runtime; |
365 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)runtime->private_data, | 367 | struct snd_usX2Y_substream *subs = runtime->private_data, |
366 | *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; | 368 | *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; |
367 | down(&subs->usX2Y->prepare_mutex); | 369 | down(&subs->usX2Y->prepare_mutex); |
368 | snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream); | 370 | snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream); |
369 | 371 | ||
370 | if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { | 372 | if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { |
371 | snd_usX2Y_substream_t *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; | 373 | struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; |
372 | atomic_set(&subs->state, state_STOPPED); | 374 | atomic_set(&subs->state, state_STOPPED); |
373 | usX2Y_usbpcm_urbs_release(subs); | 375 | usX2Y_usbpcm_urbs_release(subs); |
374 | if (!cap_subs->pcm_substream || | 376 | if (!cap_subs->pcm_substream || |
@@ -383,7 +385,7 @@ static int snd_usX2Y_usbpcm_hw_free(snd_pcm_substream_t *substream) | |||
383 | usX2Y_usbpcm_urbs_release(cap_subs2); | 385 | usX2Y_usbpcm_urbs_release(cap_subs2); |
384 | } | 386 | } |
385 | } else { | 387 | } else { |
386 | snd_usX2Y_substream_t *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; | 388 | struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; |
387 | if (atomic_read(&playback_subs->state) < state_PREPARED) { | 389 | if (atomic_read(&playback_subs->state) < state_PREPARED) { |
388 | atomic_set(&subs->state, state_STOPPED); | 390 | atomic_set(&subs->state, state_STOPPED); |
389 | if (NULL != cap_subs2) | 391 | if (NULL != cap_subs2) |
@@ -397,20 +399,20 @@ static int snd_usX2Y_usbpcm_hw_free(snd_pcm_substream_t *substream) | |||
397 | return snd_pcm_lib_free_pages(substream); | 399 | return snd_pcm_lib_free_pages(substream); |
398 | } | 400 | } |
399 | 401 | ||
400 | static void usX2Y_usbpcm_subs_startup(snd_usX2Y_substream_t *subs) | 402 | static void usX2Y_usbpcm_subs_startup(struct snd_usX2Y_substream *subs) |
401 | { | 403 | { |
402 | usX2Ydev_t * usX2Y = subs->usX2Y; | 404 | struct usX2Ydev * usX2Y = subs->usX2Y; |
403 | usX2Y->prepare_subs = subs; | 405 | usX2Y->prepare_subs = subs; |
404 | subs->urb[0]->start_frame = -1; | 406 | subs->urb[0]->start_frame = -1; |
405 | smp_wmb(); // Make shure above modifications are seen by i_usX2Y_subs_startup() | 407 | smp_wmb(); // Make shure above modifications are seen by i_usX2Y_subs_startup() |
406 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_subs_startup); | 408 | usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_subs_startup); |
407 | } | 409 | } |
408 | 410 | ||
409 | static int usX2Y_usbpcm_urbs_start(snd_usX2Y_substream_t *subs) | 411 | static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs) |
410 | { | 412 | { |
411 | int p, u, err, | 413 | int p, u, err, |
412 | stream = subs->pcm_substream->stream; | 414 | stream = subs->pcm_substream->stream; |
413 | usX2Ydev_t *usX2Y = subs->usX2Y; | 415 | struct usX2Ydev *usX2Y = subs->usX2Y; |
414 | 416 | ||
415 | if (SNDRV_PCM_STREAM_CAPTURE == stream) { | 417 | if (SNDRV_PCM_STREAM_CAPTURE == stream) { |
416 | usX2Y->hwdep_pcm_shm->captured_iso_head = -1; | 418 | usX2Y->hwdep_pcm_shm->captured_iso_head = -1; |
@@ -418,7 +420,7 @@ static int usX2Y_usbpcm_urbs_start(snd_usX2Y_substream_t *subs) | |||
418 | } | 420 | } |
419 | 421 | ||
420 | for (p = 0; 3 >= (stream + p); p += 2) { | 422 | for (p = 0; 3 >= (stream + p); p += 2) { |
421 | snd_usX2Y_substream_t *subs = usX2Y->subs[stream + p]; | 423 | struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p]; |
422 | if (subs != NULL) { | 424 | if (subs != NULL) { |
423 | if ((err = usX2Y_usbpcm_urbs_allocate(subs)) < 0) | 425 | if ((err = usX2Y_usbpcm_urbs_allocate(subs)) < 0) |
424 | return err; | 426 | return err; |
@@ -427,7 +429,7 @@ static int usX2Y_usbpcm_urbs_start(snd_usX2Y_substream_t *subs) | |||
427 | } | 429 | } |
428 | 430 | ||
429 | for (p = 0; p < 4; p++) { | 431 | for (p = 0; p < 4; p++) { |
430 | snd_usX2Y_substream_t *subs = usX2Y->subs[p]; | 432 | struct snd_usX2Y_substream *subs = usX2Y->subs[p]; |
431 | if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) | 433 | if (subs != NULL && atomic_read(&subs->state) >= state_PREPARED) |
432 | goto start; | 434 | goto start; |
433 | } | 435 | } |
@@ -437,7 +439,7 @@ static int usX2Y_usbpcm_urbs_start(snd_usX2Y_substream_t *subs) | |||
437 | usX2Y_usbpcm_subs_startup(subs); | 439 | usX2Y_usbpcm_subs_startup(subs); |
438 | for (u = 0; u < NRURBS; u++) { | 440 | for (u = 0; u < NRURBS; u++) { |
439 | for (p = 0; 3 >= (stream + p); p += 2) { | 441 | for (p = 0; 3 >= (stream + p); p += 2) { |
440 | snd_usX2Y_substream_t *subs = usX2Y->subs[stream + p]; | 442 | struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p]; |
441 | if (subs != NULL) { | 443 | if (subs != NULL) { |
442 | struct urb *urb = subs->urb[u]; | 444 | struct urb *urb = subs->urb[u]; |
443 | if (usb_pipein(urb->pipe)) { | 445 | if (usb_pipein(urb->pipe)) { |
@@ -486,19 +488,19 @@ static int usX2Y_usbpcm_urbs_start(snd_usX2Y_substream_t *subs) | |||
486 | * | 488 | * |
487 | * set format and initialize urbs | 489 | * set format and initialize urbs |
488 | */ | 490 | */ |
489 | static int snd_usX2Y_usbpcm_prepare(snd_pcm_substream_t *substream) | 491 | static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream) |
490 | { | 492 | { |
491 | snd_pcm_runtime_t *runtime = substream->runtime; | 493 | struct snd_pcm_runtime *runtime = substream->runtime; |
492 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)runtime->private_data; | 494 | struct snd_usX2Y_substream *subs = runtime->private_data; |
493 | usX2Ydev_t *usX2Y = subs->usX2Y; | 495 | struct usX2Ydev *usX2Y = subs->usX2Y; |
494 | snd_usX2Y_substream_t *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; | 496 | struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; |
495 | int err = 0; | 497 | int err = 0; |
496 | snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); | 498 | snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); |
497 | 499 | ||
498 | if (NULL == usX2Y->hwdep_pcm_shm) { | 500 | if (NULL == usX2Y->hwdep_pcm_shm) { |
499 | if (NULL == (usX2Y->hwdep_pcm_shm = snd_malloc_pages(sizeof(snd_usX2Y_hwdep_pcm_shm_t), GFP_KERNEL))) | 501 | if (NULL == (usX2Y->hwdep_pcm_shm = snd_malloc_pages(sizeof(struct snd_usX2Y_hwdep_pcm_shm), GFP_KERNEL))) |
500 | return -ENOMEM; | 502 | return -ENOMEM; |
501 | memset(usX2Y->hwdep_pcm_shm, 0, sizeof(snd_usX2Y_hwdep_pcm_shm_t)); | 503 | memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); |
502 | } | 504 | } |
503 | 505 | ||
504 | down(&usX2Y->prepare_mutex); | 506 | down(&usX2Y->prepare_mutex); |
@@ -512,7 +514,8 @@ static int snd_usX2Y_usbpcm_prepare(snd_pcm_substream_t *substream) | |||
512 | if (usX2Y->rate != runtime->rate) | 514 | if (usX2Y->rate != runtime->rate) |
513 | if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) | 515 | if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) |
514 | goto up_prepare_mutex; | 516 | goto up_prepare_mutex; |
515 | snd_printdd("starting capture pipe for %s\n", subs == capsubs ? "self" : "playpipe"); | 517 | snd_printdd("starting capture pipe for %s\n", subs == capsubs ? |
518 | "self" : "playpipe"); | ||
516 | if (0 > (err = usX2Y_usbpcm_urbs_start(capsubs))) | 519 | if (0 > (err = usX2Y_usbpcm_urbs_start(capsubs))) |
517 | goto up_prepare_mutex; | 520 | goto up_prepare_mutex; |
518 | } | 521 | } |
@@ -520,8 +523,12 @@ static int snd_usX2Y_usbpcm_prepare(snd_pcm_substream_t *substream) | |||
520 | if (subs != capsubs) { | 523 | if (subs != capsubs) { |
521 | usX2Y->hwdep_pcm_shm->playback_iso_start = -1; | 524 | usX2Y->hwdep_pcm_shm->playback_iso_start = -1; |
522 | if (atomic_read(&subs->state) < state_PREPARED) { | 525 | if (atomic_read(&subs->state) < state_PREPARED) { |
523 | while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) > usX2Y->hwdep_pcm_shm->captured_iso_frames) { | 526 | while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) > |
524 | snd_printd("Wait: iso_frames_per_buffer=%i,captured_iso_frames=%i\n", usX2Y_iso_frames_per_buffer(runtime, usX2Y), usX2Y->hwdep_pcm_shm->captured_iso_frames); | 527 | usX2Y->hwdep_pcm_shm->captured_iso_frames) { |
528 | snd_printdd("Wait: iso_frames_per_buffer=%i," | ||
529 | "captured_iso_frames=%i\n", | ||
530 | usX2Y_iso_frames_per_buffer(runtime, usX2Y), | ||
531 | usX2Y->hwdep_pcm_shm->captured_iso_frames); | ||
525 | if (msleep_interruptible(10)) { | 532 | if (msleep_interruptible(10)) { |
526 | err = -ERESTARTSYS; | 533 | err = -ERESTARTSYS; |
527 | goto up_prepare_mutex; | 534 | goto up_prepare_mutex; |
@@ -530,7 +537,9 @@ static int snd_usX2Y_usbpcm_prepare(snd_pcm_substream_t *substream) | |||
530 | if (0 > (err = usX2Y_usbpcm_urbs_start(subs))) | 537 | if (0 > (err = usX2Y_usbpcm_urbs_start(subs))) |
531 | goto up_prepare_mutex; | 538 | goto up_prepare_mutex; |
532 | } | 539 | } |
533 | snd_printd("Ready: iso_frames_per_buffer=%i,captured_iso_frames=%i\n", usX2Y_iso_frames_per_buffer(runtime, usX2Y), usX2Y->hwdep_pcm_shm->captured_iso_frames); | 540 | snd_printdd("Ready: iso_frames_per_buffer=%i,captured_iso_frames=%i\n", |
541 | usX2Y_iso_frames_per_buffer(runtime, usX2Y), | ||
542 | usX2Y->hwdep_pcm_shm->captured_iso_frames); | ||
534 | } else | 543 | } else |
535 | usX2Y->hwdep_pcm_shm->capture_iso_start = -1; | 544 | usX2Y->hwdep_pcm_shm->capture_iso_start = -1; |
536 | 545 | ||
@@ -539,7 +548,7 @@ static int snd_usX2Y_usbpcm_prepare(snd_pcm_substream_t *substream) | |||
539 | return err; | 548 | return err; |
540 | } | 549 | } |
541 | 550 | ||
542 | static snd_pcm_hardware_t snd_usX2Y_4c = | 551 | static struct snd_pcm_hardware snd_usX2Y_4c = |
543 | { | 552 | { |
544 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 553 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
545 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 554 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -560,11 +569,11 @@ static snd_pcm_hardware_t snd_usX2Y_4c = | |||
560 | 569 | ||
561 | 570 | ||
562 | 571 | ||
563 | static int snd_usX2Y_usbpcm_open(snd_pcm_substream_t *substream) | 572 | static int snd_usX2Y_usbpcm_open(struct snd_pcm_substream *substream) |
564 | { | 573 | { |
565 | snd_usX2Y_substream_t *subs = ((snd_usX2Y_substream_t **) | 574 | struct snd_usX2Y_substream *subs = ((struct snd_usX2Y_substream **) |
566 | snd_pcm_substream_chip(substream))[substream->stream]; | 575 | snd_pcm_substream_chip(substream))[substream->stream]; |
567 | snd_pcm_runtime_t *runtime = substream->runtime; | 576 | struct snd_pcm_runtime *runtime = substream->runtime; |
568 | 577 | ||
569 | if (!(subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS)) | 578 | if (!(subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS)) |
570 | return -EBUSY; | 579 | return -EBUSY; |
@@ -578,18 +587,17 @@ static int snd_usX2Y_usbpcm_open(snd_pcm_substream_t *substream) | |||
578 | } | 587 | } |
579 | 588 | ||
580 | 589 | ||
581 | static int snd_usX2Y_usbpcm_close(snd_pcm_substream_t *substream) | 590 | static int snd_usX2Y_usbpcm_close(struct snd_pcm_substream *substream) |
582 | { | 591 | { |
583 | snd_pcm_runtime_t *runtime = substream->runtime; | 592 | struct snd_pcm_runtime *runtime = substream->runtime; |
584 | snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t *)runtime->private_data; | 593 | struct snd_usX2Y_substream *subs = runtime->private_data; |
585 | int err = 0; | 594 | |
586 | snd_printd("\n"); | ||
587 | subs->pcm_substream = NULL; | 595 | subs->pcm_substream = NULL; |
588 | return err; | 596 | return 0; |
589 | } | 597 | } |
590 | 598 | ||
591 | 599 | ||
592 | static snd_pcm_ops_t snd_usX2Y_usbpcm_ops = | 600 | static struct snd_pcm_ops snd_usX2Y_usbpcm_ops = |
593 | { | 601 | { |
594 | .open = snd_usX2Y_usbpcm_open, | 602 | .open = snd_usX2Y_usbpcm_open, |
595 | .close = snd_usX2Y_usbpcm_close, | 603 | .close = snd_usX2Y_usbpcm_close, |
@@ -602,11 +610,11 @@ static snd_pcm_ops_t snd_usX2Y_usbpcm_ops = | |||
602 | }; | 610 | }; |
603 | 611 | ||
604 | 612 | ||
605 | static int usX2Y_pcms_lock_check(snd_card_t *card) | 613 | static int usX2Y_pcms_lock_check(struct snd_card *card) |
606 | { | 614 | { |
607 | struct list_head *list; | 615 | struct list_head *list; |
608 | snd_device_t *dev; | 616 | struct snd_device *dev; |
609 | snd_pcm_t *pcm; | 617 | struct snd_pcm *pcm; |
610 | int err = 0; | 618 | int err = 0; |
611 | list_for_each(list, &card->devices) { | 619 | list_for_each(list, &card->devices) { |
612 | dev = snd_device(list); | 620 | dev = snd_device(list); |
@@ -622,7 +630,7 @@ static int usX2Y_pcms_lock_check(snd_card_t *card) | |||
622 | continue; | 630 | continue; |
623 | pcm = dev->device_data; | 631 | pcm = dev->device_data; |
624 | for (s = 0; s < 2; ++s) { | 632 | for (s = 0; s < 2; ++s) { |
625 | snd_pcm_substream_t *substream; | 633 | struct snd_pcm_substream *substream; |
626 | substream = pcm->streams[s].substream; | 634 | substream = pcm->streams[s].substream; |
627 | if (substream && substream->ffile != NULL) | 635 | if (substream && substream->ffile != NULL) |
628 | err = -EBUSY; | 636 | err = -EBUSY; |
@@ -632,11 +640,11 @@ static int usX2Y_pcms_lock_check(snd_card_t *card) | |||
632 | } | 640 | } |
633 | 641 | ||
634 | 642 | ||
635 | static void usX2Y_pcms_unlock(snd_card_t *card) | 643 | static void usX2Y_pcms_unlock(struct snd_card *card) |
636 | { | 644 | { |
637 | struct list_head *list; | 645 | struct list_head *list; |
638 | snd_device_t *dev; | 646 | struct snd_device *dev; |
639 | snd_pcm_t *pcm; | 647 | struct snd_pcm *pcm; |
640 | list_for_each(list, &card->devices) { | 648 | list_for_each(list, &card->devices) { |
641 | dev = snd_device(list); | 649 | dev = snd_device(list); |
642 | if (dev->type != SNDRV_DEV_PCM) | 650 | if (dev->type != SNDRV_DEV_PCM) |
@@ -647,10 +655,10 @@ static void usX2Y_pcms_unlock(snd_card_t *card) | |||
647 | } | 655 | } |
648 | 656 | ||
649 | 657 | ||
650 | static int snd_usX2Y_hwdep_pcm_open(snd_hwdep_t *hw, struct file *file) | 658 | static int snd_usX2Y_hwdep_pcm_open(struct snd_hwdep *hw, struct file *file) |
651 | { | 659 | { |
652 | // we need to be the first | 660 | // we need to be the first |
653 | snd_card_t *card = hw->card; | 661 | struct snd_card *card = hw->card; |
654 | int err = usX2Y_pcms_lock_check(card); | 662 | int err = usX2Y_pcms_lock_check(card); |
655 | if (0 == err) | 663 | if (0 == err) |
656 | usX2Y(card)->chip_status |= USX2Y_STAT_CHIP_MMAP_PCM_URBS; | 664 | usX2Y(card)->chip_status |= USX2Y_STAT_CHIP_MMAP_PCM_URBS; |
@@ -659,9 +667,9 @@ static int snd_usX2Y_hwdep_pcm_open(snd_hwdep_t *hw, struct file *file) | |||
659 | } | 667 | } |
660 | 668 | ||
661 | 669 | ||
662 | static int snd_usX2Y_hwdep_pcm_release(snd_hwdep_t *hw, struct file *file) | 670 | static int snd_usX2Y_hwdep_pcm_release(struct snd_hwdep *hw, struct file *file) |
663 | { | 671 | { |
664 | snd_card_t *card = hw->card; | 672 | struct snd_card *card = hw->card; |
665 | int err = usX2Y_pcms_lock_check(card); | 673 | int err = usX2Y_pcms_lock_check(card); |
666 | if (0 == err) | 674 | if (0 == err) |
667 | usX2Y(hw->card)->chip_status &= ~USX2Y_STAT_CHIP_MMAP_PCM_URBS; | 675 | usX2Y(hw->card)->chip_status &= ~USX2Y_STAT_CHIP_MMAP_PCM_URBS; |
@@ -689,7 +697,7 @@ static struct page * snd_usX2Y_hwdep_pcm_vm_nopage(struct vm_area_struct *area, | |||
689 | offset = area->vm_pgoff << PAGE_SHIFT; | 697 | offset = area->vm_pgoff << PAGE_SHIFT; |
690 | offset += address - area->vm_start; | 698 | offset += address - area->vm_start; |
691 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); | 699 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); |
692 | vaddr = (char*)((usX2Ydev_t*)area->vm_private_data)->hwdep_pcm_shm + offset; | 700 | vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->hwdep_pcm_shm + offset; |
693 | page = virt_to_page(vaddr); | 701 | page = virt_to_page(vaddr); |
694 | get_page(page); | 702 | get_page(page); |
695 | 703 | ||
@@ -707,17 +715,17 @@ static struct vm_operations_struct snd_usX2Y_hwdep_pcm_vm_ops = { | |||
707 | }; | 715 | }; |
708 | 716 | ||
709 | 717 | ||
710 | static int snd_usX2Y_hwdep_pcm_mmap(snd_hwdep_t * hw, struct file *filp, struct vm_area_struct *area) | 718 | static int snd_usX2Y_hwdep_pcm_mmap(struct snd_hwdep * hw, struct file *filp, struct vm_area_struct *area) |
711 | { | 719 | { |
712 | unsigned long size = (unsigned long)(area->vm_end - area->vm_start); | 720 | unsigned long size = (unsigned long)(area->vm_end - area->vm_start); |
713 | usX2Ydev_t *usX2Y = (usX2Ydev_t*)hw->private_data; | 721 | struct usX2Ydev *usX2Y = hw->private_data; |
714 | 722 | ||
715 | if (!(((usX2Ydev_t*)hw->private_data)->chip_status & USX2Y_STAT_CHIP_INIT)) | 723 | if (!(usX2Y->chip_status & USX2Y_STAT_CHIP_INIT)) |
716 | return -EBUSY; | 724 | return -EBUSY; |
717 | 725 | ||
718 | /* if userspace tries to mmap beyond end of our buffer, fail */ | 726 | /* if userspace tries to mmap beyond end of our buffer, fail */ |
719 | if (size > PAGE_ALIGN(sizeof(snd_usX2Y_hwdep_pcm_shm_t))) { | 727 | if (size > PAGE_ALIGN(sizeof(struct snd_usX2Y_hwdep_pcm_shm))) { |
720 | snd_printd("%lu > %lu\n", size, (unsigned long)sizeof(snd_usX2Y_hwdep_pcm_shm_t)); | 728 | snd_printd("%lu > %lu\n", size, (unsigned long)sizeof(struct snd_usX2Y_hwdep_pcm_shm)); |
721 | return -EINVAL; | 729 | return -EINVAL; |
722 | } | 730 | } |
723 | 731 | ||
@@ -726,39 +734,31 @@ static int snd_usX2Y_hwdep_pcm_mmap(snd_hwdep_t * hw, struct file *filp, struct | |||
726 | } | 734 | } |
727 | area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops; | 735 | area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops; |
728 | area->vm_flags |= VM_RESERVED; | 736 | area->vm_flags |= VM_RESERVED; |
729 | snd_printd("vm_flags=0x%lX\n", area->vm_flags); | ||
730 | area->vm_private_data = hw->private_data; | 737 | area->vm_private_data = hw->private_data; |
731 | return 0; | 738 | return 0; |
732 | } | 739 | } |
733 | 740 | ||
734 | 741 | ||
735 | static void snd_usX2Y_hwdep_pcm_private_free(snd_hwdep_t *hwdep) | 742 | static void snd_usX2Y_hwdep_pcm_private_free(struct snd_hwdep *hwdep) |
736 | { | 743 | { |
737 | usX2Ydev_t *usX2Y = (usX2Ydev_t *)hwdep->private_data; | 744 | struct usX2Ydev *usX2Y = hwdep->private_data; |
738 | if (NULL != usX2Y->hwdep_pcm_shm) | 745 | if (NULL != usX2Y->hwdep_pcm_shm) |
739 | snd_free_pages(usX2Y->hwdep_pcm_shm, sizeof(snd_usX2Y_hwdep_pcm_shm_t)); | 746 | snd_free_pages(usX2Y->hwdep_pcm_shm, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); |
740 | } | 747 | } |
741 | 748 | ||
742 | 749 | ||
743 | static void snd_usX2Y_usbpcm_private_free(snd_pcm_t *pcm) | 750 | int usX2Y_hwdep_pcm_new(struct snd_card *card) |
744 | { | ||
745 | snd_pcm_lib_preallocate_free_for_all(pcm); | ||
746 | } | ||
747 | |||
748 | |||
749 | int usX2Y_hwdep_pcm_new(snd_card_t* card) | ||
750 | { | 751 | { |
751 | int err; | 752 | int err; |
752 | snd_hwdep_t *hw; | 753 | struct snd_hwdep *hw; |
753 | snd_pcm_t *pcm; | 754 | struct snd_pcm *pcm; |
754 | struct usb_device *dev = usX2Y(card)->chip.dev; | 755 | struct usb_device *dev = usX2Y(card)->chip.dev; |
755 | if (1 != nr_of_packs()) | 756 | if (1 != nr_of_packs()) |
756 | return 0; | 757 | return 0; |
757 | 758 | ||
758 | if ((err = snd_hwdep_new(card, SND_USX2Y_USBPCM_ID, 1, &hw)) < 0) { | 759 | if ((err = snd_hwdep_new(card, SND_USX2Y_USBPCM_ID, 1, &hw)) < 0) |
759 | snd_printd("\n"); | ||
760 | return err; | 760 | return err; |
761 | } | 761 | |
762 | hw->iface = SNDRV_HWDEP_IFACE_USX2Y_PCM; | 762 | hw->iface = SNDRV_HWDEP_IFACE_USX2Y_PCM; |
763 | hw->private_data = usX2Y(card); | 763 | hw->private_data = usX2Y(card); |
764 | hw->private_free = snd_usX2Y_hwdep_pcm_private_free; | 764 | hw->private_free = snd_usX2Y_hwdep_pcm_private_free; |
@@ -776,7 +776,6 @@ int usX2Y_hwdep_pcm_new(snd_card_t* card) | |||
776 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usX2Y_usbpcm_ops); | 776 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usX2Y_usbpcm_ops); |
777 | 777 | ||
778 | pcm->private_data = usX2Y(card)->subs; | 778 | pcm->private_data = usX2Y(card)->subs; |
779 | pcm->private_free = snd_usX2Y_usbpcm_private_free; | ||
780 | pcm->info_flags = 0; | 779 | pcm->info_flags = 0; |
781 | 780 | ||
782 | sprintf(pcm->name, NAME_ALLCAPS" hwdep Audio"); | 781 | sprintf(pcm->name, NAME_ALLCAPS" hwdep Audio"); |
@@ -788,7 +787,6 @@ int usX2Y_hwdep_pcm_new(snd_card_t* card) | |||
788 | SNDRV_DMA_TYPE_CONTINUOUS, | 787 | SNDRV_DMA_TYPE_CONTINUOUS, |
789 | snd_dma_continuous_data(GFP_KERNEL), | 788 | snd_dma_continuous_data(GFP_KERNEL), |
790 | 64*1024, 128*1024))) { | 789 | 64*1024, 128*1024))) { |
791 | snd_usX2Y_usbpcm_private_free(pcm); | ||
792 | return err; | 790 | return err; |
793 | } | 791 | } |
794 | 792 | ||
@@ -798,7 +796,7 @@ int usX2Y_hwdep_pcm_new(snd_card_t* card) | |||
798 | 796 | ||
799 | #else | 797 | #else |
800 | 798 | ||
801 | int usX2Y_hwdep_pcm_new(snd_card_t* card) | 799 | int usX2Y_hwdep_pcm_new(struct snd_card *card) |
802 | { | 800 | { |
803 | return 0; | 801 | return 0; |
804 | } | 802 | } |
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.h b/sound/usb/usx2y/usx2yhwdeppcm.h index d68f0cbdbbe2..c3382fdc386b 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.h +++ b/sound/usb/usx2y/usx2yhwdeppcm.h | |||
@@ -18,4 +18,3 @@ struct snd_usX2Y_hwdep_pcm_shm { | |||
18 | volatile unsigned captured_iso_frames; | 18 | volatile unsigned captured_iso_frames; |
19 | int capture_iso_start; | 19 | int capture_iso_start; |
20 | }; | 20 | }; |
21 | typedef struct snd_usX2Y_hwdep_pcm_shm snd_usX2Y_hwdep_pcm_shm_t; | ||