diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-23 02:31:34 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-23 02:31:34 -0500 |
commit | e152f18027552eb34006b35347e72bc805783027 (patch) | |
tree | ac9765e68597c08c24de447f46bb3e04d9881e1b /sound/usb | |
parent | 49ba4f94bddb7f5272c4596d505f94355cc3fbd2 (diff) | |
parent | 42c364ace52ae6b4699105b39f2559c256b6cd4c (diff) |
Merge branch 'for-linus' into for-next
This is a preliminary merge before the upcoming merge of generic parser
branch.
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/midi.c | 4 | ||||
-rw-r--r-- | sound/usb/mixer_maps.c | 13 | ||||
-rw-r--r-- | sound/usb/mixer_quirks.c | 2 | ||||
-rw-r--r-- | sound/usb/pcm.c | 10 | ||||
-rw-r--r-- | sound/usb/quirks-table.h | 28 | ||||
-rw-r--r-- | sound/usb/quirks.c | 35 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 1 |
7 files changed, 72 insertions, 21 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c index c183d34842ac..34b9bb7fe87c 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c | |||
@@ -2181,10 +2181,6 @@ int snd_usbmidi_create(struct snd_card *card, | |||
2181 | umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; | 2181 | umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; |
2182 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); | 2182 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); |
2183 | break; | 2183 | break; |
2184 | case QUIRK_MIDI_MBOX2: | ||
2185 | umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops; | ||
2186 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); | ||
2187 | break; | ||
2188 | case QUIRK_MIDI_RAW_BYTES: | 2184 | case QUIRK_MIDI_RAW_BYTES: |
2189 | umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; | 2185 | umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; |
2190 | /* | 2186 | /* |
diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c index e71fe55cebef..0e2ed3d05c45 100644 --- a/sound/usb/mixer_maps.c +++ b/sound/usb/mixer_maps.c | |||
@@ -179,6 +179,15 @@ static struct usbmix_name_map audigy2nx_map[] = { | |||
179 | { 0 } /* terminator */ | 179 | { 0 } /* terminator */ |
180 | }; | 180 | }; |
181 | 181 | ||
182 | static struct usbmix_selector_map c400_selectors[] = { | ||
183 | { | ||
184 | .id = 0x80, | ||
185 | .count = 2, | ||
186 | .names = (const char*[]) {"Internal", "SPDIF"} | ||
187 | }, | ||
188 | { 0 } /* terminator */ | ||
189 | }; | ||
190 | |||
182 | static struct usbmix_selector_map audigy2nx_selectors[] = { | 191 | static struct usbmix_selector_map audigy2nx_selectors[] = { |
183 | { | 192 | { |
184 | .id = 14, /* Capture Source */ | 193 | .id = 14, /* Capture Source */ |
@@ -367,6 +376,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { | |||
367 | .map = hercules_usb51_map, | 376 | .map = hercules_usb51_map, |
368 | }, | 377 | }, |
369 | { | 378 | { |
379 | .id = USB_ID(0x0763, 0x2030), | ||
380 | .selector_map = c400_selectors, | ||
381 | }, | ||
382 | { | ||
370 | .id = USB_ID(0x08bb, 0x2702), | 383 | .id = USB_ID(0x08bb, 0x2702), |
371 | .map = linex_map, | 384 | .map = linex_map, |
372 | .ignore_ctl_error = 1, | 385 | .ignore_ctl_error = 1, |
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 0422b1360af3..15520de1df56 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c | |||
@@ -1206,7 +1206,7 @@ static int snd_c400_create_mixer(struct usb_mixer_interface *mixer) | |||
1206 | * are valid they presents mono controls as L and R channels of | 1206 | * are valid they presents mono controls as L and R channels of |
1207 | * stereo. So we provide a good mixer here. | 1207 | * stereo. So we provide a good mixer here. |
1208 | */ | 1208 | */ |
1209 | struct std_mono_table ebox44_table[] = { | 1209 | static struct std_mono_table ebox44_table[] = { |
1210 | { | 1210 | { |
1211 | .unitid = 4, | 1211 | .unitid = 4, |
1212 | .control = 1, | 1212 | .control = 1, |
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 3a384479e923..b839b60f9858 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -515,6 +515,16 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs) | |||
515 | struct snd_usb_substream *sync_subs = | 515 | struct snd_usb_substream *sync_subs = |
516 | &subs->stream->substream[subs->direction ^ 1]; | 516 | &subs->stream->substream[subs->direction ^ 1]; |
517 | 517 | ||
518 | if (subs->sync_endpoint->type != SND_USB_ENDPOINT_TYPE_DATA || | ||
519 | !subs->stream) | ||
520 | return snd_usb_endpoint_set_params(subs->sync_endpoint, | ||
521 | subs->pcm_format, | ||
522 | subs->channels, | ||
523 | subs->period_bytes, | ||
524 | subs->cur_rate, | ||
525 | subs->cur_audiofmt, | ||
526 | NULL); | ||
527 | |||
518 | /* Try to find the best matching audioformat. */ | 528 | /* Try to find the best matching audioformat. */ |
519 | list_for_each_entry(fp, &sync_subs->fmt_list, list) { | 529 | list_for_each_entry(fp, &sync_subs->fmt_list, list) { |
520 | int score = match_endpoint_audioformats(fp, subs->cur_audiofmt, | 530 | int score = match_endpoint_audioformats(fp, subs->cur_audiofmt, |
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index cdcf6b45e8a8..64d25a7a4d59 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h | |||
@@ -50,6 +50,28 @@ | |||
50 | } | 50 | } |
51 | }, | 51 | }, |
52 | 52 | ||
53 | { | ||
54 | /* Creative BT-D1 */ | ||
55 | USB_DEVICE(0x041e, 0x0005), | ||
56 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
57 | .ifnum = 1, | ||
58 | .type = QUIRK_AUDIO_FIXED_ENDPOINT, | ||
59 | .data = &(const struct audioformat) { | ||
60 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | ||
61 | .channels = 2, | ||
62 | .iface = 1, | ||
63 | .altsetting = 1, | ||
64 | .altset_idx = 1, | ||
65 | .endpoint = 0x03, | ||
66 | .ep_attr = USB_ENDPOINT_XFER_ISOC, | ||
67 | .attributes = 0, | ||
68 | .rates = SNDRV_PCM_RATE_CONTINUOUS, | ||
69 | .rate_min = 48000, | ||
70 | .rate_max = 48000, | ||
71 | } | ||
72 | } | ||
73 | }, | ||
74 | |||
53 | /* Creative/Toshiba Multimedia Center SB-0500 */ | 75 | /* Creative/Toshiba Multimedia Center SB-0500 */ |
54 | { | 76 | { |
55 | USB_DEVICE(0x041e, 0x3048), | 77 | USB_DEVICE(0x041e, 0x3048), |
@@ -2267,7 +2289,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2267 | .rate_table = (unsigned int[]) { | 2289 | .rate_table = (unsigned int[]) { |
2268 | 44100, 48000, 88200, 96000 | 2290 | 44100, 48000, 88200, 96000 |
2269 | }, | 2291 | }, |
2270 | .clock = 0x81, | 2292 | .clock = 0x80, |
2271 | } | 2293 | } |
2272 | }, | 2294 | }, |
2273 | /* Capture */ | 2295 | /* Capture */ |
@@ -2293,7 +2315,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2293 | .rate_table = (unsigned int[]) { | 2315 | .rate_table = (unsigned int[]) { |
2294 | 44100, 48000, 88200, 96000 | 2316 | 44100, 48000, 88200, 96000 |
2295 | }, | 2317 | }, |
2296 | .clock = 0x81, | 2318 | .clock = 0x80, |
2297 | } | 2319 | } |
2298 | }, | 2320 | }, |
2299 | /* MIDI */ | 2321 | /* MIDI */ |
@@ -2993,7 +3015,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2993 | }, | 3015 | }, |
2994 | { | 3016 | { |
2995 | .ifnum = 6, | 3017 | .ifnum = 6, |
2996 | .type = QUIRK_MIDI_MBOX2, | 3018 | .type = QUIRK_MIDI_MIDIMAN, |
2997 | .data = &(const struct snd_usb_midi_endpoint_info) { | 3019 | .data = &(const struct snd_usb_midi_endpoint_info) { |
2998 | .out_ep = 0x02, | 3020 | .out_ep = 0x02, |
2999 | .out_cables = 0x0001, | 3021 | .out_cables = 0x0001, |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index f104c68fe1e0..2c971858d6b7 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip, | |||
306 | [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk, | 306 | [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk, |
307 | [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk, | 307 | [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk, |
308 | [QUIRK_MIDI_NOVATION] = create_any_midi_quirk, | 308 | [QUIRK_MIDI_NOVATION] = create_any_midi_quirk, |
309 | [QUIRK_MIDI_MBOX2] = create_any_midi_quirk, | ||
310 | [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk, | 309 | [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk, |
311 | [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk, | 310 | [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk, |
312 | [QUIRK_MIDI_CME] = create_any_midi_quirk, | 311 | [QUIRK_MIDI_CME] = create_any_midi_quirk, |
@@ -388,11 +387,13 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev) | |||
388 | * rules | 387 | * rules |
389 | */ | 388 | */ |
390 | err = usb_driver_set_configuration(dev, 2); | 389 | err = usb_driver_set_configuration(dev, 2); |
391 | if (err < 0) { | 390 | if (err < 0) |
392 | snd_printdd("error usb_driver_set_configuration: %d\n", | 391 | snd_printdd("error usb_driver_set_configuration: %d\n", |
393 | err); | 392 | err); |
394 | return -ENODEV; | 393 | /* Always return an error, so that we stop creating a device |
395 | } | 394 | that will just be destroyed and recreated with a new |
395 | configuration */ | ||
396 | return -ENODEV; | ||
396 | } else | 397 | } else |
397 | snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n"); | 398 | snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n"); |
398 | 399 | ||
@@ -528,11 +529,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev) | |||
528 | #define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */ | 529 | #define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */ |
529 | #define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */ | 530 | #define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */ |
530 | 531 | ||
531 | int snd_usb_mbox2_boot_quirk(struct usb_device *dev) | 532 | static int snd_usb_mbox2_boot_quirk(struct usb_device *dev) |
532 | { | 533 | { |
533 | struct usb_host_config *config = dev->actconfig; | 534 | struct usb_host_config *config = dev->actconfig; |
534 | int err; | 535 | int err; |
535 | u8 bootresponse; | 536 | u8 bootresponse[12]; |
536 | int fwsize; | 537 | int fwsize; |
537 | int count; | 538 | int count; |
538 | 539 | ||
@@ -546,20 +547,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev) | |||
546 | snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n"); | 547 | snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n"); |
547 | 548 | ||
548 | count = 0; | 549 | count = 0; |
549 | bootresponse = MBOX2_BOOT_LOADING; | 550 | bootresponse[0] = MBOX2_BOOT_LOADING; |
550 | while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) { | 551 | while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) { |
551 | msleep(500); /* 0.5 second delay */ | 552 | msleep(500); /* 0.5 second delay */ |
552 | snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), | 553 | snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), |
553 | /* Control magic - load onboard firmware */ | 554 | /* Control magic - load onboard firmware */ |
554 | 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); | 555 | 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); |
555 | if (bootresponse == MBOX2_BOOT_READY) | 556 | if (bootresponse[0] == MBOX2_BOOT_READY) |
556 | break; | 557 | break; |
557 | snd_printd("usb-audio: device not ready, resending boot sequence...\n"); | 558 | snd_printd("usb-audio: device not ready, resending boot sequence...\n"); |
558 | count++; | 559 | count++; |
559 | } | 560 | } |
560 | 561 | ||
561 | if (bootresponse != MBOX2_BOOT_READY) { | 562 | if (bootresponse[0] != MBOX2_BOOT_READY) { |
562 | snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse); | 563 | snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]); |
563 | return -ENODEV; | 564 | return -ENODEV; |
564 | } | 565 | } |
565 | 566 | ||
@@ -660,7 +661,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip, | |||
660 | return 0; /* keep this altsetting */ | 661 | return 0; /* keep this altsetting */ |
661 | } | 662 | } |
662 | 663 | ||
663 | |||
664 | static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, | 664 | static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, |
665 | int iface, int altno) | 665 | int iface, int altno) |
666 | { | 666 | { |
@@ -861,6 +861,17 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep) | |||
861 | if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) && | 861 | if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) && |
862 | ep->type == SND_USB_ENDPOINT_TYPE_SYNC) | 862 | ep->type == SND_USB_ENDPOINT_TYPE_SYNC) |
863 | ep->skip_packets = 4; | 863 | ep->skip_packets = 4; |
864 | |||
865 | /* | ||
866 | * M-Audio Fast Track C400 - when packets are not skipped, real world | ||
867 | * latency varies by approx. +/- 50 frames (at 96KHz) each time the | ||
868 | * stream is (re)started. When skipping packets 16 at endpoint start | ||
869 | * up, the real world latency is stable within +/- 1 frame (also | ||
870 | * across power cycles). | ||
871 | */ | ||
872 | if (ep->chip->usb_id == USB_ID(0x0763, 0x2030) && | ||
873 | ep->type == SND_USB_ENDPOINT_TYPE_DATA) | ||
874 | ep->skip_packets = 16; | ||
864 | } | 875 | } |
865 | 876 | ||
866 | void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, | 877 | void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, |
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index a8172c119796..1ac3fd9cc5a6 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -76,7 +76,6 @@ enum quirk_type { | |||
76 | QUIRK_MIDI_YAMAHA, | 76 | QUIRK_MIDI_YAMAHA, |
77 | QUIRK_MIDI_MIDIMAN, | 77 | QUIRK_MIDI_MIDIMAN, |
78 | QUIRK_MIDI_NOVATION, | 78 | QUIRK_MIDI_NOVATION, |
79 | QUIRK_MIDI_MBOX2, | ||
80 | QUIRK_MIDI_RAW_BYTES, | 79 | QUIRK_MIDI_RAW_BYTES, |
81 | QUIRK_MIDI_EMAGIC, | 80 | QUIRK_MIDI_EMAGIC, |
82 | QUIRK_MIDI_CME, | 81 | QUIRK_MIDI_CME, |