mt76: mt7615: register ext_phy if DBDC is detected
authorShayne Chen <shayne.chen@mediatek.com>
Wed, 24 Jun 2020 09:39:37 +0000 (17:39 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 24 Sep 2020 16:10:12 +0000 (18:10 +0200)
MT_EE_WIFI_CONF field can be used to detect if the chipset is MT7615D.
Thus, add support to automatically register ext_phy if DBDC is detected.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c

index 22e4eab..f4756bb 100644 (file)
@@ -125,6 +125,9 @@ mt7615_eeprom_parse_hw_band_cap(struct mt7615_dev *dev)
        case MT_EE_2GHZ:
                dev->mt76.cap.has_2ghz = true;
                break;
+       case MT_EE_DBDC:
+               dev->dbdc_support = true;
+               /* fall through */
        default:
                dev->mt76.cap.has_2ghz = true;
                dev->mt76.cap.has_5ghz = true;
index 571eadc..e93f87a 100644 (file)
@@ -278,6 +278,7 @@ struct mt7615_dev {
 
        bool fw_debug;
        bool flash_eeprom;
+       bool dbdc_support;
 
        spinlock_t token_lock;
        struct idr token;
index 7224a00..06a0f8f 100644 (file)
@@ -25,6 +25,9 @@ static void mt7615_init_work(struct work_struct *work)
        mt7615_phy_init(dev);
        mt7615_mcu_del_wtbl_all(dev);
        mt7615_check_offload_capability(dev);
+
+       if (dev->dbdc_support)
+               mt7615_register_ext_phy(dev);
 }
 
 static int mt7615_init_hardware(struct mt7615_dev *dev)