mt76x0: unify lna_gain parsing

Unify lna gain parsing with mt76x2 driver using eeprom utility
routines available in mt76x02-lib module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2018-09-21 18:05:35 +02:00
committed by Felix Fietkau
parent ba7a3da7c0
commit 35b0a2a474
5 changed files with 24 additions and 40 deletions
+5 -2
View File
@@ -28,13 +28,15 @@ struct reg_channel_bounds {
u8 num;
};
struct mt76x0_caldata {
s8 lna_gain;
};
struct mt76x0_eeprom_params {
u8 rf_freq_off;
s16 temp_off;
s8 rssi_offset_2ghz[2];
s8 rssi_offset_5ghz[3];
s8 lna_gain_2ghz;
s8 lna_gain_5ghz[3];
/* TX_PWR_CFG_* values from EEPROM for 20 and 40 Mhz bandwidths. */
u32 tx_pwr_cfg_2g[5][2];
@@ -44,6 +46,7 @@ struct mt76x0_eeprom_params {
};
int mt76x0_eeprom_init(struct mt76x0_dev *dev);
void mt76x0_read_rx_gain(struct mt76x0_dev *dev);
static inline u32 s6_validate(u32 reg)
{