mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
mt76x2: fix tx_alc_enabled check
Fix mt76x2_temp_tx_alc_enabled routine since in order to enable tx_alc
temperature compensation it necessary to take into account BIT(15) of
MT_EE_TX_POWER_EXT_PA_5G eeprom info
Fixes: 7bc04215a6
("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
cf7b411dce
commit
bcb0f68ae2
2 changed files with 7 additions and 5 deletions
|
@ -609,17 +609,13 @@ int mt76x2_get_temp_comp(struct mt76x2_dev *dev, struct mt76x2_temp_comp *t)
|
||||||
|
|
||||||
memset(t, 0, sizeof(*t));
|
memset(t, 0, sizeof(*t));
|
||||||
|
|
||||||
val = mt76x2_eeprom_get(dev, MT_EE_NIC_CONF_1);
|
if (!mt76x2_temp_tx_alc_enabled(dev))
|
||||||
if (!(val & MT_EE_NIC_CONF_1_TEMP_TX_ALC))
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!mt76x2_ext_pa_enabled(dev, band))
|
if (!mt76x2_ext_pa_enabled(dev, band))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
val = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_EXT_PA_5G) >> 8;
|
val = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_EXT_PA_5G) >> 8;
|
||||||
if (!(val & BIT(7)))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
t->temp_25_ref = val & 0x7f;
|
t->temp_25_ref = val & 0x7f;
|
||||||
if (band == NL80211_BAND_5GHZ) {
|
if (band == NL80211_BAND_5GHZ) {
|
||||||
slope = mt76x2_eeprom_get(dev, MT_EE_RF_TEMP_COMP_SLOPE_5G);
|
slope = mt76x2_eeprom_get(dev, MT_EE_RF_TEMP_COMP_SLOPE_5G);
|
||||||
|
|
|
@ -159,6 +159,12 @@ void mt76x2_read_rx_gain(struct mt76x2_dev *dev);
|
||||||
static inline bool
|
static inline bool
|
||||||
mt76x2_temp_tx_alc_enabled(struct mt76x2_dev *dev)
|
mt76x2_temp_tx_alc_enabled(struct mt76x2_dev *dev)
|
||||||
{
|
{
|
||||||
|
u16 val;
|
||||||
|
|
||||||
|
val = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_EXT_PA_5G);
|
||||||
|
if (!(val & BIT(15)))
|
||||||
|
return false;
|
||||||
|
|
||||||
return mt76x2_eeprom_get(dev, MT_EE_NIC_CONF_1) &
|
return mt76x2_eeprom_get(dev, MT_EE_NIC_CONF_1) &
|
||||||
MT_EE_NIC_CONF_1_TEMP_TX_ALC;
|
MT_EE_NIC_CONF_1_TEMP_TX_ALC;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue