developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 1 | From 7077356d80d23d074c2271e5d96697a8d02ad297 Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Thu, 13 Jul 2023 16:36:36 +0800 |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 034/223] mtk: mt76: mt7996: kite default 1-pcie setting |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | |
| 6 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 7 | --- |
| 8 | mt7996/pci.c | 11 +++++++++++ |
| 9 | 1 file changed, 11 insertions(+) |
| 10 | |
| 11 | diff --git a/mt7996/pci.c b/mt7996/pci.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 12 | index 04056181..05830c01 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 13 | --- 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 | -- |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 55 | 2.45.2 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 56 | |