diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-09-14 04:43:07 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-09-14 06:55:05 -0400 |
commit | cd5bd3df1a6e7a68454734fb109c409101c20f42 (patch) | |
tree | 9cb608bbc5f3057aee103718041e16fa3523a98c /drivers/hwmon | |
parent | 40257b953fdd519c743138f3fbe3962d54991116 (diff) |
hwmon: (coretemp) Initialize tmin
ttarget is initialized when the driver is loaded, but tmin is not.
As a result, tempX_max_hyst attributes read 0. Fix this.
Also use THERM_*_THRESHOLD* constants in these initializations instead
of hard-coding the constants.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/coretemp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 59d83e83da7f..411257676133 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -601,7 +601,12 @@ static int create_core_data(struct platform_data *pdata, | |||
601 | err = rdmsr_safe_on_cpu(cpu, tdata->intrpt_reg, &eax, &edx); | 601 | err = rdmsr_safe_on_cpu(cpu, tdata->intrpt_reg, &eax, &edx); |
602 | if (!err) { | 602 | if (!err) { |
603 | tdata->attr_size += MAX_THRESH_ATTRS; | 603 | tdata->attr_size += MAX_THRESH_ATTRS; |
604 | tdata->ttarget = tdata->tjmax - ((eax >> 16) & 0x7f) * 1000; | 604 | tdata->tmin = tdata->tjmax - |
605 | ((eax & THERM_MASK_THRESHOLD0) >> | ||
606 | THERM_SHIFT_THRESHOLD0) * 1000; | ||
607 | tdata->ttarget = tdata->tjmax - | ||
608 | ((eax & THERM_MASK_THRESHOLD1) >> | ||
609 | THERM_SHIFT_THRESHOLD1) * 1000; | ||
605 | } | 610 | } |
606 | 611 | ||
607 | pdata->core_data[attr_no] = tdata; | 612 | pdata->core_data[attr_no] = tdata; |