aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-12-06 07:27:55 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-07 16:35:00 -0500
commit31faff815bd9d87c370f799dff03948ed362d260 (patch)
tree22374d39aaf62504c5b0dda14a90a03f55f6173a
parent6559e83ebd2cac06c54ebb2b7f635cf2e434f25c (diff)
ath9k_hw: Define IQcal correction coefficient registers using index
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_calib.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.h8
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 33a80b24538c..e8f7df8c8626 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -606,11 +606,6 @@ static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
606 AR_PHY_TX_IQCAL_STATUS_B1, 606 AR_PHY_TX_IQCAL_STATUS_B1,
607 AR_PHY_TX_IQCAL_STATUS_B2, 607 AR_PHY_TX_IQCAL_STATUS_B2,
608 }; 608 };
609 static const u32 tx_corr_coeff[AR9300_MAX_CHAINS] = {
610 AR_PHY_TX_IQCAL_CORR_COEFF_01_B0,
611 AR_PHY_TX_IQCAL_CORR_COEFF_01_B1,
612 AR_PHY_TX_IQCAL_CORR_COEFF_01_B2,
613 };
614 static const u32 rx_corr[AR9300_MAX_CHAINS] = { 609 static const u32 rx_corr[AR9300_MAX_CHAINS] = {
615 AR_PHY_RX_IQCAL_CORR_B0, 610 AR_PHY_RX_IQCAL_CORR_B0,
616 AR_PHY_RX_IQCAL_CORR_B1, 611 AR_PHY_RX_IQCAL_CORR_B1,
@@ -621,11 +616,16 @@ static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
621 AR_PHY_CHAN_INFO_TAB_1, 616 AR_PHY_CHAN_INFO_TAB_1,
622 AR_PHY_CHAN_INFO_TAB_2, 617 AR_PHY_CHAN_INFO_TAB_2,
623 }; 618 };
619 u32 tx_corr_coeff[AR9300_MAX_CHAINS];
624 s32 iq_res[6]; 620 s32 iq_res[6];
625 s32 iqc_coeff[2]; 621 s32 iqc_coeff[2];
626 s32 i, j; 622 s32 i, j;
627 u32 num_chains = 0; 623 u32 num_chains = 0;
628 624
625 tx_corr_coeff[0] = AR_PHY_TX_IQCAL_CORR_COEFF_B0(0);
626 tx_corr_coeff[1] = AR_PHY_TX_IQCAL_CORR_COEFF_B1(0);
627 tx_corr_coeff[2] = AR_PHY_TX_IQCAL_CORR_COEFF_B2(0);
628
629 for (i = 0; i < AR9300_MAX_CHAINS; i++) { 629 for (i = 0; i < AR9300_MAX_CHAINS; i++) {
630 if (ah->txchainmask & (1 << i)) 630 if (ah->txchainmask & (1 << i))
631 num_chains++; 631 num_chains++;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
index 4c64eb1888a2..abb4ec172ed1 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
@@ -549,7 +549,9 @@
549#define AR_PHY_TX_IQCAL_CONTROL_1 (AR_SM_BASE + 0x448) 549#define AR_PHY_TX_IQCAL_CONTROL_1 (AR_SM_BASE + 0x448)
550#define AR_PHY_TX_IQCAL_START (AR_SM_BASE + 0x440) 550#define AR_PHY_TX_IQCAL_START (AR_SM_BASE + 0x440)
551#define AR_PHY_TX_IQCAL_STATUS_B0 (AR_SM_BASE + 0x48c) 551#define AR_PHY_TX_IQCAL_STATUS_B0 (AR_SM_BASE + 0x48c)
552#define AR_PHY_TX_IQCAL_CORR_COEFF_01_B0 (AR_SM_BASE + 0x450) 552#define AR_PHY_TX_IQCAL_CORR_COEFF_B0(_i) (AR_SM_BASE + \
553 (AR_SREV_9485(ah) ? \
554 0x3d0 : 0x450) + ((_i) << 2))
553 555
554#define AR_PHY_WATCHDOG_STATUS (AR_SM_BASE + 0x5c0) 556#define AR_PHY_WATCHDOG_STATUS (AR_SM_BASE + 0x5c0)
555#define AR_PHY_WATCHDOG_CTL_1 (AR_SM_BASE + 0x5c4) 557#define AR_PHY_WATCHDOG_CTL_1 (AR_SM_BASE + 0x5c4)
@@ -813,7 +815,7 @@
813#define AR_PHY_TPC_11_B1 (AR_SM1_BASE + 0x220) 815#define AR_PHY_TPC_11_B1 (AR_SM1_BASE + 0x220)
814#define AR_PHY_PDADC_TAB_1 (AR_SM1_BASE + 0x240) 816#define AR_PHY_PDADC_TAB_1 (AR_SM1_BASE + 0x240)
815#define AR_PHY_TX_IQCAL_STATUS_B1 (AR_SM1_BASE + 0x48c) 817#define AR_PHY_TX_IQCAL_STATUS_B1 (AR_SM1_BASE + 0x48c)
816#define AR_PHY_TX_IQCAL_CORR_COEFF_01_B1 (AR_SM1_BASE + 0x450) 818#define AR_PHY_TX_IQCAL_CORR_COEFF_B1(_i) (AR_SM_BASE + 0x450 + ((_i) << 2))
817 819
818/* 820/*
819 * Channel 2 Register Map 821 * Channel 2 Register Map
@@ -866,7 +868,7 @@
866#define AR_PHY_TPC_11_B2 (AR_SM2_BASE + 0x220) 868#define AR_PHY_TPC_11_B2 (AR_SM2_BASE + 0x220)
867#define AR_PHY_PDADC_TAB_2 (AR_SM2_BASE + 0x240) 869#define AR_PHY_PDADC_TAB_2 (AR_SM2_BASE + 0x240)
868#define AR_PHY_TX_IQCAL_STATUS_B2 (AR_SM2_BASE + 0x48c) 870#define AR_PHY_TX_IQCAL_STATUS_B2 (AR_SM2_BASE + 0x48c)
869#define AR_PHY_TX_IQCAL_CORR_COEFF_01_B2 (AR_SM2_BASE + 0x450) 871#define AR_PHY_TX_IQCAL_CORR_COEFF_B2(_i) (AR_SM2_BASE + 0x450 + ((_i) << 2))
870 872
871#define AR_PHY_TX_IQCAL_STATUS_B2_FAILED 0x00000001 873#define AR_PHY_TX_IQCAL_STATUS_B2_FAILED 0x00000001
872 874