login
Header Space

 
 

usb audio: Fix another Dallas quirk

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <perex@...>, kernel list <linux-kernel@...>, <tiwai@...>
Date: Saturday, March 29, 2008 - 6:32 pm

Dallas USB speakers are buggy in more than one way. One of configs
they offer does not work at all.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 257a4e1..b6b2490 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
 	int format;
 	struct audioformat *fp;
 	unsigned char *fmt, *csep;
+	int num;
 
 	dev = chip->dev;
 
 	/* parse the interface's altsettings */
 	iface = usb_ifnum_to_if(dev, iface_no);
-	for (i = 0; i < iface->num_altsetting; i++) {
+	num = iface->num_altsetting;
+
+	/* Dallas DS4201 workaround: It presents 5 altsettings, but the last
+	   one misses syncpipe, and does not produce any sound. */
+	if (chip->usb_id == USB_ID(0x04fa, 0x4201))
+		num = 4;
+	
+	for (i = 0; i < num; i++) {
 		alts = &iface->altsetting[i];
 		altsd = get_iface_desc(alts);
 		/* skip invalid one */

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
usb audio: Fix another Dallas quirk, Pavel Machek, (Sat Mar 29, 6:32 pm)
Re: usb audio: Fix another Dallas quirk, Takashi Iwai, (Mon Apr 14, 6:21 am)
Re: usb audio: Fix another Dallas quirk, Pavel Machek, (Mon Apr 14, 6:47 am)
Re: usb audio: Fix another Dallas quirk, Andrew Morton, (Tue Apr 1, 3:20 pm)
Re: usb audio: Fix another Dallas quirk, Pavel Machek, (Wed Apr 2, 8:49 am)
speck-geostationary