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