* [PATCH] iio: dac: ad5446: Fix read_raw not returning set value
@ 2022-04-06 10:56 michael.hennerich
2022-04-07 9:10 ` Sa, Nuno
2022-04-10 16:45 ` Jonathan Cameron
0 siblings, 2 replies; 3+ messages in thread
From: michael.hennerich @ 2022-04-06 10:56 UTC (permalink / raw)
To: jic23, lars; +Cc: linux-iio, Michael Hennerich
From: Michael Hennerich <michael.hennerich@analog.com>
read_raw should return the un-scaled value.
Fixes: 5e06bdfb46e8b ("staging:iio:dac:ad5446: Return cached value for 'raw' attribute")
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
drivers/iio/dac/ad5446.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
index 14cfabacbea5..fdf824041497 100644
--- a/drivers/iio/dac/ad5446.c
+++ b/drivers/iio/dac/ad5446.c
@@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev,
switch (m) {
case IIO_CHAN_INFO_RAW:
- *val = st->cached_val;
+ *val = st->cached_val >> chan->scan_type.shift;
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
*val = st->vref_mv;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] iio: dac: ad5446: Fix read_raw not returning set value
2022-04-06 10:56 [PATCH] iio: dac: ad5446: Fix read_raw not returning set value michael.hennerich
@ 2022-04-07 9:10 ` Sa, Nuno
2022-04-10 16:45 ` Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Sa, Nuno @ 2022-04-07 9:10 UTC (permalink / raw)
To: Hennerich, Michael, jic23@kernel.org, lars@metafoo.de
Cc: linux-iio@vger.kernel.org, Hennerich, Michael
> -----Original Message-----
> From: michael.hennerich@analog.com
> <michael.hennerich@analog.com>
> Sent: Wednesday, April 6, 2022 12:56 PM
> To: jic23@kernel.org; lars@metafoo.de
> Cc: linux-iio@vger.kernel.org; Hennerich, Michael
> <Michael.Hennerich@analog.com>
> Subject: [PATCH] iio: dac: ad5446: Fix read_raw not returning set value
>
> [External]
>
> From: Michael Hennerich <michael.hennerich@analog.com>
>
> read_raw should return the un-scaled value.
>
> Fixes: 5e06bdfb46e8b ("staging:iio:dac:ad5446: Return cached value for
> 'raw' attribute")
>
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: dac: ad5446: Fix read_raw not returning set value
2022-04-06 10:56 [PATCH] iio: dac: ad5446: Fix read_raw not returning set value michael.hennerich
2022-04-07 9:10 ` Sa, Nuno
@ 2022-04-10 16:45 ` Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2022-04-10 16:45 UTC (permalink / raw)
To: michael.hennerich; +Cc: lars, linux-iio
On Wed, 6 Apr 2022 12:56:20 +0200
<michael.hennerich@analog.com> wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
>
> read_raw should return the un-scaled value.
>
> Fixes: 5e06bdfb46e8b ("staging:iio:dac:ad5446: Return cached value for 'raw' attribute")
Fixes tags are part of the main tag block, so no blank line here.
>
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.
> ---
> drivers/iio/dac/ad5446.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
> index 14cfabacbea5..fdf824041497 100644
> --- a/drivers/iio/dac/ad5446.c
> +++ b/drivers/iio/dac/ad5446.c
> @@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev,
>
> switch (m) {
> case IIO_CHAN_INFO_RAW:
> - *val = st->cached_val;
> + *val = st->cached_val >> chan->scan_type.shift;
> return IIO_VAL_INT;
> case IIO_CHAN_INFO_SCALE:
> *val = st->vref_mv;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-10 16:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-06 10:56 [PATCH] iio: dac: ad5446: Fix read_raw not returning set value michael.hennerich
2022-04-07 9:10 ` Sa, Nuno
2022-04-10 16:45 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox