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