Skip to content

Commit

Permalink
iio: dac: ltc2688: fix voltage scale read
Browse files Browse the repository at this point in the history
Properly set *val2 (and not overwrite *val) to correctly return
IIO_VAL_FRACTIONAL_LOG2.

Fixes: 832cb9e ("iio: dac: add support for ltc2688")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220412124916.61-1-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Nuno Sá authored and Jonathan Cameron committed Apr 16, 2022
1 parent de3b9fe commit e7e51eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/dac/ltc2688.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static int ltc2688_read_raw(struct iio_dev *indio_dev,
if (ret)
return ret;

*val = 16;
*val2 = 16;
return IIO_VAL_FRACTIONAL_LOG2;
case IIO_CHAN_INFO_CALIBBIAS:
ret = regmap_read(st->regmap,
Expand Down

0 comments on commit e7e51eb

Please sign in to comment.