Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp709572pxv; Thu, 15 Jul 2021 14:06:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1G8/KJja7tI88s4FKgteZSGzzD8ulvCHAsuLSvS77u09Ot0Q9tlAyr3DsJCJ69BNir7ej X-Received: by 2002:a50:ee0b:: with SMTP id g11mr1889361eds.332.1626383196337; Thu, 15 Jul 2021 14:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383196; cv=none; d=google.com; s=arc-20160816; b=INOqnyxo4GY1n/06nKiXN4+asRCWUNDkfaQEI5YzdczSYH52OIitMNOkxsRI7dR0Ks O9XgNHQ2V9+mjXsYjOEjusBtznAppzshnP0lM71Oh+dxTO8PnrJ+BD3P1Uf5yUZLDemi 9Ize6NmSZ4XpCiwCCW41Us3mtbyhBpGrCCpHaUrKAy330D36oq+H0N+qyLQ5FZ/r57uX fl8M/f6s+TwlkySRb5b4zqUSzpy3kBWN+K5JsUzXSFomzqKRX2YvRuqaX1yVwBSm6Vjb 6F0jR4ZVumr3gZc+rqAzH05ZVdN9BDqdmG0vK7JJh2f8DxmVfY4tDEu1Sh2m8IaCiWSz Q6tw== 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=PsRkZRA4QctGcBP2y7PfFsQOxJaPYwfW6I4CDssvZ20=; b=LgOTgqxffidTanE/2NP9sSHYCPsog3Zh2bW8VOtNoYLmIFHIiiD9DnlfZuUH9KeU95 IS9dPU0OKfre2HxCH4x8geS4273jiMVkvhR+QDu6D2YZivVQZbnVlF+YJYzhW5YTl00e SVvq4rqNjYY2diMKvdOshW84yAGCiM15XeFqblTWFU/QOYvmUrmmq9DozFj+i/HwKwja xCa9uyl0EY+KDAwwJRG66Y8VhD22hrn8hoPkeIrbnbH8y95X6MbnpGsfsScSabvGthjH /kD4Wb/fquD/FrRjyAAd0IRjF8j8gu650kdbBvjK1KOlLmRh2tY6sDYq5l9rem02xL2Z qcIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NbkxqCoX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si8392869ejk.196.2021.07.15.14.06.13; Thu, 15 Jul 2021 14:06:36 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NbkxqCoX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244526AbhGOTQk (ORCPT + 99 others); Thu, 15 Jul 2021 15:16:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:39764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239126AbhGOTDS (ORCPT ); Thu, 15 Jul 2021 15:03:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E896613C0; Thu, 15 Jul 2021 18:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375569; bh=2Kz9zqhvZs7yyv5qURt+mojxP6fondb6dFl4+uvaN0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbkxqCoXYQTU6XTa1bigiuXSWUIwbedQDQYE4dK8uF/vd9edYAnWrUUqWEkuwZNl2 9Df/XWAsKewd73RRwffMC2KtgJ0u3M3U/DHRAFE3mi65siN7f7OQGQ8BCdRlvZS5ZR UUUkgxv7RpHnjtl61NzEvTMaWuGuykiSirP40zxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hilda Wu , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.12 142/242] Bluetooth: btusb: Add support USB ALT 3 for WBS Date: Thu, 15 Jul 2021 20:38:24 +0200 Message-Id: <20210715182618.110743359@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hilda Wu [ Upstream commit e848dbd364aca44c9d23c04bef964fab79e2b34f ] 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: Hilda Wu Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btusb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 12f05093c46d..ec17772defc2 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1749,6 +1749,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.30.2