aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>2011-11-30 00:11:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-30 15:08:51 -0500
commit1010911ec389fe7a342b9962877fdb88d7f04247 (patch)
tree6c23c17b94b18bd53d2d9e9599a8811a7bc702dd /drivers/net/wireless/ath
parent9e25365ffaa98626bdf7e1bb5fdddf73a1c131fb (diff)
ath9k_hw: MCI related changes in chip management
send halt BT GPM if the chip is in network sleep and BT state is awake Cc: Wilson Tsao <wtsao@qca.qualcomm.com> Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@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/hw.c24
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 662ab7e9a0f0..ba5734aa46c4 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1933,6 +1933,7 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
1933bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode) 1933bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
1934{ 1934{
1935 struct ath_common *common = ath9k_hw_common(ah); 1935 struct ath_common *common = ath9k_hw_common(ah);
1936 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
1936 int status = true, setChip = true; 1937 int status = true, setChip = true;
1937 static const char *modes[] = { 1938 static const char *modes[] = {
1938 "AWAKE", 1939 "AWAKE",
@@ -1950,12 +1951,35 @@ bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
1950 switch (mode) { 1951 switch (mode) {
1951 case ATH9K_PM_AWAKE: 1952 case ATH9K_PM_AWAKE:
1952 status = ath9k_hw_set_power_awake(ah, setChip); 1953 status = ath9k_hw_set_power_awake(ah, setChip);
1954
1955 if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI)
1956 REG_WRITE(ah, AR_RTC_KEEP_AWAKE, 0x2);
1957
1953 break; 1958 break;
1954 case ATH9K_PM_FULL_SLEEP: 1959 case ATH9K_PM_FULL_SLEEP:
1960
1961 if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI) {
1962 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) &&
1963 (mci->bt_state != MCI_BT_SLEEP) &&
1964 !mci->halted_bt_gpm) {
1965 ath_dbg(common, ATH_DBG_MCI, "MCI halt BT GPM"
1966 "(full_sleep)");
1967 ar9003_mci_send_coex_halt_bt_gpm(ah,
1968 true, true);
1969 }
1970
1971 mci->ready = false;
1972 REG_WRITE(ah, AR_RTC_KEEP_AWAKE, 0x2);
1973 }
1974
1955 ath9k_set_power_sleep(ah, setChip); 1975 ath9k_set_power_sleep(ah, setChip);
1956 ah->chip_fullsleep = true; 1976 ah->chip_fullsleep = true;
1957 break; 1977 break;
1958 case ATH9K_PM_NETWORK_SLEEP: 1978 case ATH9K_PM_NETWORK_SLEEP:
1979
1980 if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI)
1981 REG_WRITE(ah, AR_RTC_KEEP_AWAKE, 0x2);
1982
1959 ath9k_set_power_network_sleep(ah, setChip); 1983 ath9k_set_power_network_sleep(ah, setChip);
1960 break; 1984 break;
1961 default: 1985 default:
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index ba3672f45a20..6e2f18861f5d 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -1279,6 +1279,8 @@ enum {
1279#define AR_RTC_INTR_MASK \ 1279#define AR_RTC_INTR_MASK \
1280 ((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0058) : 0x7058) 1280 ((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0058) : 0x7058)
1281 1281
1282#define AR_RTC_KEEP_AWAKE 0x7034
1283
1282/* RTC_DERIVED_* - only for AR9100 */ 1284/* RTC_DERIVED_* - only for AR9100 */
1283 1285
1284#define AR_RTC_DERIVED_CLK \ 1286#define AR_RTC_DERIVED_CLK \