diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-09-20 12:11:55 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-10-01 13:33:47 +0300 |
commit | 443569a534b2dcbd9b8248fc24aedab4ec1531da (patch) | |
tree | 1cf0ee828fc44d30dee0f3235d6a5a069a2776ca /drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c | |
parent | bd724b8f62792e0bf5e88d66fa9bdb6d02f9ed7e (diff) | |
download | linux-443569a534b2dcbd9b8248fc24aedab4ec1531da.tar.xz |
mt76: move mt76x2_ext_pa_enabled routine in mt76x02_eeprom.c
Move mt76x2_ext_pa_enabled utility routine in mt76x02_eeprom.c
and remove duplicated code. This is a preliminary patch to
unify eeprom code between mt76x2 and mt76x0 driver
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c index 21fe7eb0652d..edb08863e4ba 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c @@ -70,3 +70,14 @@ int mt76x02_get_efuse_data(struct mt76_dev *dev, u16 base, void *buf, return 0; } EXPORT_SYMBOL_GPL(mt76x02_get_efuse_data); + +bool mt76x02_ext_pa_enabled(struct mt76_dev *dev, enum nl80211_band band) +{ + u16 conf0 = mt76x02_eeprom_get(dev, MT_EE_NIC_CONF_0); + + if (band == NL80211_BAND_5GHZ) + return !(conf0 & MT_EE_NIC_CONF_0_PA_INT_5G); + else + return !(conf0 & MT_EE_NIC_CONF_0_PA_INT_2G); +} +EXPORT_SYMBOL_GPL(mt76x02_ext_pa_enabled); |