Commit 2f3f7f9c authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by Reinette Chatre

iwlwifi: Generic approach to measure temperature

In stead of checking for 4965 and do KELVIN_TO_CELSIUS conversation, add
.cfg parameter for more generic approach.
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent ed1b6e99
...@@ -2258,6 +2258,7 @@ struct iwl_cfg iwl4965_agn_cfg = { ...@@ -2258,6 +2258,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
.chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS, .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.temperature_kelvin = true,
}; };
/* Module firmware */ /* Module firmware */
......
...@@ -305,6 +305,7 @@ struct iwl_cfg { ...@@ -305,6 +305,7 @@ struct iwl_cfg {
s32 chain_noise_scale; s32 chain_noise_scale;
/* timer period for monitor the driver queues */ /* timer period for monitor the driver queues */
u32 monitor_recover_period; u32 monitor_recover_period;
bool temperature_kelvin;
}; };
/*************************** /***************************
......
...@@ -383,10 +383,10 @@ EXPORT_SYMBOL(iwl_ht_enabled); ...@@ -383,10 +383,10 @@ EXPORT_SYMBOL(iwl_ht_enabled);
bool iwl_within_ct_kill_margin(struct iwl_priv *priv) bool iwl_within_ct_kill_margin(struct iwl_priv *priv)
{ {
s32 temp = priv->temperature; /* degrees CELSIUS except 4965 */ s32 temp = priv->temperature; /* degrees CELSIUS except specified */
bool within_margin = false; bool within_margin = false;
if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) if (priv->cfg->temperature_kelvin)
temp = KELVIN_TO_CELSIUS(priv->temperature); temp = KELVIN_TO_CELSIUS(priv->temperature);
if (!priv->thermal_throttle.advanced_tt) if (!priv->thermal_throttle.advanced_tt)
...@@ -839,12 +839,12 @@ EXPORT_SYMBOL(iwl_tt_exit_ct_kill); ...@@ -839,12 +839,12 @@ EXPORT_SYMBOL(iwl_tt_exit_ct_kill);
static void iwl_bg_tt_work(struct work_struct *work) static void iwl_bg_tt_work(struct work_struct *work)
{ {
struct iwl_priv *priv = container_of(work, struct iwl_priv, tt_work); struct iwl_priv *priv = container_of(work, struct iwl_priv, tt_work);
s32 temp = priv->temperature; /* degrees CELSIUS except 4965 */ s32 temp = priv->temperature; /* degrees CELSIUS except specified */
if (test_bit(STATUS_EXIT_PENDING, &priv->status)) if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return; return;
if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) if (priv->cfg->temperature_kelvin)
temp = KELVIN_TO_CELSIUS(priv->temperature); temp = KELVIN_TO_CELSIUS(priv->temperature);
if (!priv->thermal_throttle.advanced_tt) if (!priv->thermal_throttle.advanced_tt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment