Commit cd8faac3 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'topic/usbaudio' into for-linus

parents 8924c671 913ae5a2
...@@ -446,7 +446,7 @@ static int __devinit snd_probe(struct usb_interface *intf, ...@@ -446,7 +446,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
if (!card) if (!card)
return -ENOMEM; return -ENOMEM;
dev_set_drvdata(&intf->dev, card); usb_set_intfdata(intf, card);
ret = init_card(caiaqdev(card)); ret = init_card(caiaqdev(card));
if (ret < 0) { if (ret < 0) {
log("unable to init card! (ret=%d)\n", ret); log("unable to init card! (ret=%d)\n", ret);
...@@ -460,7 +460,7 @@ static int __devinit snd_probe(struct usb_interface *intf, ...@@ -460,7 +460,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
static void snd_disconnect(struct usb_interface *intf) static void snd_disconnect(struct usb_interface *intf)
{ {
struct snd_usb_caiaqdev *dev; struct snd_usb_caiaqdev *dev;
struct snd_card *card = dev_get_drvdata(&intf->dev); struct snd_card *card = usb_get_intfdata(intf);
debug("%s(%p)\n", __func__, intf); debug("%s(%p)\n", __func__, intf);
......
...@@ -3709,7 +3709,7 @@ static int usb_audio_probe(struct usb_interface *intf, ...@@ -3709,7 +3709,7 @@ static int usb_audio_probe(struct usb_interface *intf,
void *chip; void *chip;
chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id);
if (chip) { if (chip) {
dev_set_drvdata(&intf->dev, chip); usb_set_intfdata(intf, chip);
return 0; return 0;
} else } else
return -EIO; return -EIO;
...@@ -3718,13 +3718,13 @@ static int usb_audio_probe(struct usb_interface *intf, ...@@ -3718,13 +3718,13 @@ static int usb_audio_probe(struct usb_interface *intf,
static void usb_audio_disconnect(struct usb_interface *intf) static void usb_audio_disconnect(struct usb_interface *intf)
{ {
snd_usb_audio_disconnect(interface_to_usbdev(intf), snd_usb_audio_disconnect(interface_to_usbdev(intf),
dev_get_drvdata(&intf->dev)); usb_get_intfdata(intf));
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
{ {
struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); struct snd_usb_audio *chip = usb_get_intfdata(intf);
struct list_head *p; struct list_head *p;
struct snd_usb_stream *as; struct snd_usb_stream *as;
...@@ -3744,7 +3744,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -3744,7 +3744,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
static int usb_audio_resume(struct usb_interface *intf) static int usb_audio_resume(struct usb_interface *intf)
{ {
struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); struct snd_usb_audio *chip = usb_get_intfdata(intf);
if (chip == (void *)-1L) if (chip == (void *)-1L)
return 0; return 0;
......
...@@ -1392,8 +1392,7 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, ...@@ -1392,8 +1392,7 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
for (i = 0; i < intfd->bNumEndpoints; ++i) { for (i = 0; i < intfd->bNumEndpoints; ++i) {
hostep = &hostif->endpoint[i]; hostep = &hostif->endpoint[i];
ep = get_ep_desc(hostep); ep = get_ep_desc(hostep);
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && if (!usb_endpoint_xfer_bulk(ep) && !usb_endpoint_xfer_int(ep))
(ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
continue; continue;
ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra; ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra;
if (hostep->extralen < 4 || if (hostep->extralen < 4 ||
...@@ -1401,15 +1400,15 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, ...@@ -1401,15 +1400,15 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT ||
ms_ep->bDescriptorSubtype != MS_GENERAL) ms_ep->bDescriptorSubtype != MS_GENERAL)
continue; continue;
if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { if (usb_endpoint_dir_out(ep)) {
if (endpoints[epidx].out_ep) { if (endpoints[epidx].out_ep) {
if (++epidx >= MIDI_MAX_ENDPOINTS) { if (++epidx >= MIDI_MAX_ENDPOINTS) {
snd_printk(KERN_WARNING "too many endpoints\n"); snd_printk(KERN_WARNING "too many endpoints\n");
break; break;
} }
} }
endpoints[epidx].out_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; endpoints[epidx].out_ep = usb_endpoint_num(ep);
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) if (usb_endpoint_xfer_int(ep))
endpoints[epidx].out_interval = ep->bInterval; endpoints[epidx].out_interval = ep->bInterval;
else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
/* /*
...@@ -1428,8 +1427,8 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, ...@@ -1428,8 +1427,8 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
break; break;
} }
} }
endpoints[epidx].in_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; endpoints[epidx].in_ep = usb_endpoint_num(ep);
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) if (usb_endpoint_xfer_int(ep))
endpoints[epidx].in_interval = ep->bInterval; endpoints[epidx].in_interval = ep->bInterval;
else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
endpoints[epidx].in_interval = 1; endpoints[epidx].in_interval = 1;
...@@ -1495,20 +1494,20 @@ static int snd_usbmidi_detect_endpoints(struct snd_usb_midi* umidi, ...@@ -1495,20 +1494,20 @@ static int snd_usbmidi_detect_endpoints(struct snd_usb_midi* umidi,
for (i = 0; i < intfd->bNumEndpoints; ++i) { for (i = 0; i < intfd->bNumEndpoints; ++i) {
epd = get_endpoint(hostif, i); epd = get_endpoint(hostif, i);
if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && if (!usb_endpoint_xfer_bulk(epd) &&
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) !usb_endpoint_xfer_int(epd))
continue; continue;
if (out_eps < max_endpoints && if (out_eps < max_endpoints &&
(epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { usb_endpoint_dir_out(epd)) {
endpoint[out_eps].out_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; endpoint[out_eps].out_ep = usb_endpoint_num(epd);
if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) if (usb_endpoint_xfer_int(epd))
endpoint[out_eps].out_interval = epd->bInterval; endpoint[out_eps].out_interval = epd->bInterval;
++out_eps; ++out_eps;
} }
if (in_eps < max_endpoints && if (in_eps < max_endpoints &&
(epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { usb_endpoint_dir_in(epd)) {
endpoint[in_eps].in_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; endpoint[in_eps].in_ep = usb_endpoint_num(epd);
if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) if (usb_endpoint_xfer_int(epd))
endpoint[in_eps].in_interval = epd->bInterval; endpoint[in_eps].in_interval = epd->bInterval;
++in_eps; ++in_eps;
} }
...@@ -1607,21 +1606,19 @@ static int snd_usbmidi_create_endpoints_midiman(struct snd_usb_midi* umidi, ...@@ -1607,21 +1606,19 @@ static int snd_usbmidi_create_endpoints_midiman(struct snd_usb_midi* umidi,
} }
epd = get_endpoint(hostif, 0); epd = get_endpoint(hostif, 0);
if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) {
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) {
snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n"); snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n");
return -ENXIO; return -ENXIO;
} }
epd = get_endpoint(hostif, 2); epd = get_endpoint(hostif, 2);
if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) {
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) {
snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n"); snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n");
return -ENXIO; return -ENXIO;
} }
if (endpoint->out_cables > 0x0001) { if (endpoint->out_cables > 0x0001) {
epd = get_endpoint(hostif, 4); epd = get_endpoint(hostif, 4);
if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || if (!usb_endpoint_dir_out(epd) ||
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) { !usb_endpoint_xfer_bulk(epd)) {
snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n"); snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n");
return -ENXIO; return -ENXIO;
} }
......
...@@ -1755,11 +1755,10 @@ static int snd_usb_mixer_status_create(struct usb_mixer_interface *mixer) ...@@ -1755,11 +1755,10 @@ static int snd_usb_mixer_status_create(struct usb_mixer_interface *mixer)
if (get_iface_desc(hostif)->bNumEndpoints < 1) if (get_iface_desc(hostif)->bNumEndpoints < 1)
return 0; return 0;
ep = get_endpoint(hostif, 0); ep = get_endpoint(hostif, 0);
if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || if (!usb_endpoint_dir_in(ep) || !usb_endpoint_xfer_int(ep))
(ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
return 0; return 0;
epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; epnum = usb_endpoint_num(ep);
buffer_length = le16_to_cpu(ep->wMaxPacketSize); buffer_length = le16_to_cpu(ep->wMaxPacketSize);
transfer_buffer = kmalloc(buffer_length, GFP_KERNEL); transfer_buffer = kmalloc(buffer_length, GFP_KERNEL);
if (!transfer_buffer) if (!transfer_buffer)
......
...@@ -589,7 +589,7 @@ static int snd_us122l_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -589,7 +589,7 @@ static int snd_us122l_suspend(struct usb_interface *intf, pm_message_t message)
struct us122l *us122l; struct us122l *us122l;
struct list_head *p; struct list_head *p;
card = dev_get_drvdata(&intf->dev); card = usb_get_intfdata(intf);
if (!card) if (!card)
return 0; return 0;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
...@@ -615,7 +615,7 @@ static int snd_us122l_resume(struct usb_interface *intf) ...@@ -615,7 +615,7 @@ static int snd_us122l_resume(struct usb_interface *intf)
struct list_head *p; struct list_head *p;
int err; int err;
card = dev_get_drvdata(&intf->dev); card = usb_get_intfdata(intf);
if (!card) if (!card)
return 0; return 0;
......
...@@ -392,7 +392,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i ...@@ -392,7 +392,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i
void *chip; void *chip;
chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id);
if (chip) { if (chip) {
dev_set_drvdata(&intf->dev, chip); usb_set_intfdata(intf, chip);
return 0; return 0;
} else } else
return -EIO; return -EIO;
...@@ -401,7 +401,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i ...@@ -401,7 +401,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i
static void snd_usX2Y_disconnect(struct usb_interface *intf) static void snd_usX2Y_disconnect(struct usb_interface *intf)
{ {
usX2Y_usb_disconnect(interface_to_usbdev(intf), usX2Y_usb_disconnect(interface_to_usbdev(intf),
dev_get_drvdata(&intf->dev)); usb_get_intfdata(intf));
} }
MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table); MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment