tangled
alpha
login
or
join now
tjh.dev
/
kernel
Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1
fork
atom
overview
issues
pulls
pipelines
Merge branch 'topic/usbaudio' into for-linus
Takashi Iwai
17 years ago
cd8faac3
8924c671
+30
-34
6 changed files
expand all
collapse all
unified
split
sound
usb
caiaq
caiaq-device.c
usbaudio.c
usbmidi.c
usbmixer.c
usx2y
us122l.c
usbusx2y.c
+2
-2
sound/usb/caiaq/caiaq-device.c
···
446
if (!card)
447
return -ENOMEM;
448
449
-
dev_set_drvdata(&intf->dev, card);
450
ret = init_card(caiaqdev(card));
451
if (ret < 0) {
452
log("unable to init card! (ret=%d)\n", ret);
···
460
static void snd_disconnect(struct usb_interface *intf)
461
{
462
struct snd_usb_caiaqdev *dev;
463
-
struct snd_card *card = dev_get_drvdata(&intf->dev);
464
465
debug("%s(%p)\n", __func__, intf);
466
···
446
if (!card)
447
return -ENOMEM;
448
449
+
usb_set_intfdata(intf, card);
450
ret = init_card(caiaqdev(card));
451
if (ret < 0) {
452
log("unable to init card! (ret=%d)\n", ret);
···
460
static void snd_disconnect(struct usb_interface *intf)
461
{
462
struct snd_usb_caiaqdev *dev;
463
+
struct snd_card *card = usb_get_intfdata(intf);
464
465
debug("%s(%p)\n", __func__, intf);
466
+4
-4
sound/usb/usbaudio.c
···
3709
void *chip;
3710
chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id);
3711
if (chip) {
3712
-
dev_set_drvdata(&intf->dev, chip);
3713
return 0;
3714
} else
3715
return -EIO;
···
3718
static void usb_audio_disconnect(struct usb_interface *intf)
3719
{
3720
snd_usb_audio_disconnect(interface_to_usbdev(intf),
3721
-
dev_get_drvdata(&intf->dev));
3722
}
3723
3724
#ifdef CONFIG_PM
3725
static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
3726
{
3727
-
struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev);
3728
struct list_head *p;
3729
struct snd_usb_stream *as;
3730
···
3744
3745
static int usb_audio_resume(struct usb_interface *intf)
3746
{
3747
-
struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev);
3748
3749
if (chip == (void *)-1L)
3750
return 0;
···
3709
void *chip;
3710
chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id);
3711
if (chip) {
3712
+
usb_set_intfdata(intf, chip);
3713
return 0;
3714
} else
3715
return -EIO;
···
3718
static void usb_audio_disconnect(struct usb_interface *intf)
3719
{
3720
snd_usb_audio_disconnect(interface_to_usbdev(intf),
3721
+
usb_get_intfdata(intf));
3722
}
3723
3724
#ifdef CONFIG_PM
3725
static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
3726
{
3727
+
struct snd_usb_audio *chip = usb_get_intfdata(intf);
3728
struct list_head *p;
3729
struct snd_usb_stream *as;
3730
···
3744
3745
static int usb_audio_resume(struct usb_interface *intf)
3746
{
3747
+
struct snd_usb_audio *chip = usb_get_intfdata(intf);
3748
3749
if (chip == (void *)-1L)
3750
return 0;
+18
-21
sound/usb/usbmidi.c
···
1392
for (i = 0; i < intfd->bNumEndpoints; ++i) {
1393
hostep = &hostif->endpoint[i];
1394
ep = get_ep_desc(hostep);
1395
-
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK &&
1396
-
(ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
1397
continue;
1398
ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra;
1399
if (hostep->extralen < 4 ||
···
1400
ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT ||
1401
ms_ep->bDescriptorSubtype != MS_GENERAL)
1402
continue;
1403
-
if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) {
1404
if (endpoints[epidx].out_ep) {
1405
if (++epidx >= MIDI_MAX_ENDPOINTS) {
1406
snd_printk(KERN_WARNING "too many endpoints\n");
1407
break;
1408
}
1409
}
1410
-
endpoints[epidx].out_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1411
-
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)
1412
endpoints[epidx].out_interval = ep->bInterval;
1413
else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1414
/*
···
1427
break;
1428
}
1429
}
1430
-
endpoints[epidx].in_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1431
-
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)
1432
endpoints[epidx].in_interval = ep->bInterval;
1433
else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1434
endpoints[epidx].in_interval = 1;
···
1494
1495
for (i = 0; i < intfd->bNumEndpoints; ++i) {
1496
epd = get_endpoint(hostif, i);
1497
-
if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK &&
1498
-
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
1499
continue;
1500
if (out_eps < max_endpoints &&
1501
-
(epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) {
1502
-
endpoint[out_eps].out_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1503
-
if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)
1504
endpoint[out_eps].out_interval = epd->bInterval;
1505
++out_eps;
1506
}
1507
if (in_eps < max_endpoints &&
1508
-
(epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) {
1509
-
endpoint[in_eps].in_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1510
-
if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)
1511
endpoint[in_eps].in_interval = epd->bInterval;
1512
++in_eps;
1513
}
···
1606
}
1607
1608
epd = get_endpoint(hostif, 0);
1609
-
if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN ||
1610
-
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) {
1611
snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n");
1612
return -ENXIO;
1613
}
1614
epd = get_endpoint(hostif, 2);
1615
-
if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT ||
1616
-
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) {
1617
snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n");
1618
return -ENXIO;
1619
}
1620
if (endpoint->out_cables > 0x0001) {
1621
epd = get_endpoint(hostif, 4);
1622
-
if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT ||
1623
-
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) {
1624
snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n");
1625
return -ENXIO;
1626
}
···
1392
for (i = 0; i < intfd->bNumEndpoints; ++i) {
1393
hostep = &hostif->endpoint[i];
1394
ep = get_ep_desc(hostep);
1395
+
if (!usb_endpoint_xfer_bulk(ep) && !usb_endpoint_xfer_int(ep))
0
1396
continue;
1397
ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra;
1398
if (hostep->extralen < 4 ||
···
1401
ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT ||
1402
ms_ep->bDescriptorSubtype != MS_GENERAL)
1403
continue;
1404
+
if (usb_endpoint_dir_out(ep)) {
1405
if (endpoints[epidx].out_ep) {
1406
if (++epidx >= MIDI_MAX_ENDPOINTS) {
1407
snd_printk(KERN_WARNING "too many endpoints\n");
1408
break;
1409
}
1410
}
1411
+
endpoints[epidx].out_ep = usb_endpoint_num(ep);
1412
+
if (usb_endpoint_xfer_int(ep))
1413
endpoints[epidx].out_interval = ep->bInterval;
1414
else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1415
/*
···
1428
break;
1429
}
1430
}
1431
+
endpoints[epidx].in_ep = usb_endpoint_num(ep);
1432
+
if (usb_endpoint_xfer_int(ep))
1433
endpoints[epidx].in_interval = ep->bInterval;
1434
else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1435
endpoints[epidx].in_interval = 1;
···
1495
1496
for (i = 0; i < intfd->bNumEndpoints; ++i) {
1497
epd = get_endpoint(hostif, i);
1498
+
if (!usb_endpoint_xfer_bulk(epd) &&
1499
+
!usb_endpoint_xfer_int(epd))
1500
continue;
1501
if (out_eps < max_endpoints &&
1502
+
usb_endpoint_dir_out(epd)) {
1503
+
endpoint[out_eps].out_ep = usb_endpoint_num(epd);
1504
+
if (usb_endpoint_xfer_int(epd))
1505
endpoint[out_eps].out_interval = epd->bInterval;
1506
++out_eps;
1507
}
1508
if (in_eps < max_endpoints &&
1509
+
usb_endpoint_dir_in(epd)) {
1510
+
endpoint[in_eps].in_ep = usb_endpoint_num(epd);
1511
+
if (usb_endpoint_xfer_int(epd))
1512
endpoint[in_eps].in_interval = epd->bInterval;
1513
++in_eps;
1514
}
···
1607
}
1608
1609
epd = get_endpoint(hostif, 0);
1610
+
if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) {
0
1611
snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n");
1612
return -ENXIO;
1613
}
1614
epd = get_endpoint(hostif, 2);
1615
+
if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) {
0
1616
snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n");
1617
return -ENXIO;
1618
}
1619
if (endpoint->out_cables > 0x0001) {
1620
epd = get_endpoint(hostif, 4);
1621
+
if (!usb_endpoint_dir_out(epd) ||
1622
+
!usb_endpoint_xfer_bulk(epd)) {
1623
snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n");
1624
return -ENXIO;
1625
}
+2
-3
sound/usb/usbmixer.c
···
1755
if (get_iface_desc(hostif)->bNumEndpoints < 1)
1756
return 0;
1757
ep = get_endpoint(hostif, 0);
1758
-
if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN ||
1759
-
(ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
1760
return 0;
1761
1762
-
epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1763
buffer_length = le16_to_cpu(ep->wMaxPacketSize);
1764
transfer_buffer = kmalloc(buffer_length, GFP_KERNEL);
1765
if (!transfer_buffer)
···
1755
if (get_iface_desc(hostif)->bNumEndpoints < 1)
1756
return 0;
1757
ep = get_endpoint(hostif, 0);
1758
+
if (!usb_endpoint_dir_in(ep) || !usb_endpoint_xfer_int(ep))
0
1759
return 0;
1760
1761
+
epnum = usb_endpoint_num(ep);
1762
buffer_length = le16_to_cpu(ep->wMaxPacketSize);
1763
transfer_buffer = kmalloc(buffer_length, GFP_KERNEL);
1764
if (!transfer_buffer)
+2
-2
sound/usb/usx2y/us122l.c
···
589
struct us122l *us122l;
590
struct list_head *p;
591
592
-
card = dev_get_drvdata(&intf->dev);
593
if (!card)
594
return 0;
595
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
···
615
struct list_head *p;
616
int err;
617
618
-
card = dev_get_drvdata(&intf->dev);
619
if (!card)
620
return 0;
621
···
589
struct us122l *us122l;
590
struct list_head *p;
591
592
+
card = usb_get_intfdata(intf);
593
if (!card)
594
return 0;
595
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
···
615
struct list_head *p;
616
int err;
617
618
+
card = usb_get_intfdata(intf);
619
if (!card)
620
return 0;
621
+2
-2
sound/usb/usx2y/usbusx2y.c
···
392
void *chip;
393
chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id);
394
if (chip) {
395
-
dev_set_drvdata(&intf->dev, chip);
396
return 0;
397
} else
398
return -EIO;
···
401
static void snd_usX2Y_disconnect(struct usb_interface *intf)
402
{
403
usX2Y_usb_disconnect(interface_to_usbdev(intf),
404
-
dev_get_drvdata(&intf->dev));
405
}
406
407
MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);
···
392
void *chip;
393
chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id);
394
if (chip) {
395
+
usb_set_intfdata(intf, chip);
396
return 0;
397
} else
398
return -EIO;
···
401
static void snd_usX2Y_disconnect(struct usb_interface *intf)
402
{
403
usX2Y_usb_disconnect(interface_to_usbdev(intf),
404
+
usb_get_intfdata(intf));
405
}
406
407
MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);