diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_calib.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_calib.c | 15 |
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 026aa5b833d..6d685664f91 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 | ||
660 | static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah, | 660 | static 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 | ||
736 | static bool ar9003_hw_tx_iq_cal_run(struct ath_hw *ah) | 737 | static 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 | ||
760 | static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah) | 761 | static 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 | ||