blob: 46316e8d111d996f0053b1bdf088aae122ecb302 [file] [log] [blame]
developerd0c89452024-10-11 16:53:27 +08001From 7077356d80d23d074c2271e5d96697a8d02ad297 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
developerd0c89452024-10-11 16:53:27 +08004Subject: [PATCH 034/223] mtk: 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
developer05f3b2b2024-08-19 19:17:34 +080012index 04056181..05830c01 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--
developerd0c89452024-10-11 16:53:27 +0800552.45.2
developer66e89bc2024-04-23 14:50:01 +080056