aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2011-10-13 01:30:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-10-14 14:48:21 -0400
commit34013524a1644bbd00c592541f67c536a384e707 (patch)
tree35fac662ff286147f7513b4991690c927bd4e4b0 /drivers/net
parent5f0c04ea1e7394c2b28fa247c1722487f9a77523 (diff)
ath9k_hw: Add support to reuse TxIQ cal measurements
Pass an argument to decide whether to reuse the Tx IQ calibration measurements or not during fast channel change. This will be later used by MCI support for AR9480. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_calib.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 026aa5b833d2..6d685664f916 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -659,7 +659,8 @@ static void ar9003_hw_detect_outlier(int *mp_coeff, int nmeasurement,
659 659
660static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah, 660static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
661 u8 num_chains, 661 u8 num_chains,
662 struct coeff *coeff) 662 struct coeff *coeff,
663 bool is_reusable)
663{ 664{
664 int i, im, nmeasurement; 665 int i, im, nmeasurement;
665 u32 tx_corr_coeff[MAX_MEASUREMENT][AR9300_MAX_CHAINS]; 666 u32 tx_corr_coeff[MAX_MEASUREMENT][AR9300_MAX_CHAINS];
@@ -726,11 +727,11 @@ static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
726 AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN, 0x1); 727 AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN, 0x1);
727 REG_RMW_FIELD(ah, AR_PHY_RX_IQCAL_CORR_B0, 728 REG_RMW_FIELD(ah, AR_PHY_RX_IQCAL_CORR_B0,
728 AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN, 0x1); 729 AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN, 0x1);
730
729 if (caldata) 731 if (caldata)
730 caldata->done_txiqcal_once = true; 732 caldata->done_txiqcal_once = is_reusable;
731 733
732 return; 734 return;
733
734} 735}
735 736
736static bool ar9003_hw_tx_iq_cal_run(struct ath_hw *ah) 737static bool ar9003_hw_tx_iq_cal_run(struct ath_hw *ah)
@@ -757,7 +758,7 @@ static bool ar9003_hw_tx_iq_cal_run(struct ath_hw *ah)
757 return true; 758 return true;
758} 759}
759 760
760static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah) 761static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah, bool is_reusable)
761{ 762{
762 struct ath_common *common = ath9k_hw_common(ah); 763 struct ath_common *common = ath9k_hw_common(ah);
763 const u32 txiqcal_status[AR9300_MAX_CHAINS] = { 764 const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
@@ -846,7 +847,8 @@ static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah)
846 coeff.phs_coeff[i][im] -= 128; 847 coeff.phs_coeff[i][im] -= 128;
847 } 848 }
848 } 849 }
849 ar9003_hw_tx_iqcal_load_avg_2_passes(ah, num_chains, &coeff); 850 ar9003_hw_tx_iqcal_load_avg_2_passes(ah, num_chains,
851 &coeff, is_reusable);
850 852
851 return; 853 return;
852 854
@@ -904,6 +906,7 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
904 struct ath_common *common = ath9k_hw_common(ah); 906 struct ath_common *common = ath9k_hw_common(ah);
905 struct ath9k_hw_cal_data *caldata = ah->caldata; 907 struct ath9k_hw_cal_data *caldata = ah->caldata;
906 bool txiqcal_done = false; 908 bool txiqcal_done = false;
909 bool is_reusable = true;
907 910
908 /* Do Tx IQ Calibration */ 911 /* Do Tx IQ Calibration */
909 REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1, 912 REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
@@ -943,7 +946,7 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
943 } 946 }
944 947
945 if (txiqcal_done) 948 if (txiqcal_done)
946 ar9003_hw_tx_iq_cal_post_proc(ah); 949 ar9003_hw_tx_iq_cal_post_proc(ah, is_reusable);
947 else if (caldata && caldata->done_txiqcal_once) 950 else if (caldata && caldata->done_txiqcal_once)
948 ar9003_hw_tx_iq_cal_reload(ah); 951 ar9003_hw_tx_iq_cal_reload(ah);
949 952