1 From f214ff521fb1f861c8d7f7d0af98b06bf61b3369 Mon Sep 17 00:00:00 2001
2 From: Dan Murphy <dmurphy@ti.com>
3 Date: Fri, 11 Jan 2019 13:57:07 -0600
4 Subject: iio: ti-ads8688: Update buffer allocation for timestamps
6 From: Dan Murphy <dmurphy@ti.com>
8 commit f214ff521fb1f861c8d7f7d0af98b06bf61b3369 upstream.
10 Per Jonathan Cameron, the buffer needs to allocate room for a
11 64 bit timestamp as well as the channels. Change the buffer
12 to allocate this additional space.
14 Fixes: 2a86487786b5c ("iio: adc: ti-ads8688: add trigger and buffer support")
15 Signed-off-by: Dan Murphy <dmurphy@ti.com>
16 Cc: <Stable@vger.kernel.org>
17 Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 drivers/iio/adc/ti-ads8688.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
24 --- a/drivers/iio/adc/ti-ads8688.c
25 +++ b/drivers/iio/adc/ti-ads8688.c
28 #define ADS8688_VREF_MV 4096
29 #define ADS8688_REALBITS 16
30 +#define ADS8688_MAX_CHANNELS 8
33 * enum ads8688_range - ADS8688 reference voltage range
34 @@ -385,7 +386,7 @@ static irqreturn_t ads8688_trigger_handl
36 struct iio_poll_func *pf = p;
37 struct iio_dev *indio_dev = pf->indio_dev;
39 + u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)];
42 for (i = 0; i < indio_dev->masklength; i++) {