aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-16 18:57:01 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-20 14:49:48 -0500
commit55821324dc6a10fab36871534a322bad159fad79 (patch)
treed598e6d8280007c0d39f47c3f4f947c5eb945ae0 /drivers
parent4b3ba66a47311770b21e7aba481f4f2a90ba3084 (diff)
ath9k_hw: remove baseband rfsilent support
When rfkill is enabled, ath9k_hw unnecessarily configured the baseband to turn off based on GPIO input, however that code was hardcoded to GPIO 0 instead of ah->rfkill_gpio. Since ath9k uses software rfkill anyway, this code is completely unnecessary and should be removed in case anything else ever uses GPIO 0. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c13
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c23
-rw-r--r--drivers/net/wireless/ath/ath9k/hw-ops.h5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
5 files changed, 1 insertions, 43 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index 059330aac645..ffcf44a4058b 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -961,18 +961,6 @@ static void ar5008_hw_rfbus_done(struct ath_hw *ah)
961 REG_WRITE(ah, AR_PHY_RFBUS_REQ, 0); 961 REG_WRITE(ah, AR_PHY_RFBUS_REQ, 0);
962} 962}
963 963
964static void ar5008_hw_enable_rfkill(struct ath_hw *ah)
965{
966 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL,
967 AR_GPIO_INPUT_EN_VAL_RFSILENT_BB);
968
969 REG_CLR_BIT(ah, AR_GPIO_INPUT_MUX2,
970 AR_GPIO_INPUT_MUX2_RFSILENT);
971
972 ath9k_hw_cfg_gpio_input(ah, ah->rfkill_gpio);
973 REG_SET_BIT(ah, AR_PHY_TEST, RFSILENT_BB);
974}
975
976static void ar5008_restore_chainmask(struct ath_hw *ah) 964static void ar5008_restore_chainmask(struct ath_hw *ah)
977{ 965{
978 int rx_chainmask = ah->rxchainmask; 966 int rx_chainmask = ah->rxchainmask;
@@ -1629,7 +1617,6 @@ void ar5008_hw_attach_phy_ops(struct ath_hw *ah)
1629 priv_ops->set_delta_slope = ar5008_hw_set_delta_slope; 1617 priv_ops->set_delta_slope = ar5008_hw_set_delta_slope;
1630 priv_ops->rfbus_req = ar5008_hw_rfbus_req; 1618 priv_ops->rfbus_req = ar5008_hw_rfbus_req;
1631 priv_ops->rfbus_done = ar5008_hw_rfbus_done; 1619 priv_ops->rfbus_done = ar5008_hw_rfbus_done;
1632 priv_ops->enable_rfkill = ar5008_hw_enable_rfkill;
1633 priv_ops->restore_chainmask = ar5008_restore_chainmask; 1620 priv_ops->restore_chainmask = ar5008_restore_chainmask;
1634 priv_ops->set_diversity = ar5008_set_diversity; 1621 priv_ops->set_diversity = ar5008_set_diversity;
1635 priv_ops->do_getnf = ar5008_hw_do_getnf; 1622 priv_ops->do_getnf = ar5008_hw_do_getnf;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 07b44cec7739..8d60f4f09acc 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -745,28 +745,6 @@ static void ar9003_hw_rfbus_done(struct ath_hw *ah)
745 REG_WRITE(ah, AR_PHY_RFBUS_REQ, 0); 745 REG_WRITE(ah, AR_PHY_RFBUS_REQ, 0);
746} 746}
747 747
748/*
749 * Set the interrupt and GPIO values so the ISR can disable RF
750 * on a switch signal. Assumes GPIO port and interrupt polarity
751 * are set prior to call.
752 */
753static void ar9003_hw_enable_rfkill(struct ath_hw *ah)
754{
755 /* Connect rfsilent_bb_l to baseband */
756 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL,
757 AR_GPIO_INPUT_EN_VAL_RFSILENT_BB);
758 /* Set input mux for rfsilent_bb_l to GPIO #0 */
759 REG_CLR_BIT(ah, AR_GPIO_INPUT_MUX2,
760 AR_GPIO_INPUT_MUX2_RFSILENT);
761
762 /*
763 * Configure the desired GPIO port for input and
764 * enable baseband rf silence.
765 */
766 ath9k_hw_cfg_gpio_input(ah, ah->rfkill_gpio);
767 REG_SET_BIT(ah, AR_PHY_TEST, RFSILENT_BB);
768}
769
770static void ar9003_hw_set_diversity(struct ath_hw *ah, bool value) 748static void ar9003_hw_set_diversity(struct ath_hw *ah, bool value)
771{ 749{
772 u32 v = REG_READ(ah, AR_PHY_CCK_DETECT); 750 u32 v = REG_READ(ah, AR_PHY_CCK_DETECT);
@@ -1203,7 +1181,6 @@ void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
1203 priv_ops->set_delta_slope = ar9003_hw_set_delta_slope; 1181 priv_ops->set_delta_slope = ar9003_hw_set_delta_slope;
1204 priv_ops->rfbus_req = ar9003_hw_rfbus_req; 1182 priv_ops->rfbus_req = ar9003_hw_rfbus_req;
1205 priv_ops->rfbus_done = ar9003_hw_rfbus_done; 1183 priv_ops->rfbus_done = ar9003_hw_rfbus_done;
1206 priv_ops->enable_rfkill = ar9003_hw_enable_rfkill;
1207 priv_ops->set_diversity = ar9003_hw_set_diversity; 1184 priv_ops->set_diversity = ar9003_hw_set_diversity;
1208 priv_ops->ani_control = ar9003_hw_ani_control; 1185 priv_ops->ani_control = ar9003_hw_ani_control;
1209 priv_ops->do_getnf = ar9003_hw_do_getnf; 1186 priv_ops->do_getnf = ar9003_hw_do_getnf;
diff --git a/drivers/net/wireless/ath/ath9k/hw-ops.h b/drivers/net/wireless/ath/ath9k/hw-ops.h
index 0a4ad348b699..c8f254fe0f0b 100644
--- a/drivers/net/wireless/ath/ath9k/hw-ops.h
+++ b/drivers/net/wireless/ath/ath9k/hw-ops.h
@@ -223,11 +223,6 @@ static inline void ath9k_hw_rfbus_done(struct ath_hw *ah)
223 return ath9k_hw_private_ops(ah)->rfbus_done(ah); 223 return ath9k_hw_private_ops(ah)->rfbus_done(ah);
224} 224}
225 225
226static inline void ath9k_enable_rfkill(struct ath_hw *ah)
227{
228 return ath9k_hw_private_ops(ah)->enable_rfkill(ah);
229}
230
231static inline void ath9k_hw_restore_chainmask(struct ath_hw *ah) 226static inline void ath9k_hw_restore_chainmask(struct ath_hw *ah)
232{ 227{
233 if (!ath9k_hw_private_ops(ah)->restore_chainmask) 228 if (!ath9k_hw_private_ops(ah)->restore_chainmask)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index ddda76fcd180..4b51ed47fe69 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1385,7 +1385,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1385 ath9k_hw_init_qos(ah); 1385 ath9k_hw_init_qos(ah);
1386 1386
1387 if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT) 1387 if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
1388 ath9k_enable_rfkill(ah); 1388 ath9k_hw_cfg_gpio_input(ah, ah->rfkill_gpio);
1389 1389
1390 ath9k_hw_init_global_settings(ah); 1390 ath9k_hw_init_global_settings(ah);
1391 1391
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 21e37d157d3a..b98053f0640a 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -576,7 +576,6 @@ struct ath_hw_private_ops {
576 void (*set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan); 576 void (*set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan);
577 bool (*rfbus_req)(struct ath_hw *ah); 577 bool (*rfbus_req)(struct ath_hw *ah);
578 void (*rfbus_done)(struct ath_hw *ah); 578 void (*rfbus_done)(struct ath_hw *ah);
579 void (*enable_rfkill)(struct ath_hw *ah);
580 void (*restore_chainmask)(struct ath_hw *ah); 579 void (*restore_chainmask)(struct ath_hw *ah);
581 void (*set_diversity)(struct ath_hw *ah, bool value); 580 void (*set_diversity)(struct ath_hw *ah, bool value);
582 u32 (*compute_pll_control)(struct ath_hw *ah, 581 u32 (*compute_pll_control)(struct ath_hw *ah,