aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2011-02-14 02:01:25 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2011-03-15 01:39:16 -0400
commitb84bb5186297d181075d917e9049da3a3b78d10d (patch)
tree26d63a64d9cfbd01de145c1705e0f0343e1db2ad /drivers/hwmon
parent279af1a91a041070e17cb41900151cb724e1b32a (diff)
hwmon: (w83627ehf) Permit enabling SmartFan IV mode if configured at startup
If SmartFan IV mode was configured at startup, it should be possible to re-enable it later on. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/w83627ehf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 2420f1c6f4e9..2f17f99e0ae1 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -346,7 +346,10 @@ struct w83627ehf_data {
346 2->thermal cruise mode (also called SmartFan I) 346 2->thermal cruise mode (also called SmartFan I)
347 3->fan speed cruise mode 347 3->fan speed cruise mode
348 4->variable thermal cruise (also called 348 4->variable thermal cruise (also called
349 SmartFan III) */ 349 SmartFan III)
350 5->enhanced variable thermal cruise (also called
351 SmartFan IV) */
352 u8 pwm_enable_orig[4]; /* original value of pwm_enable */
350 u8 pwm_num; /* number of pwm */ 353 u8 pwm_num; /* number of pwm */
351 u8 pwm[4]; 354 u8 pwm[4];
352 u8 target_temp[4]; 355 u8 target_temp[4];
@@ -1055,7 +1058,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr,
1055 if (err < 0) 1058 if (err < 0)
1056 return err; 1059 return err;
1057 1060
1058 if (!val || (val > 4)) 1061 if (!val || (val > 4 && val != data->pwm_enable_orig[nr]))
1059 return -EINVAL; 1062 return -EINVAL;
1060 mutex_lock(&data->update_lock); 1063 mutex_lock(&data->update_lock);
1061 reg = w83627ehf_read_value(data, W83627EHF_REG_PWM_ENABLE[nr]); 1064 reg = w83627ehf_read_value(data, W83627EHF_REG_PWM_ENABLE[nr]);
@@ -1617,6 +1620,11 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
1617 /* Read fan clock dividers immediately */ 1620 /* Read fan clock dividers immediately */
1618 w83627ehf_update_fan_div(data); 1621 w83627ehf_update_fan_div(data);
1619 1622
1623 /* Read pwm data to save original values */
1624 w83627ehf_update_pwm_common(dev, data);
1625 for (i = 0; i < data->pwm_num; i++)
1626 data->pwm_enable_orig[i] = data->pwm_enable[i];
1627
1620 /* Register sysfs hooks */ 1628 /* Register sysfs hooks */
1621 for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) { 1629 for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) {
1622 err = device_create_file(dev, &sda_sf3_arrays[i].dev_attr); 1630 err = device_create_file(dev, &sda_sf3_arrays[i].dev_attr);