aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/card.c
diff options
context:
space:
mode:
authorPaul Zimmerman <Paul.Zimmerman@synopsys.com>2010-08-13 15:42:07 -0400
committerTakashi Iwai <tiwai@suse.de>2010-08-14 04:30:08 -0400
commit4f4e8f69895c8696a4bcc751817d4b186023ac44 (patch)
tree602ca69d763218a50cfab862169e8194be191b5e /sound/usb/card.c
parent31cbd97726207b483a1731562559fabd4e2efdd0 (diff)
ALSA: usb: USB3 SuperSpeed sound support
This is V2 of the patch, after feedback from Clemens and Daniel. This patch adds SuperSpeed support to the USB drivers under sound/. It adds tests for USB_SPEED_SUPER to the appropriate places that check for the USB speed. This patch has been tested with our SS USB3 device emulating a set of Yamaha speakers and a Logitech microphone, but with the descriptors modified to add USB3 support. It has also been tested with the real speakers and microphone, to make sure that USB2 devices still work. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Daniel Mack <daniel@caiaq.de> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/card.c')
-rw-r--r--sound/usb/card.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 9feb00c831a0..498a2d8fa4bb 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -299,9 +299,13 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
299 299
300 *rchip = NULL; 300 *rchip = NULL;
301 301
302 if (snd_usb_get_speed(dev) != USB_SPEED_LOW && 302 switch (snd_usb_get_speed(dev)) {
303 snd_usb_get_speed(dev) != USB_SPEED_FULL && 303 case USB_SPEED_LOW:
304 snd_usb_get_speed(dev) != USB_SPEED_HIGH) { 304 case USB_SPEED_FULL:
305 case USB_SPEED_HIGH:
306 case USB_SPEED_SUPER:
307 break;
308 default:
305 snd_printk(KERN_ERR "unknown device speed %d\n", snd_usb_get_speed(dev)); 309 snd_printk(KERN_ERR "unknown device speed %d\n", snd_usb_get_speed(dev));
306 return -ENXIO; 310 return -ENXIO;
307 } 311 }
@@ -377,11 +381,22 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
377 if (len < sizeof(card->longname)) 381 if (len < sizeof(card->longname))
378 usb_make_path(dev, card->longname + len, sizeof(card->longname) - len); 382 usb_make_path(dev, card->longname + len, sizeof(card->longname) - len);
379 383
380 strlcat(card->longname, 384 switch (snd_usb_get_speed(dev)) {
381 snd_usb_get_speed(dev) == USB_SPEED_LOW ? ", low speed" : 385 case USB_SPEED_LOW:
382 snd_usb_get_speed(dev) == USB_SPEED_FULL ? ", full speed" : 386 strlcat(card->longname, ", low speed", sizeof(card->longname));
383 ", high speed", 387 break;
384 sizeof(card->longname)); 388 case USB_SPEED_FULL:
389 strlcat(card->longname, ", full speed", sizeof(card->longname));
390 break;
391 case USB_SPEED_HIGH:
392 strlcat(card->longname, ", high speed", sizeof(card->longname));
393 break;
394 case USB_SPEED_SUPER:
395 strlcat(card->longname, ", super speed", sizeof(card->longname));
396 break;
397 default:
398 break;
399 }
385 400
386 snd_usb_audio_create_proc(chip); 401 snd_usb_audio_create_proc(chip);
387 402