blob: 63210bf8e25419ee3bdd28043fde6e1ab3c40b8c [file] [log] [blame]
developer1f55fcf2024-10-17 14:52:33 +08001From 3d999c0abf75d54f412befbf0247219e796e1bef 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
developer1f55fcf2024-10-17 14:52:33 +08004Subject: [PATCH 034/193] 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
developer1f55fcf2024-10-17 14:52:33 +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--
developerd0c89452024-10-11 16:53:27 +0800552.45.2
developer66e89bc2024-04-23 14:50:01 +080056