Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5991893pxb; Mon, 14 Feb 2022 12:35:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5jv12EvAwALnBARHYIk1Mgps8hyOAnSVmkLaQ+sdD5OCOqyhwGLdYN+OIgLkwG7FJOugP X-Received: by 2002:a17:902:bd81:: with SMTP id q1mr791490pls.100.1644870904014; Mon, 14 Feb 2022 12:35:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644870904; cv=none; d=google.com; s=arc-20160816; b=IQ9XKthIK1oDErmJMfqZINR4X2ItjtCxgGjg5K1j04i1UytNtZHQfs9ftav9d8N3T9 +k4H/9szusHbm0SaLMn1TMEWU2IJuwQzu4fNjBVZW7iWlS+2lWI2u5lR73In+RLOueu6 gyGkVmuqMBDRxs959qVlxTCfyg3B41BKQrCrgVXKnL3hYrWfnPNPshzLr6JqApGAJWW9 SjyqRGrkYOZkoga4YwJs43McDkdmeJgvTiy6zKq4iRFlFioViwfKvajXlGFJ28ppvXLg KgJn11rTKh5/EG374SljWv5c0ZNen1/Q+6H0amZV6D+GpsorBlnHDjJUuxobEkzoEIiM LWag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cUflCfcYoSUxJO5TUJi4PoJfITNLdxi+x4dGgrSRdpE=; b=oATXq7KjHRaTk82CzHSg8H6GRVGoHpYgLK5+Yba7IOErj8RnhPKxpUpng4wR9v/XnK v4V9fEr2zwCp4j9NvwC0rf4XvmQyGDbD6zy6ID8Oc9hLrRVDzj23ZCeKSMAm2/UidbSZ inx74IefJ91Sq4boocDvTUs9E9vvyXVB8EqrUZVtc3K9zvBPpea7L2SJnecUlCRriIxk J4/nYY93PTLlA6GQe7RGaPgcI1frHwjEovO6SAOI+UH+TGa7pyUrVfkiVyjeR5ZpmRaP z2dd4GE26h4jmeykweRlm9SRy6LTxfcQWWGKn4+ZMgGd/HGvaYZsWhZwHn8gl5sVyOgO /y+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w6hL5Tlw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k12si607794pgq.733.2022.02.14.12.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 12:35:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w6hL5Tlw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7FF781A0C27; Mon, 14 Feb 2022 12:04:37 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344773AbiBNJ42 (ORCPT + 99 others); Mon, 14 Feb 2022 04:56:28 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344883AbiBNJwF (ORCPT ); Mon, 14 Feb 2022 04:52:05 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F17947B556; Mon, 14 Feb 2022 01:43:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 90BA760FA2; Mon, 14 Feb 2022 09:43:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6192CC340E9; Mon, 14 Feb 2022 09:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831803; bh=FrmbRpw4yMtPFrZtcLJTy2zpIJYaSZTPwnuhF0NyZ0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w6hL5TlwbhbHEmkgFOhBzKYtyFNLGlHsyXbsVzJG0R+k8lZ0eihbtKsENE+g3CaiN IYWyCRnHr6CXBncveRk9keT9IhIdlA/ldwjjkEbo6IhCBGGirG2f7B4KdSnIZ+obFR 5qNotwNQjAwQCWec/s0Tx19n2XTVLTTXaB4I2m3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Hofman Subject: [PATCH 5.10 100/116] usb: gadget: f_uac2: Define specific wTerminalType Date: Mon, 14 Feb 2022 10:26:39 +0100 Message-Id: <20220214092502.237258595@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Hofman commit 5432184107cd0013761bdfa6cb6079527ef87b95 upstream. Several users have reported that their Win10 does not enumerate UAC2 gadget with the existing wTerminalType set to UAC_INPUT_TERMINAL_UNDEFINED/UAC_INPUT_TERMINAL_UNDEFINED, e.g. https://github.com/raspberrypi/linux/issues/4587#issuecomment-926567213. While the constant is officially defined by the USB terminal types document, e.g. XMOS firmware for UAC2 (commonly used for Win10) defines no undefined output terminal type in its usbaudio20.h header. Therefore wTerminalType of EP-IN is set to UAC_INPUT_TERMINAL_MICROPHONE and wTerminalType of EP-OUT to UAC_OUTPUT_TERMINAL_SPEAKER for the UAC2 gadget. Signed-off-by: Pavel Hofman Cc: stable Link: https://lore.kernel.org/r/20220131071813.7433-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_uac2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -176,7 +176,7 @@ static struct uac2_input_terminal_descri .bDescriptorSubtype = UAC_INPUT_TERMINAL, /* .bTerminalID = DYNAMIC */ - .wTerminalType = cpu_to_le16(UAC_INPUT_TERMINAL_UNDEFINED), + .wTerminalType = cpu_to_le16(UAC_INPUT_TERMINAL_MICROPHONE), .bAssocTerminal = 0, /* .bCSourceID = DYNAMIC */ .iChannelNames = 0, @@ -204,7 +204,7 @@ static struct uac2_output_terminal_descr .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, /* .bTerminalID = DYNAMIC */ - .wTerminalType = cpu_to_le16(UAC_OUTPUT_TERMINAL_UNDEFINED), + .wTerminalType = cpu_to_le16(UAC_OUTPUT_TERMINAL_SPEAKER), .bAssocTerminal = 0, /* .bSourceID = DYNAMIC */ /* .bCSourceID = DYNAMIC */