public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Dave Helstroom <helstroom@google.com>
Cc: perex@perex.cz, tiwai@suse.de, eldad@fogrefinery.com,
	damien@zamaudio.com, pete.leigh@gmail.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RESEND] Add a USB audio quirk for the NuForce UDH-100 device.
Date: Mon, 11 Mar 2013 20:15:34 +0100	[thread overview]
Message-ID: <513E2D56.8070902@ladisch.de> (raw)
In-Reply-To: <CAOcFWma6fMqwqzMxFfCM7hOqk04FBk9JkKZjwekki_GFUR2jSQ@mail.gmail.com>

>> David Helstroom wrote:
>>> Interface 1 does not exist

Please try the patch below.


Regards,
Clemens


--8<---------------------------------------------------------------->8--
ALSA: usb-audio: add a workaround for the NuForce UDH-100

The NuForce UDH-100 numbers its interfaces incorrectly, which makes the
interface associations come out wrong, which results in the driver
erroring out with the message "Audio class v2 interfaces need an
interface association".

Work around this by searching for the interface association descriptor
also in some other place where it might have ended up.

Reported-by: Dave Helstroom <helstroom@google.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
 sound/usb/card.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index df2f6d0..34dc3e8 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -245,6 +245,21 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
 			usb_ifnum_to_if(dev, ctrlif)->intf_assoc;

 		if (!assoc) {
+			/*
+			 * Firmware writers cannot count to three.  So to find
+			 * the IAD on the NuForce UDH-100, also check the next
+			 * interface.
+			 */
+			struct usb_interface *iface =
+				usb_ifnum_to_if(dev, ctrlif + 1);
+			if (iface &&
+			    iface->intf_assoc &&
+			    iface->intf_assoc->bFunctionClass == USB_CLASS_AUDIO &&
+			    iface->intf_assoc->bFunctionProtocol == UAC_VERSION_2)
+				assoc = iface->intf_assoc;
+		}
+
+		if (!assoc) {
 			snd_printk(KERN_ERR "Audio class v2 interfaces need an interface association\n");
 			return -EINVAL;
 		}


  reply	other threads:[~2013-03-11 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11  3:52 [PATCH][RESEND] Add a USB audio quirk for the NuForce UDH-100 device David Helstroom
2013-03-11  8:32 ` Clemens Ladisch
2013-03-11 18:03   ` Dave Helstroom
2013-03-11 19:15     ` Clemens Ladisch [this message]
2013-03-11 23:58       ` Dave Helstroom
2013-03-12  7:36       ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=513E2D56.8070902@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=damien@zamaudio.com \
    --cc=eldad@fogrefinery.com \
    --cc=helstroom@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pete.leigh@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox