Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad7768-1: remove switch to one-shot mode

wideband low ripple FIR Filter is not available in one-shot mode. In
order to make direct reads work for all filter options, remove the
switch for one-shot mode and guarantee device is always in continuous
conversion mode.

Fixes: fb1d3b24ebf5 ("iio: adc: ad7768-1: add filter type and oversampling ratio attributes")
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Jonathan Santos and committed by
Jonathan Cameron
81fdc312 8be19e23

+4 -17
+4 -17
drivers/iio/adc/ad7768-1.c
··· 463 463 struct ad7768_state *st = iio_priv(indio_dev); 464 464 int readval, ret; 465 465 466 - ret = ad7768_set_mode(st, AD7768_ONE_SHOT); 467 - if (ret < 0) 468 - return ret; 469 - 470 466 reinit_completion(&st->completion); 471 - 472 - /* One-shot mode requires a SYNC pulse to generate a new sample */ 473 - ret = ad7768_send_sync_pulse(st); 474 - if (ret) 475 - return ret; 476 467 477 468 ret = wait_for_completion_timeout(&st->completion, 478 469 msecs_to_jiffies(1000)); ··· 482 491 */ 483 492 if (st->oversampling_ratio == 8) 484 493 readval >>= 8; 485 - 486 - /* 487 - * Any SPI configuration of the AD7768-1 can only be 488 - * performed in continuous conversion mode. 489 - */ 490 - ret = ad7768_set_mode(st, AD7768_CONTINUOUS); 491 - if (ret < 0) 492 - return ret; 493 494 494 495 return readval; 495 496 } ··· 1230 1247 if (ret) 1231 1248 return ret; 1232 1249 } 1250 + 1251 + ret = ad7768_set_mode(st, AD7768_CONTINUOUS); 1252 + if (ret) 1253 + return ret; 1233 1254 1234 1255 /* For backwards compatibility, try the adi,sync-in-gpios property */ 1235 1256 st->gpio_sync_in = devm_gpiod_get_optional(&st->spi->dev, "adi,sync-in",