[PATCH] [UBUNTU:sound/usb/] Add workaround for CSR Bluetooth Headphones

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Fri Jun 2 21:15:59 UTC 2006


Subject: [PATCH] [UBUNTU:sound/usb/] Add workaround for CSR Bluetooth Headphones

UpstreamStatus: Added in upstream alsa-kernel hg changeset 85fb000cdfb8
                and d7283e927187,
                http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=85fb000cdfb8b42dabec8cb9af2e75d37ea32318;style=raw
                http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=d7283e9271870635035771a12da39f8a67b3da5f;style=raw

Some devices don't have the required class-specific endpoint
descriptors. Instead of making this case an error, this patch makes the
driver guess the endpoint attributes.

Fix a typo introduced by the above fix.

From Clemens Ladisch.

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>

---

 sound/usb/usbaudio.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

62253749fc76c9d088f1ecd8fa5ff938ffaec161
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index aa8745c..f983b5f 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2616,9 +2616,10 @@ static int parse_audio_endpoints(snd_usb
 		if (!csep && altsd->bNumEndpoints >= 2)
 			csep = snd_usb_find_desc(alts->endpoint[1].extra, alts->endpoint[1].extralen, NULL, USB_DT_CS_ENDPOINT);
 		if (!csep || csep[0] < 7 || csep[2] != EP_GENERAL) {
-			snd_printk(KERN_ERR "%d:%u:%d : no or invalid class specific endpoint descriptor\n",
+			snd_printk(KERN_WARNING "%d:%u:%d : no or invalid"
+				   " class specific endpoint descriptor\n",
 				   dev->devnum, iface_no, altno);
-			continue;
+			csep = NULL;
 		}
 
 		fp = kmalloc(sizeof(*fp), GFP_KERNEL);
@@ -2637,7 +2638,7 @@ static int parse_audio_endpoints(snd_usb
 		if (snd_usb_get_speed(dev) == USB_SPEED_HIGH)
 			fp->maxpacksize = (((fp->maxpacksize >> 11) & 3) + 1)
 					* (fp->maxpacksize & 0x7ff);
-		fp->attributes = csep[3];
+		fp->attributes = csep ? csep[3] : 0;
 
 		/* some quirks for attributes here */
 
-- 
1.1.3


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:   www.sh.nu/~crimsun/pubkey.gpg.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060602/2d9e325a/attachment.pgp>


More information about the kernel-team mailing list