blob: 2bb751071c748dcbea44ddce67daba5429de4889 [file] [log] [blame]
developer9237f442024-06-14 17:13:04 +08001From 9d16189b29de2e3c2fb0daf7fe5238f489b26818 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Thu, 13 Jul 2023 16:36:36 +0800
developer9237f442024-06-14 17:13:04 +08004Subject: [PATCH 040/116] mtk: wifi: mt76: mt7996: kite default 1-pcie setting
developer66e89bc2024-04-23 14:50:01 +08005
6Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
7---
8 mt7996/pci.c | 11 +++++++++++
9 1 file changed, 11 insertions(+)
10
11diff --git a/mt7996/pci.c b/mt7996/pci.c
developer9237f442024-06-14 17:13:04 +080012index 0405618..05830c0 100644
developer66e89bc2024-04-23 14:50:01 +080013--- a/mt7996/pci.c
14+++ b/mt7996/pci.c
15@@ -11,6 +11,9 @@
16 #include "mac.h"
17 #include "../trace.h"
18
19+static bool hif2_enable = false;
20+module_param(hif2_enable, bool, 0644);
21+
22 static LIST_HEAD(hif_list);
23 static DEFINE_SPINLOCK(hif_lock);
24 static u32 hif_idx;
25@@ -63,6 +66,9 @@ static struct mt7996_hif *mt7996_pci_init_hif2(struct pci_dev *pdev)
26 {
27 hif_idx++;
28
29+ if (!hif2_enable)
30+ return NULL;
31+
32 if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7991, NULL) &&
33 !pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x799a, NULL))
34 return NULL;
35@@ -77,6 +83,9 @@ static int mt7996_pci_hif2_probe(struct pci_dev *pdev)
36 {
37 struct mt7996_hif *hif;
38
39+ if (!hif2_enable)
40+ return 0;
41+
42 hif = devm_kzalloc(&pdev->dev, sizeof(*hif), GFP_KERNEL);
43 if (!hif)
44 return -ENOMEM;
45@@ -101,6 +110,8 @@ static int mt7996_pci_probe(struct pci_dev *pdev,
46 int irq, hif2_irq, ret;
47 struct mt76_dev *mdev;
48
49+ hif2_enable |= (id->device == 0x7990 || id->device == 0x7991);
50+
51 ret = pcim_enable_device(pdev);
52 if (ret)
53 return ret;
54--
developer9237f442024-06-14 17:13:04 +0800552.18.0
developer66e89bc2024-04-23 14:50:01 +080056