Skip to content

Commit

Permalink
ALSA: usb-audio: Assume first control interface is for audio
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed Sep 2, 2010
1 parent 2bfc96a commit 7b6717e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/usb/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,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 */
Expand Down

0 comments on commit 7b6717e

Please sign in to comment.