Skip to content

Commit

Permalink
iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius
Browse files Browse the repository at this point in the history
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: 27dec00 (iio: chemical: add Atlas pH-SM sensor support)
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Matt Ranostay authored and Jonathan Cameron committed Jan 12, 2019
1 parent 06382de commit 0808831
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/iio/chemical/atlas-ph-sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0808831

Please sign in to comment.