diff options
author | Brian Carnes <bmcarnes@gmail.com> | 2013-12-12 02:05:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-20 10:45:07 -0500 |
commit | d6eb2d04bb8bcf9c899630fee2072477096c7599 (patch) | |
tree | 789b1a2a04680cae3e618e8d7f953b752abf99e2 /drivers/hwmon | |
parent | d4fa5279d77716bdcadcefee942629433ae45554 (diff) |
hwmon: (w83l786ng) Fix fan speed control mode setting and reporting
commit cf7559bc053471f32373d71d04a9aa19e0b48d59 upstream.
The wrong mask is used, which causes some fan speed control modes
(pwmX_enable) to be incorrectly reported, and some modes to be
impossible to set.
[JD: add subject and description.]
Signed-off-by: Brian Carnes <bmcarnes@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/w83l786ng.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/w83l786ng.c b/drivers/hwmon/w83l786ng.c index edb06cda5a68..f190219fa84d 100644 --- a/drivers/hwmon/w83l786ng.c +++ b/drivers/hwmon/w83l786ng.c | |||
@@ -510,7 +510,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr, | |||
510 | mutex_lock(&data->update_lock); | 510 | mutex_lock(&data->update_lock); |
511 | reg = w83l786ng_read_value(client, W83L786NG_REG_FAN_CFG); | 511 | reg = w83l786ng_read_value(client, W83L786NG_REG_FAN_CFG); |
512 | data->pwm_enable[nr] = val; | 512 | data->pwm_enable[nr] = val; |
513 | reg &= ~(0x02 << W83L786NG_PWM_ENABLE_SHIFT[nr]); | 513 | reg &= ~(0x03 << W83L786NG_PWM_ENABLE_SHIFT[nr]); |
514 | reg |= (val - 1) << W83L786NG_PWM_ENABLE_SHIFT[nr]; | 514 | reg |= (val - 1) << W83L786NG_PWM_ENABLE_SHIFT[nr]; |
515 | w83l786ng_write_value(client, W83L786NG_REG_FAN_CFG, reg); | 515 | w83l786ng_write_value(client, W83L786NG_REG_FAN_CFG, reg); |
516 | mutex_unlock(&data->update_lock); | 516 | mutex_unlock(&data->update_lock); |
@@ -776,7 +776,7 @@ static struct w83l786ng_data *w83l786ng_update_device(struct device *dev) | |||
776 | ((pwmcfg >> W83L786NG_PWM_MODE_SHIFT[i]) & 1) | 776 | ((pwmcfg >> W83L786NG_PWM_MODE_SHIFT[i]) & 1) |
777 | ? 0 : 1; | 777 | ? 0 : 1; |
778 | data->pwm_enable[i] = | 778 | data->pwm_enable[i] = |
779 | ((pwmcfg >> W83L786NG_PWM_ENABLE_SHIFT[i]) & 2) + 1; | 779 | ((pwmcfg >> W83L786NG_PWM_ENABLE_SHIFT[i]) & 3) + 1; |
780 | data->pwm[i] = w83l786ng_read_value(client, | 780 | data->pwm[i] = w83l786ng_read_value(client, |
781 | W83L786NG_REG_PWM[i]); | 781 | W83L786NG_REG_PWM[i]); |
782 | } | 782 | } |