All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Johan Rastén" <johan@oljud.se>
To: alsa-devel@alsa-project.org
Cc: "Johan Rastén" <johan@oljud.se>
Subject: [PATCH] usb-audio: Set the Control Selector to SU_SELECTOR_CONTROL for UAC2
Date: Mon, 17 Nov 2014 08:39:33 +0100	[thread overview]
Message-ID: <1416209973-7773-1-git-send-email-johan@oljud.se> (raw)

Specified in section 5.2.5.6.1 of the USB Audio Class 2.0 definition.

Solves the following error for C-Media 6632A (Asus Xonar U7):
[ 8219.676164] cannot get ctl value: req = 0x81, wValue = 0x0, wIndex = 0x1400, type = 3

Signed-off-by: Johan Rastén <johan@oljud.se>
---
 sound/usb/mixer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 14e1455..c6209ce 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2032,10 +2032,11 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid,
 	cval->res = 1;
 	cval->initialized = 1;
 
-	if (desc->bDescriptorSubtype == UAC2_CLOCK_SELECTOR)
-		cval->control = UAC2_CX_CLOCK_SELECTOR;
-	else
+	if (state->mixer->protocol == UAC_VERSION_1)
 		cval->control = 0;
+	else /* UAC_VERSION_2 */
+		cval->control = (desc->bDescriptorSubtype == UAC2_CLOCK_SELECTOR) ?
+			UAC2_CX_CLOCK_SELECTOR : UAC2_SU_SELECTOR;
 
 	namelist = kmalloc(sizeof(char *) * desc->bNrInPins, GFP_KERNEL);
 	if (!namelist) {
-- 
2.1.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2014-11-17  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  7:39 Johan Rastén [this message]
2014-11-17 13:04 ` [PATCH] usb-audio: Set the Control Selector to SU_SELECTOR_CONTROL for UAC2 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=1416209973-7773-1-git-send-email-johan@oljud.se \
    --to=johan@oljud.se \
    --cc=alsa-devel@alsa-project.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.