iio: imu: adis16475: Create push single sample API

Create push single sample API reposnsible for pushing a single
sample into the buffer.
This is a preparation patch for FIFO support where more than
one sample has to be pushed in the trigger handler.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Ramona Gradinariu <ramona.bolboaca13@gmail.com>
Link: https://lore.kernel.org/r/20240527142618.275897-5-ramona.bolboaca13@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Ramona Gradinariu
2024-05-27 17:26:13 +03:00
committed by Jonathan Cameron
parent b6e6aca6c2
commit 880b1b1fbe

View File

@@ -1207,9 +1207,8 @@ static void adis16475_burst32_check(struct adis16475 *st)
}
}
static irqreturn_t adis16475_trigger_handler(int irq, void *p)
static int adis16475_push_single_sample(struct iio_poll_func *pf)
{
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct adis16475 *st = iio_priv(indio_dev);
struct adis *adis = &st->adis;
@@ -1298,6 +1297,15 @@ check_burst32:
* array.
*/
adis16475_burst32_check(st);
return ret;
}
static irqreturn_t adis16475_trigger_handler(int irq, void *p)
{
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
adis16475_push_single_sample(pf);
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED;