Skip to content

Commit f214ff5

Browse files
Dan Murphyjic23
authored andcommitted
iio: ti-ads8688: Update buffer allocation for timestamps
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: 2a86487 ("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>
1 parent b119d3b commit f214ff5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iio/adc/ti-ads8688.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
#define ADS8688_VREF_MV 4096
4343
#define ADS8688_REALBITS 16
44+
#define ADS8688_MAX_CHANNELS 8
4445

4546
/*
4647
* enum ads8688_range - ADS8688 reference voltage range
@@ -385,7 +386,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)
385386
{
386387
struct iio_poll_func *pf = p;
387388
struct iio_dev *indio_dev = pf->indio_dev;
388-
u16 buffer[8];
389+
u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)];
389390
int i, j = 0;
390391

391392
for (i = 0; i < indio_dev->masklength; i++) {

0 commit comments

Comments
 (0)