提交 6f9dfd85 编写于 作者: J Jean Delvare 提交者: Jean Delvare

hwmon: (w83795) Fix in17-in20 gain factor

Gain bit set means 1x gain and cleared means 8x gain, not the other
way around.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 80646b95
......@@ -1335,7 +1335,7 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf)
case IN_READ:
/* calculate this value again by sensors as sensors3.conf */
if ((index >= 17) &&
((data->has_gain >> (index - 17)) & 1))
!((data->has_gain >> (index - 17)) & 1))
val *= 8;
break;
case IN_MAX:
......@@ -1345,7 +1345,7 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf)
val |= (data->in_lsb[lsb_idx][nr] >>
IN_LSB_SHIFT_IDX[lsb_idx][IN_LSB_SHIFT]) & 0x03;
if ((index >= 17) &&
((data->has_gain >> (index - 17)) & 1))
!((data->has_gain >> (index - 17)) & 1))
val *= 8;
break;
}
......@@ -1373,7 +1373,7 @@ store_in(struct device *dev, struct device_attribute *attr,
val = in_to_reg(index, val);
if ((index >= 17) &&
((data->has_gain >> (index - 17)) & 1))
!((data->has_gain >> (index - 17)) & 1))
val /= 8;
val = SENSORS_LIMIT(val, 0, 0x3FF);
mutex_lock(&data->update_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册