Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2043662imm; Thu, 14 Jun 2018 07:56:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI5a4z2DCG6Tnkuwt74ebpjFv2iEC5ZeltGif2ieB9Dx+3ho9SB5Gmoh3z476aVWcEDXL/b X-Received: by 2002:a17:902:581:: with SMTP id f1-v6mr3416501plf.48.1528988205766; Thu, 14 Jun 2018 07:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528988205; cv=none; d=google.com; s=arc-20160816; b=grsM9YnnyjQwzvdezaRR6qjLJwTMv4xNORlIAE7Ppho5mDOPAoaqFLpoZeXcRPnq1u 42M7C197dZRSI+8oaJjsIogqY87MwcHbv3nJ2V/QLE83pHqYE28BsED8kAMDen6oOtFV 3l9o4ib6V2z+/3ZZ8M/X26gS5f9RAkEPmxWRXD7afaL4ERAF2+CbPXUz82JfkcZ5+so/ Cdd84zCFk0qXvwZsRtd21h76whpbui7+ksGf9eKtJmzQmxhPo8j0RZIquOIy1D2nObhl StQ0Oz5nBwPzXtgWn6yRAAAFBExgjtMwsdnSDrOlx3/g4id/XSOWGXZuVecDVlJYojtW YdtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=dqPkU6x3zCvSfmKzNPGLufvhYhdvQfiexYKsDDLvKaw=; b=zW11FiZWUKNe60x/V4Inn7LIpIkOViWchqGXY+KmvFEw3rDCFzs7kK7lp/emcSZkIF eljDo2TPOxTtqL9Ix91teEioohfn+UjfbYPH2+8w+CNhSiju0UuUO2dAI3wDSTQS7BkT hhSMhmjAwdkJ04NeTWeh2iz5Tbijv69kPNhqgNyc0m/Sm4LaC7gma1bCzFs88IzNE9nc MipOxzDsYQ2ZUFA+pSxhX8aJV5fpHa6gearqjbyAKRpBruNf56Hlep6c+zA59xZPBx0x mQ4zM8MeZ3lLuFr4tjXaMbLzoqy5YivwcOyC/R5ugxyq19Bvak15EXwbxxStjv9WIQO4 99Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q72-v6si5340197pfi.183.2018.06.14.07.56.31; Thu, 14 Jun 2018 07:56:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936236AbeFNOGM (ORCPT + 99 others); Thu, 14 Jun 2018 10:06:12 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:36948 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936205AbeFNOGF (ORCPT ); Thu, 14 Jun 2018 10:06:05 -0400 Received: from [148.252.241.226] (helo=ct-lt-1121.office.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1fTSt0-0005OK-RP; Thu, 14 Jun 2018 15:06:02 +0100 From: Jorge Sanjuan 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 Message-Id: <20180614140558.28277-4-jorge.sanjuan@codethink.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180614140558.28277-1-jorge.sanjuan@codethink.co.uk> References: <20180612143201.29988-1-jorge.sanjuan@codethink.co.uk> <20180614140558.28277-1-jorge.sanjuan@codethink.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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