aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-02-22 02:11:01 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:06:36 -0500
commitd1ca8b8ecd18d99cf3ae0c2a9b81d3a22b4141c1 (patch)
tree6324dfa489443e4a74866e0434b9280abeab6893 /drivers/net/wireless/ath
parent5a1e273573d5e4a32aaa82a98a89b3fd711c74f0 (diff)
ath9k_hw: Handle MCI power state using a helper
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mci.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
3 files changed, 20 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index 1a01788ec103..a87d4ca1b547 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -365,6 +365,23 @@ static void ar9003_mci_prep_interface(struct ath_hw *ah)
365 REG_WRITE(ah, AR_MCI_INTERRUPT_EN, saved_mci_int_en); 365 REG_WRITE(ah, AR_MCI_INTERRUPT_EN, saved_mci_int_en);
366} 366}
367 367
368void ar9003_mci_set_full_sleep(struct ath_hw *ah)
369{
370 struct ath_common *common = ath9k_hw_common(ah);
371 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
372
373 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) &&
374 (mci->bt_state != MCI_BT_SLEEP) &&
375 !mci->halted_bt_gpm) {
376 ath_dbg(common, MCI,
377 "MCI halt BT GPM (full_sleep)\n");
378 ar9003_mci_send_coex_halt_bt_gpm(ah, true, true);
379 }
380
381 mci->ready = false;
382 REG_WRITE(ah, AR_RTC_KEEP_AWAKE, 0x2);
383}
384
368void ar9003_mci_disable_interrupt(struct ath_hw *ah) 385void ar9003_mci_disable_interrupt(struct ath_hw *ah)
369{ 386{
370 if (!ATH9K_HW_CAP_MCI) 387 if (!ATH9K_HW_CAP_MCI)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index f4b121f33132..406ffd06b6db 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2076,7 +2076,6 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
2076bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode) 2076bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
2077{ 2077{
2078 struct ath_common *common = ath9k_hw_common(ah); 2078 struct ath_common *common = ath9k_hw_common(ah);
2079 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
2080 int status = true, setChip = true; 2079 int status = true, setChip = true;
2081 static const char *modes[] = { 2080 static const char *modes[] = {
2082 "AWAKE", 2081 "AWAKE",
@@ -2100,20 +2099,8 @@ bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
2100 2099
2101 break; 2100 break;
2102 case ATH9K_PM_FULL_SLEEP: 2101 case ATH9K_PM_FULL_SLEEP:
2103 2102 if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI)
2104 if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI) { 2103 ar9003_mci_set_full_sleep(ah);
2105 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) &&
2106 (mci->bt_state != MCI_BT_SLEEP) &&
2107 !mci->halted_bt_gpm) {
2108 ath_dbg(common, MCI,
2109 "MCI halt BT GPM (full_sleep)\n");
2110 ar9003_mci_send_coex_halt_bt_gpm(ah,
2111 true, true);
2112 }
2113
2114 mci->ready = false;
2115 REG_WRITE(ah, AR_RTC_KEEP_AWAKE, 0x2);
2116 }
2117 2104
2118 ath9k_set_power_sleep(ah, setChip); 2105 ath9k_set_power_sleep(ah, setChip);
2119 ah->chip_fullsleep = true; 2106 ah->chip_fullsleep = true;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index ebc32d00fecc..07dd53e059fb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -1219,6 +1219,7 @@ void ar9003_mci_send_coex_halt_bt_gpm(struct ath_hw *ah, bool halt,
1219u32 ar9003_mci_wait_for_gpm(struct ath_hw *ah, u8 gpm_type, 1219u32 ar9003_mci_wait_for_gpm(struct ath_hw *ah, u8 gpm_type,
1220 u8 gpm_opcode, int time_out); 1220 u8 gpm_opcode, int time_out);
1221void ar9003_mci_2g5g_changed(struct ath_hw *ah, bool is_2g); 1221void ar9003_mci_2g5g_changed(struct ath_hw *ah, bool is_2g);
1222void ar9003_mci_set_full_sleep(struct ath_hw *ah);
1222void ar9003_mci_disable_interrupt(struct ath_hw *ah); 1223void ar9003_mci_disable_interrupt(struct ath_hw *ah);
1223void ar9003_mci_enable_interrupt(struct ath_hw *ah); 1224void ar9003_mci_enable_interrupt(struct ath_hw *ah);
1224void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool wait_done); 1225void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool wait_done);