Commit af770a15 authored by Matt Ranostay's avatar Matt Ranostay Committed by Greg Kroah-Hartman

iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius

commit 0808831d upstream.

IIO_TEMP scale value for temperature was incorrect and not in millicelsius
as required by the ABI documentation.
Signed-off-by: default avatarMatt Ranostay <matt.ranostay@konsulko.com>
Fixes: 27dec00e (iio: chemical: add Atlas pH-SM sensor support)
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 38d28640
...@@ -444,9 +444,8 @@ static int atlas_read_raw(struct iio_dev *indio_dev, ...@@ -444,9 +444,8 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_SCALE: case IIO_CHAN_INFO_SCALE:
switch (chan->type) { switch (chan->type) {
case IIO_TEMP: case IIO_TEMP:
*val = 1; /* 0.01 */ *val = 10;
*val2 = 100; return IIO_VAL_INT;
break;
case IIO_PH: case IIO_PH:
*val = 1; /* 0.001 */ *val = 1; /* 0.001 */
*val2 = 1000; *val2 = 1000;
...@@ -477,7 +476,7 @@ static int atlas_write_raw(struct iio_dev *indio_dev, ...@@ -477,7 +476,7 @@ static int atlas_write_raw(struct iio_dev *indio_dev,
int val, int val2, long mask) int val, int val2, long mask)
{ {
struct atlas_data *data = iio_priv(indio_dev); struct atlas_data *data = iio_priv(indio_dev);
__be32 reg = cpu_to_be32(val); __be32 reg = cpu_to_be32(val / 10);
if (val2 != 0 || val < 0 || val > 20000) if (val2 != 0 || val < 0 || val > 20000)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment