Re: [PATCH 4/4] staging:iio:dac:ad5791: Fix scale unit

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

 



On 10/19/11 13:23, Lars-Peter Clausen wrote:
> Scale is currently reported in volts instead of millivolts. This patch fixes it.
> 
> Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
Acked-by: Jonathan Cameron <jic23@xxxxxxxxx>
> ---
>  drivers/staging/iio/dac/ad5791.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c
> index 9ba45f1..6fbca8d 100644
> --- a/drivers/staging/iio/dac/ad5791.c
> +++ b/drivers/staging/iio/dac/ad5791.c
> @@ -239,7 +239,7 @@ static int ad5791_read_raw(struct iio_dev *indio_dev,
>  		return IIO_VAL_INT;
>  	case (1 << IIO_CHAN_INFO_SCALE_SHARED):
>  		*val = 0;
> -		*val2 = (st->vref_mv * 1000) >> chan->scan_type.realbits;
> +		*val2 = (((u64)st->vref_mv) * 1000000ULL) >> chan->scan_type.realbits;
>  		return IIO_VAL_INT_PLUS_MICRO;
>  	case (1 << IIO_CHAN_INFO_OFFSET_SHARED):
>  		val64 = (((u64)st->vref_neg_mv) << chan->scan_type.realbits);

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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