diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/i2c/other/tea575x-tuner.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 114 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 3 | ||||
-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 |
9 files changed, 146 insertions, 41 deletions
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index 549b4eba1496..9d98a6658ac9 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c | |||
@@ -84,7 +84,7 @@ static void snd_tea575x_set_freq(struct snd_tea575x *tea) | |||
84 | * Linux Video interface | 84 | * Linux Video interface |
85 | */ | 85 | */ |
86 | 86 | ||
87 | static int snd_tea575x_ioctl(struct inode *inode, struct file *file, | 87 | static long snd_tea575x_ioctl(struct file *file, |
88 | unsigned int cmd, unsigned long data) | 88 | unsigned int cmd, unsigned long data) |
89 | { | 89 | { |
90 | struct snd_tea575x *tea = video_drvdata(file); | 90 | struct snd_tea575x *tea = video_drvdata(file); |
@@ -174,14 +174,14 @@ static void snd_tea575x_release(struct video_device *vfd) | |||
174 | { | 174 | { |
175 | } | 175 | } |
176 | 176 | ||
177 | static int snd_tea575x_exclusive_open(struct inode *inode, struct file *file) | 177 | static int snd_tea575x_exclusive_open(struct file *file) |
178 | { | 178 | { |
179 | struct snd_tea575x *tea = video_drvdata(file); | 179 | struct snd_tea575x *tea = video_drvdata(file); |
180 | 180 | ||
181 | return test_and_set_bit(0, &tea->in_use) ? -EBUSY : 0; | 181 | return test_and_set_bit(0, &tea->in_use) ? -EBUSY : 0; |
182 | } | 182 | } |
183 | 183 | ||
184 | static int snd_tea575x_exclusive_release(struct inode *inode, struct file *file) | 184 | static int snd_tea575x_exclusive_release(struct file *file) |
185 | { | 185 | { |
186 | struct snd_tea575x *tea = video_drvdata(file); | 186 | struct snd_tea575x *tea = video_drvdata(file); |
187 | 187 | ||
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index b20e1cede00b..75de40aaab0a 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/pci.h> | 26 | #include <linux/pci.h> |
27 | #include <sound/core.h> | 27 | #include <sound/core.h> |
28 | #include <sound/jack.h> | ||
29 | |||
28 | #include "hda_codec.h" | 30 | #include "hda_codec.h" |
29 | #include "hda_local.h" | 31 | #include "hda_local.h" |
30 | 32 | ||
@@ -37,8 +39,21 @@ | |||
37 | #define CONEXANT_HP_EVENT 0x37 | 39 | #define CONEXANT_HP_EVENT 0x37 |
38 | #define CONEXANT_MIC_EVENT 0x38 | 40 | #define CONEXANT_MIC_EVENT 0x38 |
39 | 41 | ||
42 | /* Conexant 5051 specific */ | ||
43 | |||
44 | #define CXT5051_SPDIF_OUT 0x1C | ||
45 | #define CXT5051_PORTB_EVENT 0x38 | ||
46 | #define CXT5051_PORTC_EVENT 0x39 | ||
40 | 47 | ||
41 | 48 | ||
49 | struct conexant_jack { | ||
50 | |||
51 | hda_nid_t nid; | ||
52 | int type; | ||
53 | struct snd_jack *jack; | ||
54 | |||
55 | }; | ||
56 | |||
42 | struct conexant_spec { | 57 | struct conexant_spec { |
43 | 58 | ||
44 | struct snd_kcontrol_new *mixers[5]; | 59 | struct snd_kcontrol_new *mixers[5]; |
@@ -83,6 +98,9 @@ struct conexant_spec { | |||
83 | 98 | ||
84 | unsigned int spdif_route; | 99 | unsigned int spdif_route; |
85 | 100 | ||
101 | /* jack detection */ | ||
102 | struct snd_array jacks; | ||
103 | |||
86 | /* dynamic controls, init_verbs and input_mux */ | 104 | /* dynamic controls, init_verbs and input_mux */ |
87 | struct auto_pin_cfg autocfg; | 105 | struct auto_pin_cfg autocfg; |
88 | struct hda_input_mux private_imux; | 106 | struct hda_input_mux private_imux; |
@@ -329,6 +347,86 @@ static int conexant_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
329 | &spec->cur_mux[adc_idx]); | 347 | &spec->cur_mux[adc_idx]); |
330 | } | 348 | } |
331 | 349 | ||
350 | static int conexant_add_jack(struct hda_codec *codec, | ||
351 | hda_nid_t nid, int type) | ||
352 | { | ||
353 | struct conexant_spec *spec; | ||
354 | struct conexant_jack *jack; | ||
355 | const char *name; | ||
356 | |||
357 | spec = codec->spec; | ||
358 | snd_array_init(&spec->jacks, sizeof(*jack), 32); | ||
359 | jack = snd_array_new(&spec->jacks); | ||
360 | name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ; | ||
361 | |||
362 | if (!jack) | ||
363 | return -ENOMEM; | ||
364 | |||
365 | jack->nid = nid; | ||
366 | jack->type = type; | ||
367 | |||
368 | return snd_jack_new(codec->bus->card, name, type, &jack->jack); | ||
369 | } | ||
370 | |||
371 | static void conexant_report_jack(struct hda_codec *codec, hda_nid_t nid) | ||
372 | { | ||
373 | struct conexant_spec *spec = codec->spec; | ||
374 | struct conexant_jack *jacks = spec->jacks.list; | ||
375 | |||
376 | if (jacks) { | ||
377 | int i; | ||
378 | for (i = 0; i < spec->jacks.used; i++) { | ||
379 | if (jacks->nid == nid) { | ||
380 | unsigned int present; | ||
381 | present = snd_hda_codec_read(codec, nid, 0, | ||
382 | AC_VERB_GET_PIN_SENSE, 0) & | ||
383 | AC_PINSENSE_PRESENCE; | ||
384 | |||
385 | present = (present) ? jacks->type : 0 ; | ||
386 | |||
387 | snd_jack_report(jacks->jack, | ||
388 | present); | ||
389 | } | ||
390 | jacks++; | ||
391 | } | ||
392 | } | ||
393 | } | ||
394 | |||
395 | static int conexant_init_jacks(struct hda_codec *codec) | ||
396 | { | ||
397 | #ifdef CONFIG_SND_JACK | ||
398 | struct conexant_spec *spec = codec->spec; | ||
399 | int i; | ||
400 | |||
401 | for (i = 0; i < spec->num_init_verbs; i++) { | ||
402 | const struct hda_verb *hv; | ||
403 | |||
404 | hv = spec->init_verbs[i]; | ||
405 | while (hv->nid) { | ||
406 | int err = 0; | ||
407 | switch (hv->param ^ AC_USRSP_EN) { | ||
408 | case CONEXANT_HP_EVENT: | ||
409 | err = conexant_add_jack(codec, hv->nid, | ||
410 | SND_JACK_HEADPHONE); | ||
411 | conexant_report_jack(codec, hv->nid); | ||
412 | break; | ||
413 | case CXT5051_PORTC_EVENT: | ||
414 | case CONEXANT_MIC_EVENT: | ||
415 | err = conexant_add_jack(codec, hv->nid, | ||
416 | SND_JACK_MICROPHONE); | ||
417 | conexant_report_jack(codec, hv->nid); | ||
418 | break; | ||
419 | } | ||
420 | if (err < 0) | ||
421 | return err; | ||
422 | ++hv; | ||
423 | } | ||
424 | } | ||
425 | #endif | ||
426 | return 0; | ||
427 | |||
428 | } | ||
429 | |||
332 | static int conexant_init(struct hda_codec *codec) | 430 | static int conexant_init(struct hda_codec *codec) |
333 | { | 431 | { |
334 | struct conexant_spec *spec = codec->spec; | 432 | struct conexant_spec *spec = codec->spec; |
@@ -341,6 +439,16 @@ static int conexant_init(struct hda_codec *codec) | |||
341 | 439 | ||
342 | static void conexant_free(struct hda_codec *codec) | 440 | static void conexant_free(struct hda_codec *codec) |
343 | { | 441 | { |
442 | #ifdef CONFIG_SND_JACK | ||
443 | struct conexant_spec *spec = codec->spec; | ||
444 | if (spec->jacks.list) { | ||
445 | struct conexant_jack *jacks = spec->jacks.list; | ||
446 | int i; | ||
447 | for (i = 0; i < spec->jacks.used; i++) | ||
448 | snd_device_free(codec->bus->card, &jacks[i].jack); | ||
449 | snd_array_free(&spec->jacks); | ||
450 | } | ||
451 | #endif | ||
344 | kfree(codec->spec); | 452 | kfree(codec->spec); |
345 | } | 453 | } |
346 | 454 | ||
@@ -1526,9 +1634,6 @@ static int patch_cxt5047(struct hda_codec *codec) | |||
1526 | /* Conexant 5051 specific */ | 1634 | /* Conexant 5051 specific */ |
1527 | static hda_nid_t cxt5051_dac_nids[1] = { 0x10 }; | 1635 | static hda_nid_t cxt5051_dac_nids[1] = { 0x10 }; |
1528 | static hda_nid_t cxt5051_adc_nids[2] = { 0x14, 0x15 }; | 1636 | static hda_nid_t cxt5051_adc_nids[2] = { 0x14, 0x15 }; |
1529 | #define CXT5051_SPDIF_OUT 0x1C | ||
1530 | #define CXT5051_PORTB_EVENT 0x38 | ||
1531 | #define CXT5051_PORTC_EVENT 0x39 | ||
1532 | 1637 | ||
1533 | static struct hda_channel_mode cxt5051_modes[1] = { | 1638 | static struct hda_channel_mode cxt5051_modes[1] = { |
1534 | { 2, NULL }, | 1639 | { 2, NULL }, |
@@ -1608,6 +1713,7 @@ static void cxt5051_hp_automute(struct hda_codec *codec) | |||
1608 | static void cxt5051_hp_unsol_event(struct hda_codec *codec, | 1713 | static void cxt5051_hp_unsol_event(struct hda_codec *codec, |
1609 | unsigned int res) | 1714 | unsigned int res) |
1610 | { | 1715 | { |
1716 | int nid = (res & AC_UNSOL_RES_SUBTAG) >> 20; | ||
1611 | switch (res >> 26) { | 1717 | switch (res >> 26) { |
1612 | case CONEXANT_HP_EVENT: | 1718 | case CONEXANT_HP_EVENT: |
1613 | cxt5051_hp_automute(codec); | 1719 | cxt5051_hp_automute(codec); |
@@ -1619,6 +1725,7 @@ static void cxt5051_hp_unsol_event(struct hda_codec *codec, | |||
1619 | cxt5051_portc_automic(codec); | 1725 | cxt5051_portc_automic(codec); |
1620 | break; | 1726 | break; |
1621 | } | 1727 | } |
1728 | conexant_report_jack(codec, nid); | ||
1622 | } | 1729 | } |
1623 | 1730 | ||
1624 | static struct snd_kcontrol_new cxt5051_mixers[] = { | 1731 | static struct snd_kcontrol_new cxt5051_mixers[] = { |
@@ -1693,6 +1800,7 @@ static struct hda_verb cxt5051_init_verbs[] = { | |||
1693 | static int cxt5051_init(struct hda_codec *codec) | 1800 | static int cxt5051_init(struct hda_codec *codec) |
1694 | { | 1801 | { |
1695 | conexant_init(codec); | 1802 | conexant_init(codec); |
1803 | conexant_init_jacks(codec); | ||
1696 | if (codec->patch_ops.unsol_event) { | 1804 | if (codec->patch_ops.unsol_event) { |
1697 | cxt5051_hp_automute(codec); | 1805 | cxt5051_hp_automute(codec); |
1698 | cxt5051_portb_automic(codec); | 1806 | cxt5051_portb_automic(codec); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0bd4e6bf354d..9065ebf9c065 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -8467,6 +8467,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
8467 | SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP), | 8467 | SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP), |
8468 | SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP), | 8468 | SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP), |
8469 | SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG), | 8469 | SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG), |
8470 | SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP), | ||
8470 | SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V), | 8471 | SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V), |
8471 | SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG), | 8472 | SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG), |
8472 | SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q), | 8473 | SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q), |
@@ -16638,9 +16639,9 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = { | |||
16638 | .patch = patch_alc882 }, /* should be patch_alc883() in future */ | 16639 | .patch = patch_alc882 }, /* should be patch_alc883() in future */ |
16639 | { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, | 16640 | { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, |
16640 | { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 }, | 16641 | { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 }, |
16641 | { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 }, | ||
16642 | { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", | 16642 | { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", |
16643 | .patch = patch_alc883 }, | 16643 | .patch = patch_alc883 }, |
16644 | { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 }, | ||
16644 | { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 }, | 16645 | { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 }, |
16645 | {} /* terminator */ | 16646 | {} /* terminator */ |
16646 | }; | 16647 | }; |
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); |