Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3714791pxb; Mon, 24 Jan 2022 16:08:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJylRZgCg0Ot5sYXRci4ixNvCYiqOEqeYPOoVo2/aT5Zl5FiUIsm5dn2/P2kBtY6wDxETxSf X-Received: by 2002:a65:578b:: with SMTP id b11mr5406560pgr.318.1643069298510; Mon, 24 Jan 2022 16:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069298; cv=none; d=google.com; s=arc-20160816; b=vK79OWENy4C5IhjTgrs5axKI1nBVBYjVHXaBfR3YZ7l8jKHat35iWriR304Z1keAdv AMdtgkhu5YExjSe17e+TUwJ4GObEKZD0CCq92dLCQpxSIk/vl3E4IZL6lw9B4P3ouQtA XbYLV0gTI8BiQHOfuzFuFhYUyYWPUkW1MsekNR08itf+HyhFlXXkhFIeb2oQSL6DV3vz VkrUonGbG9ktcZTh4I9Z6ff5Zx7wcrEfdgewLrvfH8/kRbPBflDtMj2s6GadMpFOErUJ xlT12xv49AKabfx9ebe1OC28GeKFww2TDzqAQ+ub3fIvoEK4kcMSt6v4qBPKOxLYPEKi m/KA== 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=IgYbRpbPQTvjeoIMUZdDDctRnAfuq+g6+0tfZmklBfU=; b=zyzRb9kpkLT/I0Z+9zPFptrEXQNFQZ7IF0WsagAY7gW+WCfg3MwLY+aqI+dNOD1ZKc 39pDfKv7Ab2VQzxdAfuIxPoCzr6CJ1ZARZ6VbfLPhAjaQvAvEhv6L/JH5BLTHi31EdM/ mEjRyENnZxWOgaMyPKN1JfPaczRou/Gbuwu5pPrjhdZ22Fs5ndoRQPWnXWYxxs+wwUJj 2hOIktp7jZVSmMBSOonOKp+QaezR6M9WPHJiD/5ISWlojuOGR5TIQcMRmEypwmquJzVw DshdV4MlRj3qOh6S0bL1Esr9QBY8ImNgJ85/A2HPcdIVoCOATWQ4EtjuBXjBTVmIvWm3 kFmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jTuBxhcb; 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 d9si4084142pgd.403.2022.01.24.16.08.05; Mon, 24 Jan 2022 16:08:18 -0800 (PST) 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=jTuBxhcb; 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 S2368836AbiAYAAM (ORCPT + 99 others); Mon, 24 Jan 2022 19:00:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1847701AbiAXXUX (ORCPT ); Mon, 24 Jan 2022 18:20:23 -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 AC4CCC028BE4; Mon, 24 Jan 2022 13:28:31 -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 4996D614DD; Mon, 24 Jan 2022 21:28:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DA93C340E5; Mon, 24 Jan 2022 21:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059710; bh=S3oWCTD/UPBgHiBeKcRHNlnH9qKO6/9FriHWj32grDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jTuBxhcbIv9cIuCyHfTebxWS5HhMnY88IoQhs/NwHmdeDAXwZZFLpadRSvHZFhf43 1piDxRoY4aNWOCCWiJsTAFzt9E45qILz1lvyT/F2QZ193YUz1F00g9DR5O5E0R44TG itFjqPp6DyfwwQ9D5YDwIJ6k4wiEkT9NdxeWIquI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tedd Ho-Jeong An , Luiz Augusto von Dentz , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.16 0690/1039] Bluetooth: btintel: Add missing quirks and msft ext for legacy bootloader Date: Mon, 24 Jan 2022 19:41:19 +0100 Message-Id: <20220124184148.539751242@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Tedd Ho-Jeong An [ Upstream commit 3547a008c8962df2175db1e78b80f27e027ec549 ] This patch add missing HCI quirks and MSFT extension for legacy bootloader when it is running in the operational firmware. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btintel.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index b11567b0fd9ab..851a0c9b8fae5 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -2493,10 +2493,14 @@ static int btintel_setup_combined(struct hci_dev *hdev) case 0x12: /* ThP */ case 0x13: /* HrP */ case 0x14: /* CcP */ - /* Some legacy bootloader devices from JfP supports both old - * and TLV based HCI_Intel_Read_Version command. But we don't - * want to use the TLV based setup routines for those legacy - * bootloader device. + /* Some legacy bootloader devices starting from JfP, + * the operational firmware supports both old and TLV based + * HCI_Intel_Read_Version command based on the command + * parameter. + * + * For upgrading firmware case, the TLV based version cannot + * be used because the firmware filename for legacy bootloader + * is based on the old format. * * Also, it is not easy to convert TLV based version from the * legacy version format. @@ -2508,6 +2512,20 @@ static int btintel_setup_combined(struct hci_dev *hdev) err = btintel_read_version(hdev, &ver); if (err) return err; + + /* Apply the device specific HCI quirks + * + * All Legacy bootloader devices support WBS + */ + set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); + + /* Valid LE States quirk for JfP/ThP familiy */ + if (ver.hw_variant == 0x11 || ver.hw_variant == 0x12) + set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); + + /* Setup MSFT Extension support */ + btintel_set_msft_opcode(hdev, ver.hw_variant); + err = btintel_bootloader_setup(hdev, &ver); break; case 0x17: -- 2.34.1