Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2689165pxb; Fri, 5 Nov 2021 03:04:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMiyhXyzeYG90SgLfkK+bE+gLXysi7A4Tero0JiZWFlgci2cFF//X+K6h5+l4HsK2w4uSV X-Received: by 2002:a17:906:8cd:: with SMTP id o13mr72774369eje.341.1636106668103; Fri, 05 Nov 2021 03:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636106668; cv=none; d=google.com; s=arc-20160816; b=kNtP/T0VsEiJk4ImAch9H+V+WhF84ah5Zdcm4tbBAVW5RdOUwDDK3/tH9Ci23su8mb lJf8lVgY+3exoLF2y27ppmSy6pmeseYzIa0Rs+iUSF6xW1DxibJK4vtbwfMpIjmUoYpD stPDUhshLPzSYUucpReRGaE8Tw4tlNhUn8pnMe5uOuvWZZZHDSElYlL48T/jCJhSB/uv wIZNPEam5mSmWVqh9eEBz56Zs3qMbsM+UkemU0KKhYa+3mzMH9GR+2h8DO9pBjhyTMXS 9KJb0cOguDHcDhBSFsQu4hf5vZYMF26Sm8a2eA0sf1P+JMAFBxqwBB/ZFR8FdzL2Uqrr oRRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6B4JqCn1CH/E/ZvnSMhhwhr6S5iYi+I9IHS1gLU/3T4=; b=xt4DK18SvFHFCHotN0GE9mtZCG3Qw71LQ6T60llAygpGlvlT04rKpy9VjMJQhNCBVi n6wNs6gKVykaWpcs0c40gNuqrG9ZQ/s15kbfF7/xLSSnuBNcpEsNlD97Jr1wwXlGJu1O ClvmLfFqe3U80cYAmWvBBW1Gur2oleuMefE5ZrR928nhAGdHl5m3XdjdfFz8zkM1N7kn myJ64rDjLCIvu0kP+ykTd/AdCvnbokdRLWrANIl6hAqG5lYSt3YmN5J1xOqxqMW37P4f MaYnb1+3ColIvcUc0Mi/26KDHX/sv3qrcMr0WTGJP4tRO9dH9F/JXBcYThGMUuca5SUj E1Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qw39si15229632ejc.73.2021.11.05.03.04.11; Fri, 05 Nov 2021 03:04:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233058AbhKEKFJ (ORCPT + 67 others); Fri, 5 Nov 2021 06:05:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:54494 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233046AbhKEKFH (ORCPT ); Fri, 5 Nov 2021 06:05:07 -0400 X-UUID: a56436409cfd4984abc8b6cb11e18c02-20211105 X-UUID: a56436409cfd4984abc8b6cb11e18c02-20211105 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1599280687; Fri, 05 Nov 2021 18:02:27 +0800 Received: from MTKMBS34N1.mediatek.inc (172.27.4.172) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 5 Nov 2021 18:02:25 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS34N1.mediatek.inc (172.27.4.172) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 5 Nov 2021 18:02:19 +0800 Received: from mcddlt001.gcn.mediatek.inc (10.19.240.15) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 5 Nov 2021 18:02:19 +0800 From: Bo Jiao To: Felix Fietkau CC: linux-wireless , Ryder Lee , Xing Song , Sujuan Chen , Shayne Chen , "Evelyn Tsai" , linux-mediatek , Bo Jiao Subject: [PATCH v2 11/11] mt76: mt7915: add device id for mt7916 Date: Fri, 5 Nov 2021 18:02:10 +0800 Message-ID: <41cf3dab18241e27d64ae5a579c391a1af58f7a3.1636105953.git.Bo.Jiao@mediatek.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Bo Jiao Add pci_device_id to enable mt7916. Note that MT_HW_CHIPID is no longer used for further chips, so drop it accordingly. Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Bo Jiao --- drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/pci.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c index 7ba5b1f..d463b3c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c @@ -534,7 +534,7 @@ static int mt7915_mmio_init(struct mt76_dev *mdev, bus_ops->rmw = mt7915_rmw; dev->mt76.bus = bus_ops; - mdev->rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) | + mdev->rev = (device_id << 16) | (mt76_rr(dev, MT_HW_REV) & 0xff); dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c index 3134b46..8d1a811 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c @@ -18,11 +18,13 @@ static u32 hif_idx; static const struct pci_device_id mt7915_pci_device_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7915) }, + { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7906) }, { }, }; static const struct pci_device_id mt7915_hif_device_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7916) }, + { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x790a) }, { }, }; @@ -61,7 +63,8 @@ static void mt7915_put_hif2(struct mt7915_hif *hif) static struct mt7915_hif *mt7915_pci_init_hif2(struct pci_dev *pdev) { hif_idx++; - if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7916, NULL)) + if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7916, NULL) && + !pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x790a, NULL)) return NULL; writel(hif_idx | MT_PCIE_RECOG_ID_SEM, @@ -112,7 +115,7 @@ static int mt7915_pci_probe(struct pci_dev *pdev, mt76_pci_disable_aspm(pdev); - if (id->device == 0x7916) + if (id->device == 0x7916 || id->device == 0x790a) return mt7915_pci_hif2_probe(pdev); ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); -- 2.18.0