Skip to contentSkip to conversation

patch "iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to" added to staging-linus

PATCH [email protected] 1 participant 1 message Feb 3, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

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

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 0808831dc62e90023ad14ff8da4804c7846e904b Mon Sep 17 00:00:00 2001
From: Matt Ranostay <[email protected]>
Date: Sun, 30 Dec 2018 19:07:01 -0800
Subject: iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to
millicelsius

IIO_TEMP scale value for temperature was incorrect and not in millicelsius as required by the ABI documentation.

Fixes 27dec00ecf2d (iio: chemical: add Atlas pH-SM sensor support)
---
 drivers/iio/chemical/atlas-ph-sensor.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/iio/chemical/atlas-ph-sensor.c +3 -4
index a406ad31b096..3a20cb5d9bff 100644
@@ -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;
Signature · 1 line
2.20.1