diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-12-03 17:23:21 -0500 |
---|---|---|
committer | Mark M. Hoffman <mhoffman@lightlink.com> | 2008-02-07 20:39:43 -0500 |
commit | 4b4df95dccdd2c6a573c9dedefb747ed663c074d (patch) | |
tree | f0a35bc10459af78a33ff543650e3024bdd82b91 /drivers/hwmon/lm85.c | |
parent | 050ab8789869eabb6b2e066aca0d13d86013c315 (diff) |
hwmon: (lm85) Return standard values in pwmN_enable
The values returned by the lm85 driver in pwmN_enable sysfs files do
not match the standard. Fix that.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon/lm85.c')
-rw-r--r-- | drivers/hwmon/lm85.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index a02480be65f2..194b8fb52f0e 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c | |||
@@ -519,10 +519,21 @@ static ssize_t show_pwm_enable(struct device *dev, struct device_attribute | |||
519 | { | 519 | { |
520 | int nr = to_sensor_dev_attr(attr)->index; | 520 | int nr = to_sensor_dev_attr(attr)->index; |
521 | struct lm85_data *data = lm85_update_device(dev); | 521 | struct lm85_data *data = lm85_update_device(dev); |
522 | int pwm_zone; | 522 | int pwm_zone, enable; |
523 | 523 | ||
524 | pwm_zone = ZONE_FROM_REG(data->autofan[nr].config); | 524 | pwm_zone = ZONE_FROM_REG(data->autofan[nr].config); |
525 | return sprintf(buf,"%d\n", (pwm_zone != 0 && pwm_zone != -1) ); | 525 | switch (pwm_zone) { |
526 | case -1: /* PWM is always at 100% */ | ||
527 | enable = 0; | ||
528 | break; | ||
529 | case 0: /* PWM is always at 0% */ | ||
530 | case -2: /* PWM responds to manual control */ | ||
531 | enable = 1; | ||
532 | break; | ||
533 | default: /* PWM in automatic mode */ | ||
534 | enable = 2; | ||
535 | } | ||
536 | return sprintf(buf, "%d\n", enable); | ||
526 | } | 537 | } |
527 | 538 | ||
528 | #define show_pwm_reg(offset) \ | 539 | #define show_pwm_reg(offset) \ |