Skip to content

Commit

Permalink
iio: ti-ads8688: Update buffer allocation for timestamps
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Murphy authored and Jonathan Cameron committed Jan 12, 2019
1 parent b119d3b commit f214ff5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/iio/adc/ti-ads8688.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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++) {
Expand Down

0 comments on commit f214ff5

Please sign in to comment.