summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-12-30 19:07:01 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-15 08:10:10 +0100
commitaf770a1558c4415cd4b74cf7bf30e09be7b77a30 (patch)
treea100fcb002325f7d1a5216c987ca108288529ea6 /drivers/iio
parent38d28640db5a3fb63488dabb598e42889868f648 (diff)
downloadlinux-rpi3-af770a1558c4415cd4b74cf7bf30e09be7b77a30.tar.gz
linux-rpi3-af770a1558c4415cd4b74cf7bf30e09be7b77a30.tar.bz2
linux-rpi3-af770a1558c4415cd4b74cf7bf30e09be7b77a30.zip
iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius
commit 0808831dc62e90023ad14ff8da4804c7846e904b upstream. IIO_TEMP scale value for temperature was incorrect and not in millicelsius as required by the ABI documentation. Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Fixes: 27dec00ecf2d (iio: chemical: add Atlas pH-SM sensor support) Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/chemical/atlas-ph-sensor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
index a406ad31b096..3a20cb5d9bff 100644
--- a/drivers/iio/chemical/atlas-ph-sensor.c
+++ b/drivers/iio/chemical/atlas-ph-sensor.c
@@ -444,9 +444,8 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_SCALE:
switch (chan->type) {
case IIO_TEMP:
- *val = 1; /* 0.01 */
- *val2 = 100;
- break;
+ *val = 10;
+ return IIO_VAL_INT;
case IIO_PH:
*val = 1; /* 0.001 */
*val2 = 1000;
@@ -477,7 +476,7 @@ static int atlas_write_raw(struct iio_dev *indio_dev,
int val, int val2, long mask)
{
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)
return -EINVAL;