diff options
author | Alexandru Ardelean <alexandru.ardelean@analog.com> | 2019-03-22 22:44:38 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-04-04 20:20:23 +0100 |
commit | 74878d4fa816443716bd8adf4f9f6986f5c6f256 (patch) | |
tree | 49cc50c9d741d60c53d00ece38151475acb52b75 /drivers/iio/imu/adis16400_buffer.c | |
parent | 9bf1468e9d62c144b91ca9684b91dfc84c3f2a4b (diff) |
iio: imu: adis16400: move trigger handler into adis16400_core
The trigger handler for the ADIS16400 is very different from the generic
one in the ADIS library. Keeping it in a separate file won't make much
sense once the update_scan_mode function will be made more generic and
moved into the ADIS library.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/adis16400_buffer.c')
-rw-r--r-- | drivers/iio/imu/adis16400_buffer.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/drivers/iio/imu/adis16400_buffer.c b/drivers/iio/imu/adis16400_buffer.c index e70a5339acb1..268349eb51c7 100644 --- a/drivers/iio/imu/adis16400_buffer.c +++ b/drivers/iio/imu/adis16400_buffer.c @@ -58,44 +58,3 @@ int adis16400_update_scan_mode(struct iio_dev *indio_dev, return 0; } - -irqreturn_t adis16400_trigger_handler(int irq, void *p) -{ - struct iio_poll_func *pf = p; - struct iio_dev *indio_dev = pf->indio_dev; - struct adis16400_state *st = iio_priv(indio_dev); - struct adis *adis = &st->adis; - u32 old_speed_hz = st->adis.spi->max_speed_hz; - void *buffer; - int ret; - - if (!adis->buffer) - return -ENOMEM; - - if (!(st->variant->flags & ADIS16400_NO_BURST) && - st->adis.spi->max_speed_hz > ADIS16400_SPI_BURST) { - st->adis.spi->max_speed_hz = ADIS16400_SPI_BURST; - spi_setup(st->adis.spi); - } - - ret = spi_sync(adis->spi, &adis->msg); - if (ret) - dev_err(&adis->spi->dev, "Failed to read data: %d\n", ret); - - if (!(st->variant->flags & ADIS16400_NO_BURST)) { - st->adis.spi->max_speed_hz = old_speed_hz; - spi_setup(st->adis.spi); - } - - if (st->variant->flags & ADIS16400_BURST_DIAG_STAT) - buffer = adis->buffer + sizeof(u16); - else - buffer = adis->buffer; - - iio_push_to_buffers_with_timestamp(indio_dev, buffer, - pf->timestamp); - - iio_trigger_notify_done(indio_dev->trig); - - return IRQ_HANDLED; -} |