diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-09-09 07:17:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:20 -0400 |
commit | bc74bf8fc382b30df24c4e280fb84f3b1303958f (patch) | |
tree | 4b56daab4888a8d088e6454c827686cbd4aea0e5 /drivers/net/wireless/ath/ath9k/btcoex.c | |
parent | 75d7839f4c4ca472bcf0b71f6f682957e19f777a (diff) |
ath9k: split ath9k_hw_btcoex_enable() into two helpers
One for 2-wire and another for 3-wire.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/btcoex.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.c | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c index 6209a56f7a9a..61a8e1d95bb9 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.c +++ b/drivers/net/wireless/ath/ath9k/btcoex.c | |||
@@ -117,30 +117,47 @@ void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah) | |||
117 | ath9k_hw_cfg_gpio_input(ah, btcoex_info->btpriority_gpio); | 117 | ath9k_hw_cfg_gpio_input(ah, btcoex_info->btpriority_gpio); |
118 | } | 118 | } |
119 | 119 | ||
120 | static void ath9k_hw_btcoex_enable_2wire(struct ath_hw *ah) | ||
121 | { | ||
122 | struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; | ||
123 | |||
124 | /* Configure the desired GPIO port for TX_FRAME output */ | ||
125 | ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, | ||
126 | AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); | ||
127 | } | ||
128 | |||
129 | static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah) | ||
130 | { | ||
131 | struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; | ||
132 | |||
133 | /* | ||
134 | * Program coex mode and weight registers to | ||
135 | * enable coex 3-wire | ||
136 | */ | ||
137 | REG_WRITE(ah, AR_BT_COEX_MODE, btcoex_info->bt_coex_mode); | ||
138 | REG_WRITE(ah, AR_BT_COEX_WEIGHT, btcoex_info->bt_coex_weights); | ||
139 | REG_WRITE(ah, AR_BT_COEX_MODE2, btcoex_info->bt_coex_mode2); | ||
140 | |||
141 | REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); | ||
142 | REG_RMW_FIELD(ah, AR_PCU_MISC, AR_PCU_BT_ANT_PREVENT_RX, 0); | ||
143 | |||
144 | ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, | ||
145 | AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL); | ||
146 | } | ||
147 | |||
120 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) | 148 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) |
121 | { | 149 | { |
122 | struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; | 150 | struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; |
123 | 151 | ||
124 | if (btcoex_info->btcoex_scheme == ATH_BTCOEX_CFG_2WIRE) { | 152 | switch (btcoex_info->btcoex_scheme) { |
125 | /* Configure the desired GPIO port for TX_FRAME output */ | 153 | case ATH_BTCOEX_CFG_NONE: |
126 | ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, | 154 | break; |
127 | AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); | 155 | case ATH_BTCOEX_CFG_2WIRE: |
128 | } else { | 156 | ath9k_hw_btcoex_enable_2wire(ah); |
129 | /* | 157 | break; |
130 | * Program coex mode and weight registers to | 158 | case ATH_BTCOEX_CFG_3WIRE: |
131 | * enable coex 3-wire | 159 | ath9k_hw_btcoex_enable_3wire(ah); |
132 | */ | 160 | break; |
133 | REG_WRITE(ah, AR_BT_COEX_MODE, btcoex_info->bt_coex_mode); | ||
134 | REG_WRITE(ah, AR_BT_COEX_WEIGHT, btcoex_info->bt_coex_weights); | ||
135 | REG_WRITE(ah, AR_BT_COEX_MODE2, btcoex_info->bt_coex_mode2); | ||
136 | |||
137 | REG_RMW_FIELD(ah, AR_QUIET1, | ||
138 | AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); | ||
139 | REG_RMW_FIELD(ah, AR_PCU_MISC, | ||
140 | AR_PCU_BT_ANT_PREVENT_RX, 0); | ||
141 | |||
142 | ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, | ||
143 | AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL); | ||
144 | } | 161 | } |
145 | 162 | ||
146 | REG_RMW(ah, AR_GPIO_PDPU, | 163 | REG_RMW(ah, AR_GPIO_PDPU, |