ath9k_hw: Enable calibration types in init_cal_settings
PATCH 1/3 ath9k_hw: Enable calibration types in init_cal_settings
From: Sujith Manoharan <[email protected]>
Doing this in ath9k_hw_fill_cap_info() is odd and it's cleaner to do this in the init function for calibration. Also, setup the supported calibration type in init_cal_settings.
--- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 17 +++++++++++------ drivers/net/wireless/ath/ath9k/hw.c | 7 ------- 2 files changed, 11 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_calib.c +11 -6
@@ -323,6 +323,14 @@ static const struct ath9k_percal_data iq_cal_single_sample = {static void ar9003_hw_init_cal_settings (struct ath_hw *ah) { ah->iq_caldata.calData = &iq_cal_single_sample; + +if (AR_SREV_9300_20_OR_LATER (ah)) { + ah->enabled_cals |=TX_IQ_CAL ; +if (AR_SREV_9485_OR_LATER (ah)) + ah->enabled_cals |=TX_IQ_ON_AGC_CAL ; + } + + ah->supp_cals =IQ_MISMATCH_CAL ; }/*
@@ -1131,13 +1139,10 @@ skip_tx_iqcal:/* Initialize list pointers */ ah->cal_list = ah->cal_list_last = ah->cal_list_curr =NULL ; - ah->supp_cals =IQ_MISMATCH_CAL ; -if (ah->supp_cals &IQ_MISMATCH_CAL ) { -INIT_CAL (&ah->iq_caldata); -INSERT_CAL (ah, &ah->iq_caldata); -ath_dbg (common,CALIBRATE ,"enabling IQ Calibration\n" ); - } +INIT_CAL (&ah->iq_caldata); +INSERT_CAL (ah, &ah->iq_caldata); +ath_dbg (common,CALIBRATE ,"enabling IQ Calibration\n" );if (ah->supp_cals &TEMP_COMP_CAL ) {INIT_CAL (&ah->tempCompCalData);
drivers/net/wireless/ath/ath9k/hw.c +0 -7
@@ -2576,12 +2576,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) rx_chainmask >>=1 ; } -if (AR_SREV_9300_20_OR_LATER (ah)) { - ah->enabled_cals |=TX_IQ_CAL ; -if (AR_SREV_9485_OR_LATER (ah)) - ah->enabled_cals |=TX_IQ_ON_AGC_CAL ; - } -if (AR_SREV_9462 (ah) ||AR_SREV_9565 (ah)) {if (!(ah->ent_mode &AR_ENT_OTP_49GHZ_DISABLE )) pCap->hw_caps |=ATH9K_HW_CAP_MCI ;
@@ -2590,7 +2584,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) pCap->hw_caps |=ATH9K_HW_CAP_RTT ; } -if (AR_SREV_9280_20_OR_LATER (ah)) { pCap->hw_caps |=ATH9K_HW_WOW_DEVICE_CAPABLE |ATH9K_HW_WOW_PATTERN_MATCH_EXACT ;
Signature · 1 line
1.8.1
PATCH 2/3 ath9k_hw: Fix calibration for AR9340
From: Sujith Manoharan <[email protected]>
TX_IQ_ON_AGC_CAL should not be enabled for AR9340.
--- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_calib.c +1 -1
@@ -326,7 +326,7 @@ static void ar9003_hw_init_cal_settings(struct ath_hw *ah)if (AR_SREV_9300_20_OR_LATER (ah)) { ah->enabled_cals |=TX_IQ_CAL ; -if (AR_SREV_9485_OR_LATER (ah)) +if (AR_SREV_9485_OR_LATER (ah) && !AR_SREV_9340 (ah)) ah->enabled_cals |=TX_IQ_ON_AGC_CAL ; }
Signature · 1 line
1.8.1
Re: [PATCH 2/3] ath9k_hw: Fix calibration for AR9340
Quoted 3 lines · On Thursday 03 January 2013 12:21:22 Sujith Manoharan wrote:
From: Sujith Manoharan <[email protected]>
TX_IQ_ON_AGC_CALshould not be enabled for AR9340.
Why?
Signature · 1 line
Franz Schrober
Re: [PATCH 2/3] ath9k_hw: Fix calibration for AR9340
Quoted 6 lines · Schrober
Quoted 3 lines · On Thursday 03 January 2013 12:21:22 Sujith Manoharan wrote:
From: Sujith Manoharan <[email protected]>
TX_IQ_ON_AGC_CALshould not be enabled for AR9340.Why?
Because the chip doesn't support it.
Sujith
PATCH 3/3 ath9k_hw: Remove TEMP_COMP_CAL
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
This is not enabled for any chip and is unused.
--- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 20 +++----------------- drivers/net/wireless/ath/ath9k/hw.h | 1 - 2 files changed, 3 insertions(+), 18 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_calib.c +3 -17
@@ -32,7 +32,6 @@ struct coeff {enum ar9003_cal_types {IQ_MISMATCH_CAL =BIT (0 ), -TEMP_COMP_CAL =BIT (1 ), }; static void ar9003_hw_setup_calibration(struct ath_hw *ah,
@@ -49,7 +48,7 @@ static void ar9003_hw_setup_calibration(struct ath_hw *ah,*/ REG_RMW_FIELD (ah,AR_PHY_TIMING4 ,AR_PHY_TIMING4_IQCAL_LOG_COUNT_MAX , - currCal->calData->calCountMax); + currCal->calData->calCountMax);REG_WRITE (ah,AR_PHY_CALMODE ,AR_PHY_CALMODE_IQ ); ath_dbg(common, CALIBRATE,
@@ -58,14 +57,8 @@ static void ar9003_hw_setup_calibration(struct ath_hw *ah,/* Kick-off cal */ REG_SET_BIT (ah,AR_PHY_TIMING4 ,AR_PHY_TIMING4_DO_CAL );break ; -case TEMP_COMP_CAL : -REG_RMW_FIELD (ah,AR_PHY_65NM_CH0_THERM , -AR_PHY_65NM_CH0_THERM_LOCAL ,1 ); -REG_RMW_FIELD (ah,AR_PHY_65NM_CH0_THERM , -AR_PHY_65NM_CH0_THERM_START ,1 ); - -ath_dbg (common,CALIBRATE , -"starting Temperature Compensation Calibration\n" ); +default : +ath_err (common,"Invalid calibration type\n" );break ; } }
@@ -1144,13 +1137,6 @@ skip_tx_iqcal:INSERT_CAL (ah, &ah->iq_caldata);ath_dbg (common,CALIBRATE ,"enabling IQ Calibration\n" ); -if (ah->supp_cals &TEMP_COMP_CAL ) { -INIT_CAL (&ah->tempCompCalData); -INSERT_CAL (ah, &ah->tempCompCalData); -ath_dbg (common,CALIBRATE , -"enabling Temperature Compensation Calibration\n" ); - } -/* Initialize current pointer to first element in list */ ah->cal_list_curr = ah->cal_list;
drivers/net/wireless/ath/ath9k/hw.h +0 -1
@@ -771,7 +771,6 @@ struct ath_hw {struct ath9k_cal_list iq_caldata;struct ath9k_cal_list adcgain_caldata;struct ath9k_cal_list adcdc_caldata; -struct ath9k_cal_list tempCompCalData;struct ath9k_cal_list *cal_list;struct ath9k_cal_list *cal_list_last;struct ath9k_cal_list *cal_list_curr;
Signature · 1 line
1.8.1