提交 5d2cd958 编写于 作者: J Jean Delvare 提交者: Jean Delvare

hwmon: (w83795) Fix LSB reading of voltage limits

Wrong index caused the wrong register value to be read, resulting in
random LSB for voltage limits.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 21fc9775
...@@ -1405,7 +1405,7 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1405,7 +1405,7 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf)
lsb_idx = IN_LSB_SHIFT_IDX[index][IN_LSB_IDX]; lsb_idx = IN_LSB_SHIFT_IDX[index][IN_LSB_IDX];
val <<= 2; val <<= 2;
val |= (data->in_lsb[lsb_idx][nr] >> val |= (data->in_lsb[lsb_idx][nr] >>
IN_LSB_SHIFT_IDX[lsb_idx][IN_LSB_SHIFT]) & 0x03; IN_LSB_SHIFT_IDX[index][IN_LSB_SHIFT]) & 0x03;
if ((index >= 17) && if ((index >= 17) &&
!((data->has_gain >> (index - 17)) & 1)) !((data->has_gain >> (index - 17)) & 1))
val *= 8; val *= 8;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册