Skip to content

Commit

Permalink
hwmon: (w83795) Fix LSB reading of voltage limits
Browse files Browse the repository at this point in the history
Wrong index caused the wrong register value to be read, resulting in
random LSB for voltage limits.

Signed-off-by: Jean Delvare <[email protected]>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Oct 28, 2010
1 parent 21fc977 commit 5d2cd95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/w83795.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
val <<= 2;
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) &&
!((data->has_gain >> (index - 17)) & 1))
val *= 8;
Expand Down

0 comments on commit 5d2cd95

Please sign in to comment.