]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ath9k: Enable btcoex based on the subsystem id of the device
authorVasanthakumar Thiagarajan <vasanth@atheros.com>
Wed, 9 Sep 2009 09:55:50 +0000 (15:25 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 9 Sep 2009 15:25:26 +0000 (11:25 -0400)
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/btcoex.c
drivers/net/wireless/ath/ath9k/btcoex.h
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/hw.h

index e8bfb01ee78a4a276716cac88b4cc90dea7d7e64..55f607b7699e47e08917faf981acc4eaf39047e2 100644 (file)
 static const struct ath_btcoex_config ath_bt_config = { 0, true, true,
                        ATH_BT_COEX_MODE_SLOTTED, true, true, 2, 5, true };
 
+static const u16 ath_subsysid_tbl[] = {
+       AR9280_COEX2WIRE_SUBSYSID,
+       AT9285_COEX3WIRE_SA_SUBSYSID,
+       AT9285_COEX3WIRE_DA_SUBSYSID
+};
+
+/*
+ * Checks the subsystem id of the device to see if it
+ * supports btcoex
+ */
+bool ath_btcoex_supported(u16 subsysid)
+{
+       int i;
+
+       if (!subsysid)
+               return false;
+
+       for (i = 0; i < ARRAY_SIZE(ath_subsysid_tbl); i++)
+               if (subsysid == ath_subsysid_tbl[i])
+                       return true;
+
+       return false;
+}
 
 /*
  * Detects if there is any priority bt traffic
index 45568196c59abc09c1ef1ecb0c4478b438ea2f35..f1baf66e2ecde8b02a893d93bc41242d6c139d3d 100644 (file)
@@ -79,6 +79,7 @@ struct ath_btcoex_info {
        struct ath_gen_timer *no_stomp_timer; /*Timer for no BT stomping*/
 };
 
+bool ath_btcoex_supported(u16 subsysid);
 int 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);
index 97a09dba76de0f0077d721e9d5fdb931c86721e7..8d77817f67a42c762ec12426305be8f8629233d2 100644 (file)
@@ -3690,7 +3690,8 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
        pCap->num_antcfg_2ghz =
                ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ);
 
-       if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) {
+       if (AR_SREV_9280_10_OR_LATER(ah) &&
+           ath_btcoex_supported(ah->hw_version.subsysid)) {
                btcoex_info->btactive_gpio = ATH_BTACTIVE_GPIO;
                btcoex_info->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
 
index 64ea547adef027b5784245254e3145e666f012aa..9106a0b537dd0eee34df9764863192ae89ad9d90 100644 (file)
 #define AR5416_DEVID_AR9287_PCI  0x002D
 #define AR5416_DEVID_AR9287_PCIE 0x002E
 
+#define AR9280_COEX2WIRE_SUBSYSID      0x309b
+#define AT9285_COEX3WIRE_SA_SUBSYSID   0x30aa
+#define AT9285_COEX3WIRE_DA_SUBSYSID   0x30ab
+
 /* Register read/write primitives */
 #define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val))
 #define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg))