Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp226796pxj; Thu, 13 May 2021 03:34:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypS1PQ0V1WrxSDfb3Q5PFOxFGu1GFhNwrw914Quwu9rZDr9aMcGRDsFA6JTpbcfKrCRho/ X-Received: by 2002:a17:906:f8d9:: with SMTP id lh25mr43108266ejb.88.1620902081787; Thu, 13 May 2021 03:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620902081; cv=none; d=google.com; s=arc-20160816; b=ZtdlQSRf2qtZp5ESTwozw8wo/Cx9LEJBv8qv7kFY5vFmwQAePcWo4IXYk4qutABobl XD2ZSCHcQqQuzdVpdmuEIDVgs99wIVYaRYAbJWcRV7GTUjKPwCoNDXDkC/FWidKktshP 7ZU/EhBv/c/3rAJMm7kt0gLrIydVNvgY6zZl9lYZj8wCy0BFKQwGNf5N2wz6A9VA7hIL r+4I7r/7T1TRzE8TsWy8zfoEv/p/pc1nxRJU6cK79C99rGI0+jQhEhEQRityVgwDAriE tmLGHTtBMTF282wXvKjf+u5MkchBYkBBuIQ8ctOiWgodL7/37gT+fCFnuiBPNrJvo30g 6YrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :authenticated-by; bh=1P1/g7sYNx2LLaShhqfX+xpNhWOWmnZabHHhmN1Ebg0=; b=KlxaUMPVu66kMO77hiKnyXToS00AKmJvcyi/o+1WtTrTbIjN2lbjisON1uCBOdkBEt VLkhvh8ytHHNfCrMOqbkGDYAqrAd6HGSzCO/OuEsP7apaIbhVc1d8Ml5idZ8IQizISeq FsSu9hr6r8NhJqZ/D+x3HNnCVCrobQ92tIYXs67wFtDQzMAVdSfjCHwp1Qo8qbgckRdc Fw2P/JgM+zWlIiusC0BA0fACQfzbsrp4HVqvs4nIKEtv9f26xftwYiMhk0T9p3HWBwOX l4vDnQ5EmIgoEMVtu1mZSqYXg8a5vi+/L30OqbUxgkyfND0awAybxTxIKSyw+6JNhtnH fxmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si2481067edv.573.2021.05.13.03.34.17; Thu, 13 May 2021 03:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbhEMKTh (ORCPT + 99 others); Thu, 13 May 2021 06:19:37 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:40073 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbhEMKT2 (ORCPT ); Thu, 13 May 2021 06:19:28 -0400 Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.73 with qID 14DAI8dzC016490, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36502.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.71/5.88) with ESMTPS id 14DAI8dzC016490 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 13 May 2021 18:18:08 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36502.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 13 May 2021 18:18:07 +0800 Received: from localhost.localdomain (172.21.132.99) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 13 May 2021 18:18:06 +0800 From: To: CC: , , , , , , Subject: [PATCH] Bluetooth: btusb: Add support USB ALT 3 for WBS Date: Thu, 13 May 2021 18:18:06 +0800 Message-ID: <20210513101806.5666-1-hildawu@realtek.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.132.99] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIxLzUvMTMgpFekyCAwNzo0MzowMA==?= X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-AntiSpam-Outbound-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 05/13/2021 09:53:57 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 10 X-KSE-AntiSpam-Info: Lua profiles 163629 [May 13 2021] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: hildawu@realtek.com X-KSE-AntiSpam-Info: LuaCore: 445 445 d5f7ae5578b0f01c45f955a2a751ac25953290c9 X-KSE-AntiSpam-Info: {Prob_from_in_msgid} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: realtek.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2 X-KSE-AntiSpam-Info: {Track_Chinese_Simplified, headers_charset} X-KSE-AntiSpam-Info: Rate: 10 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 05/13/2021 09:56:00 X-KSE-ServerInfo: RTEXH36502.realtek.com.tw, 9 X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-AntiSpam-Outbound-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 05/13/2021 10:04:01 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 10 X-KSE-AntiSpam-Info: Lua profiles 163631 [May 13 2021] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: hildawu@realtek.com X-KSE-AntiSpam-Info: LuaCore: 445 445 d5f7ae5578b0f01c45f955a2a751ac25953290c9 X-KSE-AntiSpam-Info: {Prob_from_in_msgid} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;realtek.com:7.1.1 X-KSE-AntiSpam-Info: Rate: 10 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 05/13/2021 10:07:00 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: hildawu Because mSBC frames do not need to be aligned to the SCO packet boundary. Using USB ALT 3 let HCI payload >= 60 bytes, let mSBC data satisfy 60 Bytes avoid payload unaligned situation and fixed some headset no voise issue. USB Alt 3 supported also need HFP support transparent MTU in 72 Bytes. Signed-off-by: hildawu --- drivers/bluetooth/btusb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 6f253378e893..872034e7a232 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1752,6 +1752,13 @@ static void btusb_work(struct work_struct *work) * which work with WBS at all. */ new_alts = btusb_find_altsetting(data, 6) ? 6 : 1; + /* Because mSBC frames do not need to be aligned to the + * SCO packet boundary. If support the Alt 3, use the + * Alt 3 for HCI payload >= 60 Bytes let air packet + * data satisfy 60 bytes. + */ + if ((new_alts == 1) && (btusb_find_altsetting(data, 3))) + new_alts = 3; } if (btusb_switch_alt_setting(hdev, new_alts) < 0) -- 2.17.1