Commit 880b1b1f authored by Ramona Gradinariu's avatar Ramona Gradinariu Committed by Jonathan Cameron

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: default avatarNuno Sa <nuno.sa@analog.com>
Signed-off-by: default avatarRamona Gradinariu <ramona.bolboaca13@gmail.com>
Link: https://lore.kernel.org/r/20240527142618.275897-5-ramona.bolboaca13@gmail.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent b6e6aca6
...@@ -1207,9 +1207,8 @@ static void adis16475_burst32_check(struct adis16475 *st) ...@@ -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 iio_dev *indio_dev = pf->indio_dev;
struct adis16475 *st = iio_priv(indio_dev); struct adis16475 *st = iio_priv(indio_dev);
struct adis *adis = &st->adis; struct adis *adis = &st->adis;
...@@ -1298,6 +1297,15 @@ static irqreturn_t adis16475_trigger_handler(int irq, void *p) ...@@ -1298,6 +1297,15 @@ static irqreturn_t adis16475_trigger_handler(int irq, void *p)
* array. * array.
*/ */
adis16475_burst32_check(st); 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); iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED; return IRQ_HANDLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment