diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-01-05 04:53:58 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-05 04:53:58 -0500 |
commit | cd8faac38c1c4ff2b404d808f6c623ab47e06475 (patch) | |
tree | 554666b304cfe5c650be3fd857cfdfe7b1f9cae3 /sound | |
parent | 8924c671b668169289f8f4b70518b3aa96e454df (diff) | |
parent | 913ae5a24efd27deef4fc154953871b62d0d99cd (diff) |
Merge branch 'topic/usbaudio' into for-linus
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/caiaq/caiaq-device.c | 4 | ||||
-rw-r--r-- | sound/usb/usbaudio.c | 8 | ||||
-rw-r--r-- | sound/usb/usbmidi.c | 39 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 5 | ||||
-rw-r--r-- | sound/usb/usx2y/us122l.c | 4 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 4 |
6 files changed, 30 insertions, 34 deletions
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c index b143ef7152f7..a62500e387a6 100644 --- a/sound/usb/caiaq/caiaq-device.c +++ b/sound/usb/caiaq/caiaq-device.c | |||
@@ -446,7 +446,7 @@ static int __devinit snd_probe(struct usb_interface *intf, | |||
446 | if (!card) | 446 | if (!card) |
447 | return -ENOMEM; | 447 | return -ENOMEM; |
448 | 448 | ||
449 | dev_set_drvdata(&intf->dev, card); | 449 | usb_set_intfdata(intf, card); |
450 | ret = init_card(caiaqdev(card)); | 450 | ret = init_card(caiaqdev(card)); |
451 | if (ret < 0) { | 451 | if (ret < 0) { |
452 | log("unable to init card! (ret=%d)\n", ret); | 452 | log("unable to init card! (ret=%d)\n", ret); |
@@ -460,7 +460,7 @@ static int __devinit snd_probe(struct usb_interface *intf, | |||
460 | static void snd_disconnect(struct usb_interface *intf) | 460 | static void snd_disconnect(struct usb_interface *intf) |
461 | { | 461 | { |
462 | struct snd_usb_caiaqdev *dev; | 462 | struct snd_usb_caiaqdev *dev; |
463 | struct snd_card *card = dev_get_drvdata(&intf->dev); | 463 | struct snd_card *card = usb_get_intfdata(intf); |
464 | 464 | ||
465 | debug("%s(%p)\n", __func__, intf); | 465 | debug("%s(%p)\n", __func__, intf); |
466 | 466 | ||
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index bbd70d5814a0..c709b9563226 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -3709,7 +3709,7 @@ static int usb_audio_probe(struct usb_interface *intf, | |||
3709 | void *chip; | 3709 | void *chip; |
3710 | chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); | 3710 | chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); |
3711 | if (chip) { | 3711 | if (chip) { |
3712 | dev_set_drvdata(&intf->dev, chip); | 3712 | usb_set_intfdata(intf, chip); |
3713 | return 0; | 3713 | return 0; |
3714 | } else | 3714 | } else |
3715 | return -EIO; | 3715 | return -EIO; |
@@ -3718,13 +3718,13 @@ static int usb_audio_probe(struct usb_interface *intf, | |||
3718 | static void usb_audio_disconnect(struct usb_interface *intf) | 3718 | static void usb_audio_disconnect(struct usb_interface *intf) |
3719 | { | 3719 | { |
3720 | snd_usb_audio_disconnect(interface_to_usbdev(intf), | 3720 | snd_usb_audio_disconnect(interface_to_usbdev(intf), |
3721 | dev_get_drvdata(&intf->dev)); | 3721 | usb_get_intfdata(intf)); |
3722 | } | 3722 | } |
3723 | 3723 | ||
3724 | #ifdef CONFIG_PM | 3724 | #ifdef CONFIG_PM |
3725 | static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | 3725 | static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) |
3726 | { | 3726 | { |
3727 | struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); | 3727 | struct snd_usb_audio *chip = usb_get_intfdata(intf); |
3728 | struct list_head *p; | 3728 | struct list_head *p; |
3729 | struct snd_usb_stream *as; | 3729 | struct snd_usb_stream *as; |
3730 | 3730 | ||
@@ -3744,7 +3744,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | |||
3744 | 3744 | ||
3745 | static int usb_audio_resume(struct usb_interface *intf) | 3745 | static int usb_audio_resume(struct usb_interface *intf) |
3746 | { | 3746 | { |
3747 | struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); | 3747 | struct snd_usb_audio *chip = usb_get_intfdata(intf); |
3748 | 3748 | ||
3749 | if (chip == (void *)-1L) | 3749 | if (chip == (void *)-1L) |
3750 | return 0; | 3750 | return 0; |
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index 6d9f9b135c62..320641ab5be7 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c | |||
@@ -1392,8 +1392,7 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1392 | for (i = 0; i < intfd->bNumEndpoints; ++i) { | 1392 | for (i = 0; i < intfd->bNumEndpoints; ++i) { |
1393 | hostep = &hostif->endpoint[i]; | 1393 | hostep = &hostif->endpoint[i]; |
1394 | ep = get_ep_desc(hostep); | 1394 | ep = get_ep_desc(hostep); |
1395 | if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && | 1395 | if (!usb_endpoint_xfer_bulk(ep) && !usb_endpoint_xfer_int(ep)) |
1396 | (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | ||
1397 | continue; | 1396 | continue; |
1398 | ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra; | 1397 | ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra; |
1399 | if (hostep->extralen < 4 || | 1398 | if (hostep->extralen < 4 || |
@@ -1401,15 +1400,15 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1401 | ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || | 1400 | ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || |
1402 | ms_ep->bDescriptorSubtype != MS_GENERAL) | 1401 | ms_ep->bDescriptorSubtype != MS_GENERAL) |
1403 | continue; | 1402 | continue; |
1404 | if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { | 1403 | if (usb_endpoint_dir_out(ep)) { |
1405 | if (endpoints[epidx].out_ep) { | 1404 | if (endpoints[epidx].out_ep) { |
1406 | if (++epidx >= MIDI_MAX_ENDPOINTS) { | 1405 | if (++epidx >= MIDI_MAX_ENDPOINTS) { |
1407 | snd_printk(KERN_WARNING "too many endpoints\n"); | 1406 | snd_printk(KERN_WARNING "too many endpoints\n"); |
1408 | break; | 1407 | break; |
1409 | } | 1408 | } |
1410 | } | 1409 | } |
1411 | endpoints[epidx].out_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | 1410 | endpoints[epidx].out_ep = usb_endpoint_num(ep); |
1412 | if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) | 1411 | if (usb_endpoint_xfer_int(ep)) |
1413 | endpoints[epidx].out_interval = ep->bInterval; | 1412 | endpoints[epidx].out_interval = ep->bInterval; |
1414 | else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) | 1413 | else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) |
1415 | /* | 1414 | /* |
@@ -1428,8 +1427,8 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1428 | break; | 1427 | break; |
1429 | } | 1428 | } |
1430 | } | 1429 | } |
1431 | endpoints[epidx].in_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | 1430 | endpoints[epidx].in_ep = usb_endpoint_num(ep); |
1432 | if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) | 1431 | if (usb_endpoint_xfer_int(ep)) |
1433 | endpoints[epidx].in_interval = ep->bInterval; | 1432 | endpoints[epidx].in_interval = ep->bInterval; |
1434 | else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) | 1433 | else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) |
1435 | endpoints[epidx].in_interval = 1; | 1434 | endpoints[epidx].in_interval = 1; |
@@ -1495,20 +1494,20 @@ static int snd_usbmidi_detect_endpoints(struct snd_usb_midi* umidi, | |||
1495 | 1494 | ||
1496 | for (i = 0; i < intfd->bNumEndpoints; ++i) { | 1495 | for (i = 0; i < intfd->bNumEndpoints; ++i) { |
1497 | epd = get_endpoint(hostif, i); | 1496 | epd = get_endpoint(hostif, i); |
1498 | if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && | 1497 | if (!usb_endpoint_xfer_bulk(epd) && |
1499 | (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | 1498 | !usb_endpoint_xfer_int(epd)) |
1500 | continue; | 1499 | continue; |
1501 | if (out_eps < max_endpoints && | 1500 | if (out_eps < max_endpoints && |
1502 | (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { | 1501 | usb_endpoint_dir_out(epd)) { |
1503 | endpoint[out_eps].out_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | 1502 | endpoint[out_eps].out_ep = usb_endpoint_num(epd); |
1504 | if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) | 1503 | if (usb_endpoint_xfer_int(epd)) |
1505 | endpoint[out_eps].out_interval = epd->bInterval; | 1504 | endpoint[out_eps].out_interval = epd->bInterval; |
1506 | ++out_eps; | 1505 | ++out_eps; |
1507 | } | 1506 | } |
1508 | if (in_eps < max_endpoints && | 1507 | if (in_eps < max_endpoints && |
1509 | (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { | 1508 | usb_endpoint_dir_in(epd)) { |
1510 | endpoint[in_eps].in_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | 1509 | endpoint[in_eps].in_ep = usb_endpoint_num(epd); |
1511 | if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) | 1510 | if (usb_endpoint_xfer_int(epd)) |
1512 | endpoint[in_eps].in_interval = epd->bInterval; | 1511 | endpoint[in_eps].in_interval = epd->bInterval; |
1513 | ++in_eps; | 1512 | ++in_eps; |
1514 | } | 1513 | } |
@@ -1607,21 +1606,19 @@ static int snd_usbmidi_create_endpoints_midiman(struct snd_usb_midi* umidi, | |||
1607 | } | 1606 | } |
1608 | 1607 | ||
1609 | epd = get_endpoint(hostif, 0); | 1608 | epd = get_endpoint(hostif, 0); |
1610 | if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || | 1609 | if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) { |
1611 | (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) { | ||
1612 | snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n"); | 1610 | snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n"); |
1613 | return -ENXIO; | 1611 | return -ENXIO; |
1614 | } | 1612 | } |
1615 | epd = get_endpoint(hostif, 2); | 1613 | epd = get_endpoint(hostif, 2); |
1616 | if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || | 1614 | if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) { |
1617 | (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) { | ||
1618 | snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n"); | 1615 | snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n"); |
1619 | return -ENXIO; | 1616 | return -ENXIO; |
1620 | } | 1617 | } |
1621 | if (endpoint->out_cables > 0x0001) { | 1618 | if (endpoint->out_cables > 0x0001) { |
1622 | epd = get_endpoint(hostif, 4); | 1619 | epd = get_endpoint(hostif, 4); |
1623 | if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || | 1620 | if (!usb_endpoint_dir_out(epd) || |
1624 | (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) { | 1621 | !usb_endpoint_xfer_bulk(epd)) { |
1625 | snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n"); | 1622 | snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n"); |
1626 | return -ENXIO; | 1623 | return -ENXIO; |
1627 | } | 1624 | } |
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index a49246113e75..00397c8a765b 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
@@ -1755,11 +1755,10 @@ static int snd_usb_mixer_status_create(struct usb_mixer_interface *mixer) | |||
1755 | if (get_iface_desc(hostif)->bNumEndpoints < 1) | 1755 | if (get_iface_desc(hostif)->bNumEndpoints < 1) |
1756 | return 0; | 1756 | return 0; |
1757 | ep = get_endpoint(hostif, 0); | 1757 | ep = get_endpoint(hostif, 0); |
1758 | if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || | 1758 | if (!usb_endpoint_dir_in(ep) || !usb_endpoint_xfer_int(ep)) |
1759 | (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | ||
1760 | return 0; | 1759 | return 0; |
1761 | 1760 | ||
1762 | epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | 1761 | epnum = usb_endpoint_num(ep); |
1763 | buffer_length = le16_to_cpu(ep->wMaxPacketSize); | 1762 | buffer_length = le16_to_cpu(ep->wMaxPacketSize); |
1764 | transfer_buffer = kmalloc(buffer_length, GFP_KERNEL); | 1763 | transfer_buffer = kmalloc(buffer_length, GFP_KERNEL); |
1765 | if (!transfer_buffer) | 1764 | if (!transfer_buffer) |
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index c2515b680f9f..73e59f4403a4 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -589,7 +589,7 @@ static int snd_us122l_suspend(struct usb_interface *intf, pm_message_t message) | |||
589 | struct us122l *us122l; | 589 | struct us122l *us122l; |
590 | struct list_head *p; | 590 | struct list_head *p; |
591 | 591 | ||
592 | card = dev_get_drvdata(&intf->dev); | 592 | card = usb_get_intfdata(intf); |
593 | if (!card) | 593 | if (!card) |
594 | return 0; | 594 | return 0; |
595 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 595 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -615,7 +615,7 @@ static int snd_us122l_resume(struct usb_interface *intf) | |||
615 | struct list_head *p; | 615 | struct list_head *p; |
616 | int err; | 616 | int err; |
617 | 617 | ||
618 | card = dev_get_drvdata(&intf->dev); | 618 | card = usb_get_intfdata(intf); |
619 | if (!card) | 619 | if (!card) |
620 | return 0; | 620 | return 0; |
621 | 621 | ||
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index e5981a630314..ca26c532e77e 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -392,7 +392,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i | |||
392 | void *chip; | 392 | void *chip; |
393 | chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); | 393 | chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); |
394 | if (chip) { | 394 | if (chip) { |
395 | dev_set_drvdata(&intf->dev, chip); | 395 | usb_set_intfdata(intf, chip); |
396 | return 0; | 396 | return 0; |
397 | } else | 397 | } else |
398 | return -EIO; | 398 | return -EIO; |
@@ -401,7 +401,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i | |||
401 | static void snd_usX2Y_disconnect(struct usb_interface *intf) | 401 | static void snd_usX2Y_disconnect(struct usb_interface *intf) |
402 | { | 402 | { |
403 | usX2Y_usb_disconnect(interface_to_usbdev(intf), | 403 | usX2Y_usb_disconnect(interface_to_usbdev(intf), |
404 | dev_get_drvdata(&intf->dev)); | 404 | usb_get_intfdata(intf)); |
405 | } | 405 | } |
406 | 406 | ||
407 | MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table); | 407 | MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table); |