aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-03-09 02:56:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-03-10 16:16:57 -0500
commit5f13bfac0718ce6f83ecba3755f224c3790e8d66 (patch)
tree261dbdd87c8f7593d917a078ccdde8281ab31db9 /drivers
parent86415d43efd4f7093979cfa8a80232114266f1a4 (diff)
ath5k: read eeprom IQ calibration values correctly for G mode
we read the IQ correction values (i_cal and q_cal) for G mode from a wrong location (the same shifts as for A mode is applied which is incorrect). use correct locations, matching the docs and HAL sources. also we should write IQ correction only when we have that information in the EEPROM, starting from version 4. also write it in the same way as we do in the periodic recalibration (enable last), just to be sure. Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath5k/eeprom.c4
-rw-r--r--drivers/net/wireless/ath/ath5k/reset.c15
2 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index 6a3f4da7fb48..10b52262b232 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -429,8 +429,8 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset,
429 ee->ee_margin_tx_rx[mode] = (val >> 8) & 0x3f; 429 ee->ee_margin_tx_rx[mode] = (val >> 8) & 0x3f;
430 430
431 AR5K_EEPROM_READ(o++, val); 431 AR5K_EEPROM_READ(o++, val);
432 ee->ee_i_cal[mode] = (val >> 8) & 0x3f; 432 ee->ee_i_cal[mode] = (val >> 5) & 0x3f;
433 ee->ee_q_cal[mode] = (val >> 3) & 0x1f; 433 ee->ee_q_cal[mode] = val & 0x1f;
434 434
435 if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_4_2) { 435 if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_4_2) {
436 AR5K_EEPROM_READ(o++, val); 436 AR5K_EEPROM_READ(o++, val);
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index c780b55020d2..cbf28e379843 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -851,12 +851,15 @@ static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah,
851 AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1, 851 AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1,
852 AR5K_INIT_CYCRSSI_THR1); 852 AR5K_INIT_CYCRSSI_THR1);
853 853
854 /* I/Q correction 854 /* I/Q correction (set enable bit last to match HAL sources) */
855 * TODO: Per channel i/q infos ? */ 855 /* TODO: Per channel i/q infos ? */
856 AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, 856 if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_4_0) {
857 AR5K_PHY_IQ_CORR_ENABLE | 857 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_Q_I_COFF,
858 (ee->ee_i_cal[ee_mode] << AR5K_PHY_IQ_CORR_Q_I_COFF_S) | 858 ee->ee_i_cal[ee_mode]);
859 ee->ee_q_cal[ee_mode]); 859 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_Q_Q_COFF,
860 ee->ee_q_cal[ee_mode]);
861 AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_ENABLE);
862 }
860 863
861 /* Heavy clipping -disable for now */ 864 /* Heavy clipping -disable for now */
862 if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_5_1) 865 if (ah->ah_ee_version >= AR5K_EEPROM_VERSION_5_1)