aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-09-02 17:13:15 +0800
committerMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>2010-10-04 14:53:33 +0200
commit3c18353d9c82931c4f2591dfe932e10c3a869a49 (patch)
tree6fbb20dc2d38f0a8ab3cfe1f567e81aed5cf15da /sound
parent86ff6366c9351e8004ca259a93b0ff72bc73c726 (diff)
ALSA: usb-audio: Assume first control interface is for audio
commit 7b6717e144de6592e614fd7fc3b914b6bf686a9d upstream. For devices with more than one control interface, let's assume the first one contains the audio controls. Unfortunately, there is no field in any of the descriptors to tell us whether a control interface is for audio or MIDI controls, so a better check is not easy to implement. On a composite device with audio and MIDI functions, for example, the code currently overwrites chip->ctrl_intf, causing operations on the control interface to fail if they are issued after the device probe. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/card.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index d1924d71681..ceeba891845 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -466,7 +466,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
goto __error;
}
- chip->ctrl_intf = alts;
+ /*
+ * For devices with more than one control interface, we assume the
+ * first contains the audio controls. We might need a more specific
+ * check here in the future.
+ */
+ if (!chip->ctrl_intf)
+ chip->ctrl_intf = alts;
if (err > 0) {
/* create normal USB audio interfaces */