Linux wireless drivers development
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vasanth@atheros.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>, <Luis.Rodriguez@atheros.com>,
	<Jouni.Malinen@atheros.com>, <ath9k-devel@lists.ath9k.org>
Subject: [PATCH 4/8] ath9k: Move btcoex related data to a separate struct
Date: Wed, 26 Aug 2009 21:08:46 +0530	[thread overview]
Message-ID: <1251301130-10912-5-git-send-email-vasanth@atheros.com> (raw)
In-Reply-To: <1251301130-10912-4-git-send-email-vasanth@atheros.com>

Also define macros for wlanactive and btactive (5 & 6) gpios.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ath9k.h  |    1 +
 drivers/net/wireless/ath/ath9k/btcoex.c |   16 +++++++++++-----
 drivers/net/wireless/ath/ath9k/btcoex.h |    8 ++++++++
 drivers/net/wireless/ath/ath9k/hw.c     |    4 ++--
 drivers/net/wireless/ath/ath9k/hw.h     |    2 --
 5 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 1a8d679..83f2c8f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -611,6 +611,7 @@ struct ath_softc {
 	struct ath_bus_ops *bus_ops;
 	struct ath_beacon_config cur_beacon_conf;
 	struct delayed_work tx_complete_work;
+	struct ath_btcoex_info btcoex_info;
 };
 
 struct ath_wiphy {
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c
index abaf92d..9f19cd1 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.c
+++ b/drivers/net/wireless/ath/ath9k/btcoex.c
@@ -18,6 +18,8 @@
 
 void ath9k_hw_btcoex_init(struct ath_hw *ah)
 {
+	struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info;
+
 	/* connect bt_active to baseband */
 	REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL,
 			(AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF |
@@ -29,16 +31,18 @@ void ath9k_hw_btcoex_init(struct ath_hw *ah)
 	/* Set input mux for bt_active to gpio pin */
 	REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1,
 			AR_GPIO_INPUT_MUX1_BT_ACTIVE,
-			ah->btactive_gpio);
+			btcoex_info->btactive_gpio);
 
 	/* Configure the desired gpio port for input */
-	ath9k_hw_cfg_gpio_input(ah, ah->btactive_gpio);
+	ath9k_hw_cfg_gpio_input(ah, btcoex_info->btactive_gpio);
 }
 
 void ath9k_hw_btcoex_enable(struct ath_hw *ah)
 {
+	struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info;
+
 	/* Configure the desired GPIO port for TX_FRAME output */
-	ath9k_hw_cfg_output(ah, ah->wlanactive_gpio,
+	ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio,
 			    AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
 
 	ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED;
@@ -46,9 +50,11 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah)
 
 void ath9k_hw_btcoex_disable(struct ath_hw *ah)
 {
-	ath9k_hw_set_gpio(ah, ah->wlanactive_gpio, 0);
+	struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info;
+
+	ath9k_hw_set_gpio(ah, btcoex_info->wlanactive_gpio, 0);
 
-	ath9k_hw_cfg_output(ah, ah->wlanactive_gpio,
+	ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio,
 			AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
 
 	ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED;
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h
index 9954280..c80492b 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.h
+++ b/drivers/net/wireless/ath/ath9k/btcoex.h
@@ -17,6 +17,14 @@
 #ifndef BTCOEX_H
 #define BTCOEX_H
 
+#define ATH_WLANACTIVE_GPIO	5
+#define ATH_BTACTIVE_GPIO	6
+
+struct ath_btcoex_info {
+	u8 wlanactive_gpio;
+	u8 btactive_gpio;
+};
+
 void ath9k_hw_btcoex_init(struct ath_hw *ah);
 void ath9k_hw_btcoex_enable(struct ath_hw *ah);
 void ath9k_hw_btcoex_disable(struct ath_hw *ah);
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index d7e03f9..3bb6abd 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -3666,8 +3666,8 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
 
 	if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) {
 		pCap->hw_caps |= ATH9K_HW_CAP_BT_COEX;
-		ah->btactive_gpio = 6;
-		ah->wlanactive_gpio = 5;
+		ah->ah_sc->btcoex_info.btactive_gpio = ATH_BTACTIVE_GPIO;
+		ah->ah_sc->btcoex_info.wlanactive_gpio = ATH_WLANACTIVE_GPIO;
 	}
 }
 
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 32f7c4b..259936c 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -414,8 +414,6 @@ struct ath_hw {
 	u16 rfsilent;
 	u32 rfkill_gpio;
 	u32 rfkill_polarity;
-	u32 btactive_gpio;
-	u32 wlanactive_gpio;
 	u32 ah_flags;
 
 	bool htc_reset_init;
-- 
1.5.5.1


  reply	other threads:[~2009-08-26 15:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 15:38 [PATCH 0/8] ath9k: WLAN-BT coexistence clean up and 3-wire support Vasanthakumar Thiagarajan
2009-08-26 15:38 ` [PATCH 1/8] ath9k: Split ath9k_hw_btcoex_enable() into two logical pieces Vasanthakumar Thiagarajan
2009-08-26 15:38   ` [PATCH 2/8] ath9k: Move btcoex stuff from hw.[ch] to new btcoex.[ch] Vasanthakumar Thiagarajan
2009-08-26 15:38     ` [PATCH 3/8] ath9k: Configure btcoex register during every reset Vasanthakumar Thiagarajan
2009-08-26 15:38       ` Vasanthakumar Thiagarajan [this message]
2009-08-26 15:38         ` [PATCH 5/8] ath9k: Determine btcoex scheme type based on chip version Vasanthakumar Thiagarajan
2009-08-26 15:38           ` [PATCH 6/8] ath9k: Remove hw capability bit meant for btcoex Vasanthakumar Thiagarajan
2009-08-26 15:38             ` [PATCH 7/8] ath9k: Add infrastructure for generic hw timers Vasanthakumar Thiagarajan
2009-08-26 15:38               ` [PATCH 8/8] ath9k: Add Bluetooth Coexistence 3-wire support Vasanthakumar Thiagarajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251301130-10912-5-git-send-email-vasanth@atheros.com \
    --to=vasanth@atheros.com \
    --cc=Jouni.Malinen@atheros.com \
    --cc=Luis.Rodriguez@atheros.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox