developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 1 | From c0b68dfc03ee90fde9ebacc07db8f3c186846dd5 Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Thu, 13 Jul 2023 16:36:36 +0800 |
| 4 | Subject: [PATCH 1027/1041] mtk: wifi: mt76: mt7996: kite default 1-pcie |
| 5 | setting |
| 6 | |
| 7 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 8 | --- |
| 9 | mt7996/pci.c | 11 +++++++++++ |
| 10 | 1 file changed, 11 insertions(+) |
| 11 | |
| 12 | diff --git a/mt7996/pci.c b/mt7996/pci.c |
| 13 | index 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 | -- |
| 56 | 2.18.0 |
| 57 | |