summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-05-21 13:44:23 -0700
committerJohn W. Linville <linville@tuxdriver.com>2009-05-22 14:06:03 -0400
commit62161aefa403a3f8d603b061f5688cf00928a2cc (patch)
treee4b6a51b9d25b2e068e299a972adb8b8fdd1367f /drivers/net/wireless/iwlwifi/iwl-5000-hw.h
parent2681b20ba2a255ea20a168c0ebe519c40b55e57e (diff)
downloadlinux-stable-62161aefa403a3f8d603b061f5688cf00928a2cc.tar.gz
linux-stable-62161aefa403a3f8d603b061f5688cf00928a2cc.tar.bz2
linux-stable-62161aefa403a3f8d603b061f5688cf00928a2cc.zip
iwlwifi: Temperature sensor voltage reading for 5150
The temperature measurement by uCode for 5150 and 5000 are different CSR_HW_REV_TYPE_5150: temperature sensor output voltage CSR_HW_REV_TYPE_5000: temperature in Celsius temperature related operation for 5150 is measured by temperature sensor output voltage; additional conversion is required for set and store the temperature. To make sure support different HW design; implement _ops method for temperature related functions (temperature reading and set ct kill threshold) Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000-hw.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000-hw.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
index 15cac70e36e2..4ef6804a455a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
@@ -87,6 +87,18 @@
#define IWL50_NUM_AMPDU_QUEUES 10
#define IWL50_FIRST_AMPDU_QUEUE 10
+/* 5150 only */
+#define IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF (-5)
+
+static inline s32 iwl_temp_calib_to_offset(struct iwl_priv *priv)
+{
+ u16 *temp_calib = (u16 *)iwl_eeprom_query_addr(priv,
+ EEPROM_5000_TEMPERATURE);
+ /* offset = temperature - voltage / coef */
+ s32 offset = (s32)(temp_calib[0] - temp_calib[1] / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF);
+ return offset;
+}
+
/* Fixed (non-configurable) rx data from phy */
/**