Skip to content

Commit 9b45744

Browse files
ChiYuan Huangjic23
authored andcommitted
iio: adc: rtq6056: Correct the sign bit index
The vshunt/current reported register is a signed 16bit integer. The sign bit index should be '15', not '16'. Fixes: 4396f45 ("iio: adc: Add rtq6056 support") Reported-by: Andy Hsu <andy_ya_hsu@wiwynn.com> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent ffc74ad commit 9b45744

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/adc/rtq6056.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static int rtq6056_adc_read_channel(struct rtq6056_priv *priv,
300300
return IIO_VAL_INT;
301301
case RTQ6056_REG_SHUNTVOLT:
302302
case RTQ6056_REG_CURRENT:
303-
*val = sign_extend32(regval, 16);
303+
*val = sign_extend32(regval, 15);
304304
return IIO_VAL_INT;
305305
default:
306306
return -EINVAL;

0 commit comments

Comments
 (0)