ALSA: usb-audio: work around Android accessory firmware bug
authorClemens Ladisch <clemens@ladisch.de>
Sat, 15 Jun 2013 09:21:09 +0000 (11:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jun 2013 18:27:30 +0000 (11:27 -0700)
commite02a738d98825abca64e4cd9fe1466df7a6e7d67
treee867e8af91cb454f40c47e2fe24f7743258d8b02
parent2dc07099dd09be589056fe538bb8a72a13af6afc
ALSA: usb-audio: work around Android accessory firmware bug

commit 342cda29343a6272c630f94ed56810a76740251b upstream.

When the Android firmware enables the audio interfaces in accessory
mode, it always declares in the control interface's baInterfaceNr array
that interfaces 0 and 1 belong to the audio function.  However, the
accessory interface itself, if also enabled, already is at index 0 and
shifts the actual audio interface numbers to 1 and 2, which prevents the
PCM streaming interface from being seen by the host driver.

To get the PCM interface interface to work, detect when the descriptors
point to the (for this driver useless) accessory interface, and redirect
to the correct one.

Reported-by: Jeremy Rosen <jeremy.rosen@openwide.fr>
Tested-by: Jeremy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/card.c