Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 4396f45d211b ("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>

authored by

ChiYuan Huang and committed by
Jonathan Cameron
9b45744b ffc74ad5

+1 -1
+1 -1
drivers/iio/adc/rtq6056.c
··· 300 300 return IIO_VAL_INT; 301 301 case RTQ6056_REG_SHUNTVOLT: 302 302 case RTQ6056_REG_CURRENT: 303 - *val = sign_extend32(regval, 16); 303 + *val = sign_extend32(regval, 15); 304 304 return IIO_VAL_INT; 305 305 default: 306 306 return -EINVAL;