Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-15 10:23:48 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-15 10:23:55 +0100
commit8c57d0c9512614fa400533a831f1682d747ae581 (patch)
tree05522ae5bae44f4d232ce8b696a6eaf92f2d28bc
parentc325371521eb9e401e026df893a4ca97fab737b6 (diff)
iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to
millicelsius (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.9-008-iio-chemical-atlas-ph-sensor-correct-IIO_TEMP-.patch51
-rw-r--r--series.conf1
2 files changed, 52 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.9-008-iio-chemical-atlas-ph-sensor-correct-IIO_TEMP-.patch b/patches.kernel.org/4.20.9-008-iio-chemical-atlas-ph-sensor-correct-IIO_TEMP-.patch
new file mode 100644
index 0000000000..d82f216230
--- /dev/null
+++ b/patches.kernel.org/4.20.9-008-iio-chemical-atlas-ph-sensor-correct-IIO_TEMP-.patch
@@ -0,0 +1,51 @@
+From: Matt Ranostay <matt.ranostay@konsulko.com>
+Date: Sun, 30 Dec 2018 19:07:01 -0800
+Subject: [PATCH] iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to
+ millicelsius
+References: bnc#1012628
+Patch-mainline: 4.20.9
+Git-commit: 0808831dc62e90023ad14ff8da4804c7846e904b
+
+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>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/iio/chemical/atlas-ph-sensor.c | 7 +++----
+ 1 file 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;
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index fa3468cdb8..1cca143c30 100644
--- a/series.conf
+++ b/series.conf
@@ -1090,6 +1090,7 @@
patches.kernel.org/4.20.9-005-libata-Add-NOLPM-quirk-for-SAMSUNG-MZ7TE512HMH.patch
patches.kernel.org/4.20.9-006-tools-iio-iio_generic_buffer-make-num_loops-si.patch
patches.kernel.org/4.20.9-007-iio-adc-axp288-Fix-TS-pin-handling.patch
+ patches.kernel.org/4.20.9-008-iio-chemical-atlas-ph-sensor-correct-IIO_TEMP-.patch
########################################################
# Build fixes that apply to the vanilla kernel too.