All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	ruslan.bilovol@gmail.com
Subject: [PATCH v2 3/4] ALSA: usb-audio: UAC3. Add insertion control for BADD.
Date: Thu, 14 Jun 2018 15:05:57 +0100	[thread overview]
Message-ID: <20180614140558.28277-4-jorge.sanjuan@codethink.co.uk> (raw)
In-Reply-To: <20180614140558.28277-1-jorge.sanjuan@codethink.co.uk>

The HEADSET ADAPTER profile for BADD devices is meant to support
Insertion Control for the Input and Output Terminals of the headset.

This patch defines the BADD inferred input and output terminals and
builds the connector controls.

Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
---
 sound/usb/mixer.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 34fef71e0330..03b8a2ac93c8 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2918,6 +2918,23 @@ static int snd_usb_mixer_controls_badd(struct usb_mixer_interface *mixer,
 				       UAC3_BADD_FU_ID7, map->map);
 	}
 
+	/* Insertion Control */
+	if (f->subclass == UAC3_FUNCTION_SUBCLASS_HEADSET_ADAPTER) {
+		struct usb_audio_term iterm, oterm;
+
+		/* Input Term - Insertion control */
+		memset(&iterm, 0, sizeof(iterm));
+		iterm.id = UAC3_BADD_IT_ID4;
+		iterm.type = UAC_BIDIR_TERMINAL_HEADSET;
+		build_connector_control(mixer, &iterm, true);
+
+		/* Output Term - Insertion control */
+		memset(&oterm, 0, sizeof(oterm));
+		oterm.id = UAC3_BADD_OT_ID3;
+		oterm.type = UAC_BIDIR_TERMINAL_HEADSET;
+		build_connector_control(mixer, &oterm, false);
+	}
+
 	return 0;
 }
 
-- 
2.11.0


  parent reply	other threads:[~2018-06-14 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 14:31 [PATCH 0/2] ALSA: usb-audio: Insertion Control for BADD Adaptors Jorge Sanjuan
2018-06-12 14:32 ` [PATCH 1/2] ALSA: usb-audio: Add bi-directional terminal types Jorge Sanjuan
2018-06-12 14:32 ` [PATCH 2/2] ALSA: usb-audio: UAC3. Add insertion control for BADD Jorge Sanjuan
2018-06-14 12:34   ` Takashi Iwai
2018-06-14 14:05 ` [PATCH v2 0/4] ALSA: usb-audio: Insertion Control for BADD Adaptors Jorge Sanjuan
2018-06-14 14:05   ` [PATCH v2 1/4] ALSA: usb-audio: Add bi-directional terminal types Jorge Sanjuan
2018-06-14 14:05   ` [PATCH v2 2/4] ALSA: usb-audio: Change in connectors control creation interface Jorge Sanjuan
2018-06-14 14:05   ` Jorge Sanjuan [this message]
2018-06-14 14:05   ` [PATCH v2 4/4] ALSA: usb-audio: Always create the interrupt pipe for the mixer Jorge Sanjuan
2018-06-14 16:07   ` [PATCH v2 0/4] ALSA: usb-audio: Insertion Control for BADD Adaptors Takashi Iwai
2018-06-14 19:18     ` Ruslan Bilovol
2018-06-14 20:12       ` 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=20180614140558.28277-4-jorge.sanjuan@codethink.co.uk \
    --to=jorge.sanjuan@codethink.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruslan.bilovol@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 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.