aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2015-03-14 01:57:55 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-03-20 02:28:08 -0400
commitf2ef792a80859ecdabeaf5bf960ad97a9dd81fc6 (patch)
treefd1950e889b03ef0fe59e1cf58443ceabb951a36 /drivers/net/wireless
parent958b6827b781ed14d12bef6323f6692ec761fbb5 (diff)
ath9k: Handle MCI_STATE_AIC_START
This patch adds a function to handle the MCI message MCI_STATE_AIC_START. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_aic.c33
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_aic.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mci.c4
3 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_aic.c b/drivers/net/wireless/ath/ath9k/ar9003_aic.c
index 4e8cf084d2fa..5b4f818264f5 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_aic.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_aic.c
@@ -18,6 +18,7 @@
18#include "hw-ops.h" 18#include "hw-ops.h"
19#include "ar9003_mci.h" 19#include "ar9003_mci.h"
20#include "ar9003_aic.h" 20#include "ar9003_aic.h"
21#include "ar9003_phy.h"
21#include "reg_aic.h" 22#include "reg_aic.h"
22 23
23static const u8 com_att_db_table[ATH_AIC_MAX_COM_ATT_DB_TABLE] = { 24static const u8 com_att_db_table[ATH_AIC_MAX_COM_ATT_DB_TABLE] = {
@@ -512,6 +513,38 @@ exit:
512 513
513} 514}
514 515
516u8 ar9003_aic_start_normal(struct ath_hw *ah)
517{
518 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic;
519 int16_t i;
520
521 if (aic->aic_cal_state != AIC_CAL_STATE_DONE)
522 return 1;
523
524 ar9003_aic_gain_table(ah);
525
526 REG_WRITE(ah, AR_PHY_AIC_SRAM_ADDR_B1, ATH_AIC_SRAM_AUTO_INCREMENT);
527
528 for (i = 0; i < ATH_AIC_MAX_BT_CHANNEL; i++) {
529 REG_WRITE(ah, AR_PHY_AIC_SRAM_DATA_B1, aic->aic_sram[i]);
530 }
531
532 /* FIXME: Replace these with proper register names */
533 REG_WRITE(ah, 0xa6b0, 0x80);
534 REG_WRITE(ah, 0xa6b4, 0x5b2df0);
535 REG_WRITE(ah, 0xa6b8, 0x10762cc8);
536 REG_WRITE(ah, 0xa6bc, 0x1219a4b);
537 REG_WRITE(ah, 0xa6c0, 0x1e01);
538 REG_WRITE(ah, 0xb6b4, 0xf0);
539 REG_WRITE(ah, 0xb6c0, 0x1e01);
540 REG_WRITE(ah, 0xb6b0, 0x81);
541 REG_WRITE(ah, AR_PHY_65NM_CH1_RXTX4, 0x40000000);
542
543 aic->aic_enabled = true;
544
545 return 0;
546}
547
515u8 ar9003_aic_cal_reset(struct ath_hw *ah) 548u8 ar9003_aic_cal_reset(struct ath_hw *ah)
516{ 549{
517 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; 550 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_aic.h b/drivers/net/wireless/ath/ath9k/ar9003_aic.h
index f7c95466149f..4dbff96b49cd 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_aic.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_aic.h
@@ -53,6 +53,7 @@ struct ath_aic_out_info {
53 struct ath_aic_sram_info sram; 53 struct ath_aic_sram_info sram;
54}; 54};
55 55
56u8 ar9003_aic_start_normal(struct ath_hw *ah);
56u8 ar9003_aic_cal_reset(struct ath_hw *ah); 57u8 ar9003_aic_cal_reset(struct ath_hw *ah);
57u8 ar9003_aic_calibration_single(struct ath_hw *ah); 58u8 ar9003_aic_calibration_single(struct ath_hw *ah);
58 59
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index d6ed62807a97..b559d75b748b 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -1363,6 +1363,10 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type)
1363 value = (!mci->unhalt_bt_gpm && mci->need_flush_btinfo) ? 1 : 0; 1363 value = (!mci->unhalt_bt_gpm && mci->need_flush_btinfo) ? 1 : 0;
1364 mci->need_flush_btinfo = false; 1364 mci->need_flush_btinfo = false;
1365 break; 1365 break;
1366 case MCI_STATE_AIC_START:
1367 if (ath9k_hw_is_aic_enabled(ah))
1368 ar9003_aic_start_normal(ah);
1369 break;
1366 case MCI_STATE_AIC_CAL_RESET: 1370 case MCI_STATE_AIC_CAL_RESET:
1367 if (ath9k_hw_is_aic_enabled(ah)) 1371 if (ath9k_hw_is_aic_enabled(ah))
1368 value = ar9003_aic_cal_reset(ah); 1372 value = ar9003_aic_cal_reset(ah);