Commit 7d7dc538 authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Kalle Valo

ath9k: replace eeprom_param EEP_MINOR_REV with get_eeprom_rev

get_eeprom(ah, EEP_MINOR_REV) and get_eeprom_rev(ah) are both doing the
same thing: returning the EEPROM revision (12 lowest bits). Make the
code consistent by using get_eeprom_rev(ah) everywhere.
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent d8ec2e2a
...@@ -524,7 +524,7 @@ static bool ar5008_hw_set_rf_regs(struct ath_hw *ah, ...@@ -524,7 +524,7 @@ static bool ar5008_hw_set_rf_regs(struct ath_hw *ah,
return true; return true;
/* Setup rf parameters */ /* Setup rf parameters */
eepMinorRev = ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV); eepMinorRev = ah->eep_ops->get_eeprom_rev(ah);
for (i = 0; i < ah->iniBank6.ia_rows; i++) for (i = 0; i < ah->iniBank6.ia_rows; i++)
ah->analogBank6Data[i] = INI_RA(&ah->iniBank6, i, modesIndex); ah->analogBank6Data[i] = INI_RA(&ah->iniBank6, i, modesIndex);
......
...@@ -108,8 +108,7 @@ static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah) ...@@ -108,8 +108,7 @@ static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah)
{ {
u32 rxgain_type; u32 rxgain_type;
if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >= if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_17) {
AR5416_EEP_MINOR_VER_17) {
rxgain_type = ah->eep_ops->get_eeprom(ah, EEP_RXGAIN_TYPE); rxgain_type = ah->eep_ops->get_eeprom(ah, EEP_RXGAIN_TYPE);
if (rxgain_type == AR5416_EEP_RXGAIN_13DB_BACKOFF) if (rxgain_type == AR5416_EEP_RXGAIN_13DB_BACKOFF)
...@@ -129,8 +128,7 @@ static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah) ...@@ -129,8 +128,7 @@ static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah)
static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah, u32 txgain_type) static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah, u32 txgain_type)
{ {
if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >= if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_19) {
AR5416_EEP_MINOR_VER_19) {
if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER)
INIT_INI_ARRAY(&ah->iniModesTxGain, INIT_INI_ARRAY(&ah->iniModesTxGain,
ar9280Modes_high_power_tx_gain_9280_2); ar9280Modes_high_power_tx_gain_9280_2);
......
...@@ -230,7 +230,6 @@ enum eeprom_param { ...@@ -230,7 +230,6 @@ enum eeprom_param {
EEP_DB_5, EEP_DB_5,
EEP_OB_2, EEP_OB_2,
EEP_DB_2, EEP_DB_2,
EEP_MINOR_REV,
EEP_TX_MASK, EEP_TX_MASK,
EEP_RX_MASK, EEP_RX_MASK,
EEP_FSTCLK_5G, EEP_FSTCLK_5G,
......
...@@ -254,9 +254,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah, ...@@ -254,9 +254,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k; struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
struct modal_eep_4k_header *pModal = &eep->modalHeader; struct modal_eep_4k_header *pModal = &eep->modalHeader;
struct base_eep_header_4k *pBase = &eep->baseEepHeader; struct base_eep_header_4k *pBase = &eep->baseEepHeader;
u16 ver_minor;
ver_minor = pBase->version & AR5416_EEP_VER_MINOR_MASK;
switch (param) { switch (param) {
case EEP_NFTHRESH_2: case EEP_NFTHRESH_2:
...@@ -279,8 +276,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah, ...@@ -279,8 +276,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
return pModal->ob_0; return pModal->ob_0;
case EEP_DB_2: case EEP_DB_2:
return pModal->db1_1; return pModal->db1_1;
case EEP_MINOR_REV:
return ver_minor;
case EEP_TX_MASK: case EEP_TX_MASK:
return pBase->txMask; return pBase->txMask;
case EEP_RX_MASK: case EEP_RX_MASK:
......
...@@ -250,9 +250,7 @@ static u32 ath9k_hw_ar9287_get_eeprom(struct ath_hw *ah, ...@@ -250,9 +250,7 @@ static u32 ath9k_hw_ar9287_get_eeprom(struct ath_hw *ah,
struct ar9287_eeprom *eep = &ah->eeprom.map9287; struct ar9287_eeprom *eep = &ah->eeprom.map9287;
struct modal_eep_ar9287_header *pModal = &eep->modalHeader; struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
struct base_eep_ar9287_header *pBase = &eep->baseEepHeader; struct base_eep_ar9287_header *pBase = &eep->baseEepHeader;
u16 ver_minor; u16 ver_minor = ath9k_hw_ar9287_get_eeprom_rev(ah);
ver_minor = pBase->version & AR9287_EEP_VER_MINOR_MASK;
switch (param) { switch (param) {
case EEP_NFTHRESH_2: case EEP_NFTHRESH_2:
...@@ -271,8 +269,6 @@ static u32 ath9k_hw_ar9287_get_eeprom(struct ath_hw *ah, ...@@ -271,8 +269,6 @@ static u32 ath9k_hw_ar9287_get_eeprom(struct ath_hw *ah,
return pBase->opCapFlags; return pBase->opCapFlags;
case EEP_RF_SILENT: case EEP_RF_SILENT:
return pBase->rfSilent; return pBase->rfSilent;
case EEP_MINOR_REV:
return ver_minor;
case EEP_TX_MASK: case EEP_TX_MASK:
return pBase->txMask; return pBase->txMask;
case EEP_RX_MASK: case EEP_RX_MASK:
......
...@@ -380,8 +380,6 @@ static u32 ath9k_hw_def_get_eeprom(struct ath_hw *ah, ...@@ -380,8 +380,6 @@ static u32 ath9k_hw_def_get_eeprom(struct ath_hw *ah,
return pModal[1].ob; return pModal[1].ob;
case EEP_DB_2: case EEP_DB_2:
return pModal[1].db; return pModal[1].db;
case EEP_MINOR_REV:
return AR5416_VER_MASK;
case EEP_TX_MASK: case EEP_TX_MASK:
return pBase->txMask; return pBase->txMask;
case EEP_RX_MASK: case EEP_RX_MASK:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment