Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1854723pxk; Fri, 2 Oct 2020 23:42:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYYigj8KAebV5jGN7mYPm/ndRtU9aYM9ArrZ+rpbd0nEsET7BVy8QzMj2PFdNghdNQPu31 X-Received: by 2002:a05:6402:699:: with SMTP id f25mr6540877edy.372.1601707346882; Fri, 02 Oct 2020 23:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601707346; cv=none; d=google.com; s=arc-20160816; b=YEXfB09z3esYLa+GnEg1I5ICwrkeCRhQYnPfpq2+cS/bc6Khz1HFLeZbciSORFPEB8 XIl8xNG88A3BjJxZMuHrwJiUkNUedC11a8LO3Pxhdc22OMVy+xlyV2uoGquED1SXJoAL QYpLSdW88wYZy1+WFq9fvb8Rk9Zj7/GJexMoVkGIQZ++45OF7DCJF5uFczxCL1nTdJnV jaxjoyInlIEJRZOai3VenC+LNQlqfYuRCacWhvC1b5rf2bKHxYJ7OniO22spWaau4uCK cQMvgEX/UCgTTLJldJUz6APhAtrEE7hBSnOBCbRZaNoXxwaYmeJqPhUJi9w2wtKSU+IV mNkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=CRNyscLv6WqrL+hokqSXkg57Y/gqYqdQF0KBuPpJT2k=; b=gC3eYs4qgi5TowAh/5xNueTS0b67TN1EzWyLn/32NoDtmD0hrT0IDLiElXJ/j4kuUt aOCkb8h2AaBkuOD0FKY0iVwkaLB2Elyh01HuRkWuANijOYCoEucqUqZQzE7SS6aY/cHT v7epSmNhKqw+NZpQ/7AR3LWXsb0M+ob3y0w/QkCXg2jmCNnCv3TTXXIsNKStODYjfBJz OusvF39/AnE6YmqWBqsHcte0pGCIYbPZrhyP6QFOMyOcaL46xTUEtVO3UoC81TPRp6Hy s31BvBHKAJXn/Vo+LNgoYXb/PjdjFRyv7hrHWQ2YmQcUf6XqGjEfdcGExOAZsZLQeAYa 2ssg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 o14si1972009edq.11.2020.10.02.23.41.42; Fri, 02 Oct 2020 23:42:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725648AbgJCGlf convert rfc822-to-8bit (ORCPT + 99 others); Sat, 3 Oct 2020 02:41:35 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:53870 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgJCGle (ORCPT ); Sat, 3 Oct 2020 02:41:34 -0400 Received: from marcel-macbook.fritz.box (p4fefc7f4.dip0.t-ipconnect.de [79.239.199.244]) by mail.holtmann.org (Postfix) with ESMTPSA id 00601CECF8; Sat, 3 Oct 2020 08:48:32 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: [PATCH v4] Bluetooth: btintel: Add *setup* function for new generation Intel controllers From: Marcel Holtmann In-Reply-To: Date: Sat, 3 Oct 2020 08:41:32 +0200 Cc: Kiran K , "linux-bluetooth@vger.kernel.org" , Sathish Narasimman , Chethan T N , "Srivatsa, Ravishankar" , Kiran K , Amit K Bag , Raghuram Hegde Content-Transfer-Encoding: 8BIT Message-Id: <9E9FAF70-08C3-465A-98C5-2EBCBB50D699@holtmann.org> References: <1601621530-2803-1-git-send-email-kiran.k@intel.com> To: Luiz Augusto von Dentz X-Mailer: Apple Mail (2.3608.120.23.2.1) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz, >> Signed-off-by: Kiran K >> Signed-off-by: Amit K Bag >> Signed-off-by: Raghuram Hegde >> Reviewed-by: Sathish Narasimman >> Reviewed-by: Chethan T N >> Reviewed-by: Srivatsa Ravishankar >> --- >> drivers/bluetooth/btintel.h | 6 + >> drivers/bluetooth/btusb.c | 324 +++++++++++++++++++++++++++++++++++++++++++- >> 2 files changed, 328 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/bluetooth/btintel.h b/drivers/bluetooth/btintel.h >> index 09346ae..c4e28a8 100644 >> --- a/drivers/bluetooth/btintel.h >> +++ b/drivers/bluetooth/btintel.h >> @@ -132,6 +132,12 @@ struct intel_debug_features { >> __u8 page1[16]; >> } __packed; >> >> +#define INTEL_HW_PLATFORM(cnvx_bt) ((u8)(((cnvx_bt) & 0x0000ff00) >> 8)) >> +#define INTEL_HW_VARIANT(cnvx_bt) ((u8)(((cnvx_bt) & 0x003f0000) >> 16)) >> +#define INTEL_CNVX_TOP_TYPE(cnvx_top) ((cnvx_top) & 0x00000fff) >> +#define INTEL_CNVX_TOP_STEP(cnvx_top) (((cnvx_top) & 0x0f000000) >> 24) >> +#define INTEL_CNVX_TOP_PACK_SWAB(t, s) __swab16(((__u16)(((t) << 4) | (s)))) >> + >> #if IS_ENABLED(CONFIG_BT_INTEL) >> >> int btintel_check_bdaddr(struct hci_dev *hdev); >> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c >> index 1005b6e..5e51749 100644 >> --- a/drivers/bluetooth/btusb.c >> +++ b/drivers/bluetooth/btusb.c >> @@ -60,6 +60,7 @@ static struct usb_driver btusb_driver; >> #define BTUSB_WIDEBAND_SPEECH 0x400000 >> #define BTUSB_VALID_LE_STATES 0x800000 >> #define BTUSB_QCA_WCN6855 0x1000000 >> +#define BTUSB_INTEL_NEWGEN 0x2000000 > > I wonder if it is a good idea to keep adding such flags per model > here, it should be possible to pass the pid/vid so we don't have to > add generation after generation here. We agreed to first add the next gen controller as an independent setup method. And then later combine them into a single one that detects what version it is. We also need to unify it with our first generation ROM products. Regards Marcel