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
commit76bc284080a8554f70eb41cb54a33d97391de27f (patch)
tree2448f55ade30bd3d87a3f29dc92b01ab52d5c711
parent8c57d0c9512614fa400533a831f1682d747ae581 (diff)
iio: ti-ads8688: Update buffer allocation for timestamps
-rw-r--r--patches.kernel.org/4.20.9-009-iio-ti-ads8688-Update-buffer-allocation-for-ti.patch47
-rw-r--r--series.conf1
2 files changed, 48 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.9-009-iio-ti-ads8688-Update-buffer-allocation-for-ti.patch b/patches.kernel.org/4.20.9-009-iio-ti-ads8688-Update-buffer-allocation-for-ti.patch
new file mode 100644
index 0000000000..d1135ba9bc
--- /dev/null
+++ b/patches.kernel.org/4.20.9-009-iio-ti-ads8688-Update-buffer-allocation-for-ti.patch
@@ -0,0 +1,47 @@
+From: Dan Murphy <dmurphy@ti.com>
+Date: Fri, 11 Jan 2019 13:57:07 -0600
+Subject: [PATCH] iio: ti-ads8688: Update buffer allocation for timestamps
+References: bnc#1012628
+Patch-mainline: 4.20.9
+Git-commit: f214ff521fb1f861c8d7f7d0af98b06bf61b3369
+
+commit f214ff521fb1f861c8d7f7d0af98b06bf61b3369 upstream.
+
+Per Jonathan Cameron, the buffer needs to allocate room for a
+64 bit timestamp as well as the channels. Change the buffer
+to allocate this additional space.
+
+Fixes: 2a86487786b5c ("iio: adc: ti-ads8688: add trigger and buffer support")
+Signed-off-by: Dan Murphy <dmurphy@ti.com>
+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/adc/ti-ads8688.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/iio/adc/ti-ads8688.c b/drivers/iio/adc/ti-ads8688.c
+index 184d686ebd99..8b4568edd5cb 100644
+--- a/drivers/iio/adc/ti-ads8688.c
++++ b/drivers/iio/adc/ti-ads8688.c
+@@ -41,6 +41,7 @@
+
+ #define ADS8688_VREF_MV 4096
+ #define ADS8688_REALBITS 16
++#define ADS8688_MAX_CHANNELS 8
+
+ /*
+ * enum ads8688_range - ADS8688 reference voltage range
+@@ -385,7 +386,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)
+ {
+ struct iio_poll_func *pf = p;
+ struct iio_dev *indio_dev = pf->indio_dev;
+- u16 buffer[8];
++ u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)];
+ int i, j = 0;
+
+ for (i = 0; i < indio_dev->masklength; i++) {
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 1cca143c30..87e20e5d8c 100644
--- a/series.conf
+++ b/series.conf
@@ -1091,6 +1091,7 @@
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
+ patches.kernel.org/4.20.9-009-iio-ti-ads8688-Update-buffer-allocation-for-ti.patch
########################################################
# Build fixes that apply to the vanilla kernel too.