summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_cal.c5
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_reset.c7
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9280_olc.c9
3 files changed, 17 insertions, 4 deletions
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
index 3336660..35dc3df 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
@@ -492,8 +492,9 @@ ar5416PerCalibrationN(struct ath_hal *ah, struct ieee80211_channel *chan,
if (AH5416(ah)->ah_cal_pacal)
AH5416(ah)->ah_cal_pacal(ah, AH_FALSE);
- /* Do temperature compensation if the chipset needs it */
- AH5416(ah)->ah_olcTempCompensation(ah);
+ /* Do open-loop temperature compensation if the chipset needs it */
+ if (ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))
+ AH5416(ah)->ah_olcTempCompensation(ah);
/*
* Get the value from the previous NF cal
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
index 7abd9ad..e8eec86 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
@@ -202,8 +202,11 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode,
*/
ar5416InitChainMasks(ah);
- /* Setup the open-loop temperature compensation if required */
- AH5416(ah)->ah_olcInit(ah);
+ /* Setup the open-loop power calibration if required */
+ if (ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) {
+ AH5416(ah)->ah_olcInit(ah);
+ AH5416(ah)->ah_olcTempCompensation(ah);
+ }
/* Setup the transmit power values. */
if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) {
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c b/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c
index da5e4ed..361930b 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c
@@ -43,6 +43,12 @@ ar9280olcInit(struct ath_hal *ah)
{
uint32_t i;
+ /* Only do OLC if it's enabled for this chipset */
+ if (! ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))
+ return;
+
+ HALDEBUG(ah, HAL_DEBUG_RESET, "%s: Setting up TX gain tables.\n", __func__);
+
for (i = 0; i < AR9280_TX_GAIN_TABLE_SIZE; i++)
AH9280(ah)->originalGain[i] = MS(OS_REG_READ(ah,
AR_PHY_TX_GAIN_TBL1 + i * 4), AR_PHY_TX_GAIN);
@@ -126,6 +132,9 @@ ar9280olcTemperatureCompensation(struct ath_hal *ah)
int delta, currPDADC, regval;
uint8_t hpwr_5g = 0;
+ if (! ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))
+ return;
+
rddata = OS_REG_READ(ah, AR_PHY_TX_PWRCTRL4);
currPDADC = MS(rddata, AR_PHY_TX_PWRCTRL_PD_AVG_OUT);
OpenPOWER on IntegriCloud