mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
Merge branch 'fix/usb-audio' into for-linus
* fix/usb-audio: sound: usb-audio: add workaround for Blue Microphones devices
This commit is contained in:
commit
15c2ac051c
1 changed files with 13 additions and 1 deletions
|
@ -2661,7 +2661,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
|
||||||
struct usb_interface_descriptor *altsd;
|
struct usb_interface_descriptor *altsd;
|
||||||
int i, altno, err, stream;
|
int i, altno, err, stream;
|
||||||
int format;
|
int format;
|
||||||
struct audioformat *fp;
|
struct audioformat *fp = NULL;
|
||||||
unsigned char *fmt, *csep;
|
unsigned char *fmt, *csep;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
|
@ -2734,6 +2734,18 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Blue Microphones workaround: The last altsetting is identical
|
||||||
|
* with the previous one, except for a larger packet size, but
|
||||||
|
* is actually a mislabeled two-channel setting; ignore it.
|
||||||
|
*/
|
||||||
|
if (fmt[4] == 1 && fmt[5] == 2 && altno == 2 && num == 3 &&
|
||||||
|
fp && fp->altsetting == 1 && fp->channels == 1 &&
|
||||||
|
fp->format == SNDRV_PCM_FORMAT_S16_LE &&
|
||||||
|
le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) ==
|
||||||
|
fp->maxpacksize * 2)
|
||||||
|
continue;
|
||||||
|
|
||||||
csep = snd_usb_find_desc(alts->endpoint[0].extra, alts->endpoint[0].extralen, NULL, USB_DT_CS_ENDPOINT);
|
csep = snd_usb_find_desc(alts->endpoint[0].extra, alts->endpoint[0].extralen, NULL, USB_DT_CS_ENDPOINT);
|
||||||
/* Creamware Noah has this descriptor after the 2nd endpoint */
|
/* Creamware Noah has this descriptor after the 2nd endpoint */
|
||||||
if (!csep && altsd->bNumEndpoints >= 2)
|
if (!csep && altsd->bNumEndpoints >= 2)
|
||||||
|
|
Loading…
Reference in a new issue