|
@@ -446,8 +446,9 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip,
|
|
|
const struct snd_usb_audio_quirk *quirk =
|
|
|
chip->usb_id == USB_ID(0x0582, 0x002b)
|
|
|
? &ua700_quirk : &uaxx_quirk;
|
|
|
- return snd_usbmidi_create(chip->card, iface,
|
|
|
- &chip->midi_list, quirk);
|
|
|
+ return __snd_usbmidi_create(chip->card, iface,
|
|
|
+ &chip->midi_list, quirk,
|
|
|
+ chip->usb_id);
|
|
|
}
|
|
|
|
|
|
if (altsd->bNumEndpoints != 1)
|
|
@@ -974,11 +975,9 @@ int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip,
|
|
|
|
|
|
int snd_usb_apply_boot_quirk(struct usb_device *dev,
|
|
|
struct usb_interface *intf,
|
|
|
- const struct snd_usb_audio_quirk *quirk)
|
|
|
+ const struct snd_usb_audio_quirk *quirk,
|
|
|
+ unsigned int id)
|
|
|
{
|
|
|
- u32 id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
|
|
|
- le16_to_cpu(dev->descriptor.idProduct));
|
|
|
-
|
|
|
switch (id) {
|
|
|
case USB_ID(0x041e, 0x3000):
|
|
|
/* SB Extigy needs special boot-up sequence */
|
|
@@ -1182,7 +1181,7 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
|
|
|
* "Playback Design" products send bogus feedback data at the start
|
|
|
* of the stream. Ignore them.
|
|
|
*/
|
|
|
- if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) &&
|
|
|
+ if (USB_ID_VENDOR(ep->chip->usb_id) == 0x23ba &&
|
|
|
ep->type == SND_USB_ENDPOINT_TYPE_SYNC)
|
|
|
ep->skip_packets = 4;
|
|
|
|
|
@@ -1201,11 +1200,15 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
|
|
|
|
|
|
void snd_usb_set_interface_quirk(struct usb_device *dev)
|
|
|
{
|
|
|
+ struct snd_usb_audio *chip = dev_get_drvdata(&dev->dev);
|
|
|
+
|
|
|
+ if (!chip)
|
|
|
+ return;
|
|
|
/*
|
|
|
* "Playback Design" products need a 50ms delay after setting the
|
|
|
* USB interface.
|
|
|
*/
|
|
|
- switch (le16_to_cpu(dev->descriptor.idVendor)) {
|
|
|
+ switch (USB_ID_VENDOR(chip->usb_id)) {
|
|
|
case 0x23ba: /* Playback Design */
|
|
|
case 0x0644: /* TEAC Corp. */
|
|
|
mdelay(50);
|
|
@@ -1213,15 +1216,20 @@ void snd_usb_set_interface_quirk(struct usb_device *dev)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/* quirk applied after snd_usb_ctl_msg(); not applied during boot quirks */
|
|
|
void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
|
|
|
__u8 request, __u8 requesttype, __u16 value,
|
|
|
__u16 index, void *data, __u16 size)
|
|
|
{
|
|
|
+ struct snd_usb_audio *chip = dev_get_drvdata(&dev->dev);
|
|
|
+
|
|
|
+ if (!chip)
|
|
|
+ return;
|
|
|
/*
|
|
|
* "Playback Design" products need a 20ms delay after each
|
|
|
* class compliant request
|
|
|
*/
|
|
|
- if ((le16_to_cpu(dev->descriptor.idVendor) == 0x23ba) &&
|
|
|
+ if (USB_ID_VENDOR(chip->usb_id) == 0x23ba &&
|
|
|
(requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
|
|
|
mdelay(20);
|
|
|
|
|
@@ -1229,23 +1237,21 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
|
|
|
* "TEAC Corp." products need a 20ms delay after each
|
|
|
* class compliant request
|
|
|
*/
|
|
|
- if ((le16_to_cpu(dev->descriptor.idVendor) == 0x0644) &&
|
|
|
+ if (USB_ID_VENDOR(chip->usb_id) == 0x0644 &&
|
|
|
(requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
|
|
|
mdelay(20);
|
|
|
|
|
|
/* Marantz/Denon devices with USB DAC functionality need a delay
|
|
|
* after each class compliant request
|
|
|
*/
|
|
|
- if (is_marantz_denon_dac(USB_ID(le16_to_cpu(dev->descriptor.idVendor),
|
|
|
- le16_to_cpu(dev->descriptor.idProduct)))
|
|
|
+ if (is_marantz_denon_dac(chip->usb_id)
|
|
|
&& (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
|
|
|
mdelay(20);
|
|
|
|
|
|
/* Zoom R16/24 needs a tiny delay here, otherwise requests like
|
|
|
* get/set frequency return as failed despite actually succeeding.
|
|
|
*/
|
|
|
- if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1686) &&
|
|
|
- (le16_to_cpu(dev->descriptor.idProduct) == 0x00dd) &&
|
|
|
+ if (chip->usb_id == USB_ID(0x1686, 0x00dd) &&
|
|
|
(requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
|
|
|
mdelay(1);
|
|
|
}
|
|
@@ -1262,7 +1268,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
|
|
|
unsigned int sample_bytes)
|
|
|
{
|
|
|
/* Playback Designs */
|
|
|
- if (le16_to_cpu(chip->dev->descriptor.idVendor) == 0x23ba) {
|
|
|
+ if (USB_ID_VENDOR(chip->usb_id) == 0x23ba) {
|
|
|
switch (fp->altsetting) {
|
|
|
case 1:
|
|
|
fp->dsd_dop = true;
|