Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp659319pxv; Thu, 15 Jul 2021 12:44:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnN3BA84xQXAobedu4YX/ZyZhTFeJPVW14NTxY6ASPX18A+NY4jfdT+sgt03byrfo8inC0 X-Received: by 2002:a17:906:9c84:: with SMTP id fj4mr6916970ejc.180.1626378245061; Thu, 15 Jul 2021 12:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378245; cv=none; d=google.com; s=arc-20160816; b=NN19XLpKHkqmPQyI/keyKSVxJEd4rRE2Jzd9TIBG8BmK3K07AR+GYFF0Yhhv1TcnLX Q6oxZzVBwUQA+PXU5NUKYDlOMikBhVqOB/5RJPf64AdQ86j24ingfpkQkqkjVz2Zmlyi sA4kPVrumEQCLTEic5Ah+Tc60Mc3wbUO/JSPMNz9OoMnCC4/FUhjMAO2I8w4b8lt8dTN m/9Ps86c2jx+LF3iu1NEGZMxhVda6Se/yay/cuAlEXXMe3ixuvgnD/JGhbA/NLBhbpaD ukn5Ta3TUbmv2oF7uSKkOpeLd3K7rkCcy/+G5/xDWwIRWS6tQpXhgrEFn4mCsWoZdl2S 3vrg== 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=9/rRvTgKxGKBTt9DwW1wYz3GaPiqNpiTnlDP0Spvs24=; b=mNwqZq/oIXf75gB13CppbQ7POvF2bWk0kMetjZH9L9M7krZRit8BNgO7yTEbSObTer hMqeQOuUIr0sIksL5GJopq0rol0SOCceFVu5srVjkwOuDL2k02+uJYWpKF7va44uBMhb D4yCMPmKwpxeUfoCsxwvjoEN3sI1fZtwLE7yd5OqQ/qPd06x3xzDt3lT+yp/r4mqeMY0 EI7MbmOn6Jvb8W8dTIlp/ytOVod0pkrSRZcxbiHXP8Ac7kU9IKquO/GJrindl2KDWZyq Qjv4Jl9wzgYzrSvRvrvUS9AcNu8RRfdyhf3Z4mAcCbjYqNQ/whREzDAjGLw3Yc6k9+bL MYXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jhad0xc2; 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 l4si8712983edc.31.2021.07.15.12.43.42; Thu, 15 Jul 2021 12:44:05 -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=jhad0xc2; 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 S1344822AbhGOToi (ORCPT + 99 others); Thu, 15 Jul 2021 15:44:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:51020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244828AbhGOTPQ (ORCPT ); Thu, 15 Jul 2021 15:15:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D5DE61412; Thu, 15 Jul 2021 19:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376288; bh=eKX49emukDMwE44pP/xuqP89fE1fH4GYou94kjiKakc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jhad0xc2jlIcHPl95wVQ1UgRA/sQD6Ks5BAVpotvlp42sXg0EGRcHTy1boE4/cqCQ 0TWtYSWozNIP8C8AxLE2QrirGroBmwmx0KZT37m548vfvROxuRhmrt3MrDQ/qO+DHZ D91UeZ6harnRKiQ7xMSOVbWF6e5Nkb60MKE4C2ts= 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.13 165/266] Bluetooth: btusb: Add support USB ALT 3 for WBS Date: Thu, 15 Jul 2021 20:38:40 +0200 Message-Id: <20210715182641.680914783@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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 90872099d9c3..4c18a85a1070 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1751,6 +1751,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