diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_eeprom.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 884f9f0014ae..5bbe5057ba18 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -3566,9 +3566,9 @@ static u16 ar9003_hw_ant_ctrl_chain_get(struct ath_hw *ah, int chain, | |||
3566 | 3566 | ||
3567 | static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | 3567 | static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) |
3568 | { | 3568 | { |
3569 | struct ath9k_hw_capabilities *pCap = &ah->caps; | ||
3569 | int chain; | 3570 | int chain; |
3570 | u32 regval; | 3571 | u32 regval; |
3571 | u32 ant_div_ctl1; | ||
3572 | static const u32 switch_chain_reg[AR9300_MAX_CHAINS] = { | 3572 | static const u32 switch_chain_reg[AR9300_MAX_CHAINS] = { |
3573 | AR_PHY_SWITCH_CHAIN_0, | 3573 | AR_PHY_SWITCH_CHAIN_0, |
3574 | AR_PHY_SWITCH_CHAIN_1, | 3574 | AR_PHY_SWITCH_CHAIN_1, |
@@ -3633,6 +3633,16 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | |||
3633 | /* enable_lnadiv */ | 3633 | /* enable_lnadiv */ |
3634 | regval &= (~AR_PHY_ANT_DIV_LNADIV); | 3634 | regval &= (~AR_PHY_ANT_DIV_LNADIV); |
3635 | regval |= ((value >> 6) & 0x1) << AR_PHY_ANT_DIV_LNADIV_S; | 3635 | regval |= ((value >> 6) & 0x1) << AR_PHY_ANT_DIV_LNADIV_S; |
3636 | |||
3637 | if (AR_SREV_9565(ah)) { | ||
3638 | if (ah->shared_chain_lnadiv) { | ||
3639 | regval |= (1 << AR_PHY_ANT_SW_RX_PROT_S); | ||
3640 | } else { | ||
3641 | regval &= ~(1 << AR_PHY_ANT_DIV_LNADIV_S); | ||
3642 | regval &= ~(1 << AR_PHY_ANT_SW_RX_PROT_S); | ||
3643 | } | ||
3644 | } | ||
3645 | |||
3636 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); | 3646 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); |
3637 | 3647 | ||
3638 | /*enable fast_div */ | 3648 | /*enable fast_div */ |
@@ -3640,9 +3650,8 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | |||
3640 | regval &= (~AR_FAST_DIV_ENABLE); | 3650 | regval &= (~AR_FAST_DIV_ENABLE); |
3641 | regval |= ((value >> 7) & 0x1) << AR_FAST_DIV_ENABLE_S; | 3651 | regval |= ((value >> 7) & 0x1) << AR_FAST_DIV_ENABLE_S; |
3642 | REG_WRITE(ah, AR_PHY_CCK_DETECT, regval); | 3652 | REG_WRITE(ah, AR_PHY_CCK_DETECT, regval); |
3643 | ant_div_ctl1 = ah->eep_ops->get_eeprom(ah, EEP_ANT_DIV_CTL1); | 3653 | |
3644 | /* check whether antenna diversity is enabled */ | 3654 | if (pCap->hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) { |
3645 | if ((ant_div_ctl1 >> 0x6) == 0x3) { | ||
3646 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); | 3655 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); |
3647 | /* | 3656 | /* |
3648 | * clear bits 25-30 main_lnaconf, alt_lnaconf, | 3657 | * clear bits 25-30 main_lnaconf, alt_lnaconf, |
@@ -3659,10 +3668,7 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | |||
3659 | AR_PHY_ANT_DIV_ALT_LNACONF_S); | 3668 | AR_PHY_ANT_DIV_ALT_LNACONF_S); |
3660 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); | 3669 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); |
3661 | } | 3670 | } |
3662 | |||
3663 | |||
3664 | } | 3671 | } |
3665 | |||
3666 | } | 3672 | } |
3667 | 3673 | ||
3668 | static void ar9003_hw_drive_strength_apply(struct ath_hw *ah) | 3674 | static void ar9003_hw_drive_strength_apply(struct ath_hw *ah) |