diff options
author | Rajkumar Manoharan <rmanohar@qca.qualcomm.com> | 2011-11-12 09:05:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-17 15:43:55 -0500 |
commit | 8227bf455469a153d5fa2a810653a669a2595ebd (patch) | |
tree | 1e798a8265587fe3924d72d45bca32737fb2fe79 | |
parent | 54f10b059e6592598a9b66fabf0cde8be1d2780c (diff) |
ath9k_hw: set btcoex weights for AR9462
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/reg.h | 2 |
3 files changed, 37 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c index 064c9001d29a..5a6361da9818 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.c +++ b/drivers/net/wireless/ath/ath9k/btcoex.c | |||
@@ -42,6 +42,14 @@ static const u32 ar9003_wlan_weights[ATH_BTCOEX_STOMP_MAX] | |||
42 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* STOMP_NONE */ | 42 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* STOMP_NONE */ |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static const u32 ar9462_wlan_weights[ATH_BTCOEX_STOMP_MAX] | ||
46 | [AR9300_NUM_WLAN_WEIGHTS] = { | ||
47 | { 0x01017d01, 0x41414101, 0x41414101, 0x41414141 }, /* STOMP_ALL */ | ||
48 | { 0x01017d01, 0x3b3b3b01, 0x3b3b3b01, 0x3b3b3b3b }, /* STOMP_LOW */ | ||
49 | { 0x01017d01, 0x01010101, 0x01010101, 0x01010101 }, /* STOMP_NONE */ | ||
50 | { 0x01017d01, 0x013b0101, 0x3b3b0101, 0x3b3b013b }, /* STOMP_LOW_FTP */ | ||
51 | }; | ||
52 | |||
45 | void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum) | 53 | void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum) |
46 | { | 54 | { |
47 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; | 55 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; |
@@ -193,6 +201,19 @@ static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah) | |||
193 | AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL); | 201 | AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL); |
194 | } | 202 | } |
195 | 203 | ||
204 | static void ath9k_hw_btcoex_enable_mci(struct ath_hw *ah) | ||
205 | { | ||
206 | struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; | ||
207 | int i; | ||
208 | |||
209 | for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++) | ||
210 | REG_WRITE(ah, AR_MCI_COEX_WL_WEIGHTS(i), | ||
211 | btcoex->wlan_weight[i]); | ||
212 | |||
213 | REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); | ||
214 | btcoex->enabled = true; | ||
215 | } | ||
216 | |||
196 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) | 217 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) |
197 | { | 218 | { |
198 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; | 219 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; |
@@ -206,6 +227,9 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah) | |||
206 | case ATH_BTCOEX_CFG_3WIRE: | 227 | case ATH_BTCOEX_CFG_3WIRE: |
207 | ath9k_hw_btcoex_enable_3wire(ah); | 228 | ath9k_hw_btcoex_enable_3wire(ah); |
208 | break; | 229 | break; |
230 | case ATH_BTCOEX_CFG_MCI: | ||
231 | ath9k_hw_btcoex_enable_mci(ah); | ||
232 | return; | ||
209 | } | 233 | } |
210 | 234 | ||
211 | REG_RMW(ah, AR_GPIO_PDPU, | 235 | REG_RMW(ah, AR_GPIO_PDPU, |
@@ -221,6 +245,13 @@ void ath9k_hw_btcoex_disable(struct ath_hw *ah) | |||
221 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; | 245 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; |
222 | int i; | 246 | int i; |
223 | 247 | ||
248 | btcoex_hw->enabled = false; | ||
249 | if (btcoex_hw->scheme == ATH_BTCOEX_CFG_MCI) { | ||
250 | ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE); | ||
251 | for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++) | ||
252 | REG_WRITE(ah, AR_MCI_COEX_WL_WEIGHTS(i), | ||
253 | btcoex_hw->wlan_weight[i]); | ||
254 | } | ||
224 | ath9k_hw_set_gpio(ah, btcoex_hw->wlanactive_gpio, 0); | 255 | ath9k_hw_set_gpio(ah, btcoex_hw->wlanactive_gpio, 0); |
225 | 256 | ||
226 | ath9k_hw_cfg_output(ah, btcoex_hw->wlanactive_gpio, | 257 | ath9k_hw_cfg_output(ah, btcoex_hw->wlanactive_gpio, |
@@ -239,8 +270,6 @@ void ath9k_hw_btcoex_disable(struct ath_hw *ah) | |||
239 | REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0); | 270 | REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0); |
240 | 271 | ||
241 | } | 272 | } |
242 | |||
243 | ah->btcoex_hw.enabled = false; | ||
244 | } | 273 | } |
245 | EXPORT_SYMBOL(ath9k_hw_btcoex_disable); | 274 | EXPORT_SYMBOL(ath9k_hw_btcoex_disable); |
246 | 275 | ||
@@ -248,11 +277,13 @@ static void ar9003_btcoex_bt_stomp(struct ath_hw *ah, | |||
248 | enum ath_stomp_type stomp_type) | 277 | enum ath_stomp_type stomp_type) |
249 | { | 278 | { |
250 | struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; | 279 | struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; |
280 | const u32 *weight = AR_SREV_9462(ah) ? ar9003_wlan_weights[stomp_type] : | ||
281 | ar9462_wlan_weights[stomp_type]; | ||
251 | int i; | 282 | int i; |
252 | 283 | ||
253 | for (i = 0; i < AR9300_NUM_WLAN_WEIGHTS; i++) { | 284 | for (i = 0; i < AR9300_NUM_WLAN_WEIGHTS; i++) { |
254 | btcoex->bt_weight[i] = AR9300_BT_WGHT; | 285 | btcoex->bt_weight[i] = AR9300_BT_WGHT; |
255 | btcoex->wlan_weight[i] = ar9003_wlan_weights[stomp_type][i]; | 286 | btcoex->wlan_weight[i] = weight[i]; |
256 | } | 287 | } |
257 | } | 288 | } |
258 | 289 | ||
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h index 34acb5121a2e..d5e5db1faad9 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.h +++ b/drivers/net/wireless/ath/ath9k/btcoex.h | |||
@@ -43,6 +43,7 @@ enum ath_stomp_type { | |||
43 | ATH_BTCOEX_STOMP_ALL, | 43 | ATH_BTCOEX_STOMP_ALL, |
44 | ATH_BTCOEX_STOMP_LOW, | 44 | ATH_BTCOEX_STOMP_LOW, |
45 | ATH_BTCOEX_STOMP_NONE, | 45 | ATH_BTCOEX_STOMP_NONE, |
46 | ATH_BTCOEX_STOMP_LOW_FTP, | ||
46 | ATH_BTCOEX_STOMP_MAX | 47 | ATH_BTCOEX_STOMP_MAX |
47 | }; | 48 | }; |
48 | 49 | ||
@@ -50,6 +51,7 @@ enum ath_btcoex_scheme { | |||
50 | ATH_BTCOEX_CFG_NONE, | 51 | ATH_BTCOEX_CFG_NONE, |
51 | ATH_BTCOEX_CFG_2WIRE, | 52 | ATH_BTCOEX_CFG_2WIRE, |
52 | ATH_BTCOEX_CFG_3WIRE, | 53 | ATH_BTCOEX_CFG_3WIRE, |
54 | ATH_BTCOEX_CFG_MCI, | ||
53 | }; | 55 | }; |
54 | 56 | ||
55 | struct ath_btcoex_hw { | 57 | struct ath_btcoex_hw { |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index e17236dbb6c9..45910975d853 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -1752,7 +1752,7 @@ enum { | |||
1752 | 1752 | ||
1753 | #define AR_BT_COEX_WL_WEIGHTS0 0x8174 | 1753 | #define AR_BT_COEX_WL_WEIGHTS0 0x8174 |
1754 | #define AR_BT_COEX_WL_WEIGHTS1 0x81c4 | 1754 | #define AR_BT_COEX_WL_WEIGHTS1 0x81c4 |
1755 | 1755 | #define AR_MCI_COEX_WL_WEIGHTS(_i) (0x18b0 + (_i << 2)) | |
1756 | #define AR_BT_COEX_BT_WEIGHTS(_i) (0x83ac + (_i << 2)) | 1756 | #define AR_BT_COEX_BT_WEIGHTS(_i) (0x83ac + (_i << 2)) |
1757 | 1757 | ||
1758 | #define AR9300_BT_WGHT 0xcccc4444 | 1758 | #define AR9300_BT_WGHT 0xcccc4444 |