Re: [PATCH] iio: dac: ad5446: Fix read_raw not returning set value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 6 Apr 2022 12:56:20 +0200
<michael.hennerich@xxxxxxxxxx> wrote:

> From: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>

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;




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux