* [PATCH] iio: adc: rtq6056: Correct the sign bit index
@ 2025-09-18 3:10 cy_huang
2025-09-18 12:45 ` David Lechner
0 siblings, 1 reply; 3+ messages in thread
From: cy_huang @ 2025-09-18 3:10 UTC (permalink / raw)
To: Jonathan Cameron
Cc: David Lechner, Nuno Sá, Andy Shevchenko, ChiYuan Huang,
linux-iio, linux-kernel, Andy Hsu
From: ChiYuan Huang <cy_huang@richtek.com>
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>
---
Hi, Andy:
Thanks for reporting the value convert issue.
---
drivers/iio/adc/rtq6056.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/rtq6056.c b/drivers/iio/adc/rtq6056.c
index ad9738228b7f..2bf3a09ac6b0 100644
--- a/drivers/iio/adc/rtq6056.c
+++ b/drivers/iio/adc/rtq6056.c
@@ -300,7 +300,7 @@ static int rtq6056_adc_read_channel(struct rtq6056_priv *priv,
return IIO_VAL_INT;
case RTQ6056_REG_SHUNTVOLT:
case RTQ6056_REG_CURRENT:
- *val = sign_extend32(regval, 16);
+ *val = sign_extend32(regval, 15);
return IIO_VAL_INT;
default:
return -EINVAL;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: adc: rtq6056: Correct the sign bit index
2025-09-18 3:10 [PATCH] iio: adc: rtq6056: Correct the sign bit index cy_huang
@ 2025-09-18 12:45 ` David Lechner
2025-09-20 10:58 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: David Lechner @ 2025-09-18 12:45 UTC (permalink / raw)
To: cy_huang, Jonathan Cameron
Cc: Nuno Sá, Andy Shevchenko, linux-iio, linux-kernel, Andy Hsu
On 9/17/25 10:10 PM, cy_huang@richtek.com wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
>
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: adc: rtq6056: Correct the sign bit index
2025-09-18 12:45 ` David Lechner
@ 2025-09-20 10:58 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2025-09-20 10:58 UTC (permalink / raw)
To: David Lechner
Cc: cy_huang, Nuno Sá, Andy Shevchenko, linux-iio, linux-kernel,
Andy Hsu
On Thu, 18 Sep 2025 07:45:03 -0500
David Lechner <dlechner@baylibre.com> wrote:
> On 9/17/25 10:10 PM, cy_huang@richtek.com wrote:
> > From: ChiYuan Huang <cy_huang@richtek.com>
> >
> > 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>
>
>
Hi.
I'm not planning to do another fixes pull before the merge
window, so I've queued this up for early next cycle and marked
it for stable so it will get backported.
Thanks
Jonathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-20 10:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 3:10 [PATCH] iio: adc: rtq6056: Correct the sign bit index cy_huang
2025-09-18 12:45 ` David Lechner
2025-09-20 10:58 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox