Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b4df95dccdd2c6a573c9dedefb747ed663c074d Commit: 4b4df95dccdd2c6a573c9dedefb747ed663c074d Parent: 050ab8789869eabb6b2e066aca0d13d86013c315 Author: Jean Delvare <[EMAIL PROTECTED]> AuthorDate: Mon Dec 3 23:23:21 2007 +0100 Committer: Mark M. Hoffman <[EMAIL PROTECTED]> CommitDate: Thu Feb 7 20:39:43 2008 -0500
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 <[EMAIL PROTECTED]> Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]> --- 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 a02480b..194b8fb 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 { int nr = to_sensor_dev_attr(attr)->index; struct lm85_data *data = lm85_update_device(dev); - int pwm_zone; + int pwm_zone, enable; pwm_zone = ZONE_FROM_REG(data->autofan[nr].config); - return sprintf(buf,"%d\n", (pwm_zone != 0 && pwm_zone != -1) ); + switch (pwm_zone) { + case -1: /* PWM is always at 100% */ + enable = 0; + break; + case 0: /* PWM is always at 0% */ + case -2: /* PWM responds to manual control */ + enable = 1; + break; + default: /* PWM in automatic mode */ + enable = 2; + } + return sprintf(buf, "%d\n", enable); } #define show_pwm_reg(offset) \ - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html