diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2009-08-26 11:38:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:48 -0400 |
commit | 17d50d1df48631ae868958032edada7aa920636b (patch) | |
tree | 76330eb59de8138f5bb85bb43de9776484e8e2a2 /drivers/net | |
parent | f985ad12b595094839fddaf757fcf5d853ed3d7f (diff) |
ath9k: Move btcoex stuff from hw.[ch] to new btcoex.[ch]
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/Makefile | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.c | 55 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.h | 24 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 42 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 4 |
6 files changed, 82 insertions, 47 deletions
diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile index 28443e05ec10..ff2c9a26c10c 100644 --- a/drivers/net/wireless/ath/ath9k/Makefile +++ b/drivers/net/wireless/ath/ath9k/Makefile | |||
@@ -12,7 +12,8 @@ ath9k-y += hw.o \ | |||
12 | recv.o \ | 12 | recv.o \ |
13 | xmit.o \ | 13 | xmit.o \ |
14 | virtual.o \ | 14 | virtual.o \ |
15 | rc.o | 15 | rc.o \ |
16 | btcoex.o | ||
16 | 17 | ||
17 | ath9k-$(CONFIG_PCI) += pci.o | 18 | ath9k-$(CONFIG_PCI) += pci.o |
18 | ath9k-$(CONFIG_ATHEROS_AR71XX) += ahb.o | 19 | ath9k-$(CONFIG_ATHEROS_AR71XX) += ahb.o |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 086880083360..1a8d67997667 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "rc.h" | 26 | #include "rc.h" |
27 | #include "debug.h" | 27 | #include "debug.h" |
28 | #include "../ath.h" | 28 | #include "../ath.h" |
29 | #include "btcoex.h" | ||
29 | 30 | ||
30 | struct ath_node; | 31 | struct ath_node; |
31 | 32 | ||
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c new file mode 100644 index 000000000000..abaf92d8074c --- /dev/null +++ b/drivers/net/wireless/ath/ath9k/btcoex.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2009 Atheros Communications Inc. | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | #include "ath9k.h" | ||
18 | |||
19 | void ath9k_hw_btcoex_init(struct ath_hw *ah) | ||
20 | { | ||
21 | /* connect bt_active to baseband */ | ||
22 | REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, | ||
23 | (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF | | ||
24 | AR_GPIO_INPUT_EN_VAL_BT_FREQUENCY_DEF)); | ||
25 | |||
26 | REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, | ||
27 | AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB); | ||
28 | |||
29 | /* Set input mux for bt_active to gpio pin */ | ||
30 | REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, | ||
31 | AR_GPIO_INPUT_MUX1_BT_ACTIVE, | ||
32 | ah->btactive_gpio); | ||
33 | |||
34 | /* Configure the desired gpio port for input */ | ||
35 | ath9k_hw_cfg_gpio_input(ah, ah->btactive_gpio); | ||
36 | } | ||
37 | |||
38 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) | ||
39 | { | ||
40 | /* Configure the desired GPIO port for TX_FRAME output */ | ||
41 | ath9k_hw_cfg_output(ah, ah->wlanactive_gpio, | ||
42 | AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); | ||
43 | |||
44 | ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED; | ||
45 | } | ||
46 | |||
47 | void ath9k_hw_btcoex_disable(struct ath_hw *ah) | ||
48 | { | ||
49 | ath9k_hw_set_gpio(ah, ah->wlanactive_gpio, 0); | ||
50 | |||
51 | ath9k_hw_cfg_output(ah, ah->wlanactive_gpio, | ||
52 | AR_GPIO_OUTPUT_MUX_AS_OUTPUT); | ||
53 | |||
54 | ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED; | ||
55 | } | ||
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h new file mode 100644 index 000000000000..99542808b8ef --- /dev/null +++ b/drivers/net/wireless/ath/ath9k/btcoex.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2009 Atheros Communications Inc. | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | #ifndef BTCOEX_H | ||
18 | #define BTCOEX_H | ||
19 | |||
20 | void ath9k_hw_btcoex_init(struct ath_hw *ah); | ||
21 | void ath9k_hw_btcoex_enable(struct ath_hw *ah); | ||
22 | void ath9k_hw_btcoex_disable(struct ath_hw *ah); | ||
23 | |||
24 | #endif | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index d81e826b682a..c3ecc7ee2ac0 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -4068,45 +4068,3 @@ void ath9k_hw_set11nmac2040(struct ath_hw *ah, enum ath9k_ht_macmode mode) | |||
4068 | 4068 | ||
4069 | REG_WRITE(ah, AR_2040_MODE, macmode); | 4069 | REG_WRITE(ah, AR_2040_MODE, macmode); |
4070 | } | 4070 | } |
4071 | |||
4072 | /***************************/ | ||
4073 | /* Bluetooth Coexistence */ | ||
4074 | /***************************/ | ||
4075 | |||
4076 | void ath9k_hw_btcoex_init(struct ath_hw *ah) | ||
4077 | { | ||
4078 | /* connect bt_active to baseband */ | ||
4079 | REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, | ||
4080 | (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF | | ||
4081 | AR_GPIO_INPUT_EN_VAL_BT_FREQUENCY_DEF)); | ||
4082 | |||
4083 | REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, | ||
4084 | AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB); | ||
4085 | |||
4086 | /* Set input mux for bt_active to gpio pin */ | ||
4087 | REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, | ||
4088 | AR_GPIO_INPUT_MUX1_BT_ACTIVE, | ||
4089 | ah->btactive_gpio); | ||
4090 | |||
4091 | /* Configure the desired gpio port for input */ | ||
4092 | ath9k_hw_cfg_gpio_input(ah, ah->btactive_gpio); | ||
4093 | } | ||
4094 | |||
4095 | void ath9k_hw_btcoex_enable(struct ath_hw *ah) | ||
4096 | { | ||
4097 | /* Configure the desired GPIO port for TX_FRAME output */ | ||
4098 | ath9k_hw_cfg_output(ah, ah->wlanactive_gpio, | ||
4099 | AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); | ||
4100 | |||
4101 | ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED; | ||
4102 | } | ||
4103 | |||
4104 | void ath9k_hw_btcoex_disable(struct ath_hw *ah) | ||
4105 | { | ||
4106 | ath9k_hw_set_gpio(ah, ah->wlanactive_gpio, 0); | ||
4107 | |||
4108 | ath9k_hw_cfg_output(ah, ah->wlanactive_gpio, | ||
4109 | AR_GPIO_OUTPUT_MUX_AS_OUTPUT); | ||
4110 | |||
4111 | ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED; | ||
4112 | } | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index e634cb448ca0..32f7c4b86ed3 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -614,8 +614,4 @@ bool ath9k_hw_intrpend(struct ath_hw *ah); | |||
614 | bool ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked); | 614 | bool ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked); |
615 | enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints); | 615 | enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints); |
616 | 616 | ||
617 | void ath9k_hw_btcoex_init(struct ath_hw *ah); | ||
618 | void ath9k_hw_btcoex_enable(struct ath_hw *ah); | ||
619 | void ath9k_hw_btcoex_disable(struct ath_hw *ah); | ||
620 | |||
621 | #endif | 617 | #endif |