1 /* The industrial I/O core, trigger consumer functions
3 * Copyright (c) 2008-2011 Jonathan Cameron
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
11 * struct iio_poll_func - poll function pair
13 * @indio_dev: data specific to device (passed into poll func)
14 * @h: the function that is actually run on trigger
15 * @thread: threaded interrupt part
16 * @type: the type of interrupt (basically if oneshot)
17 * @name: name used to identify the trigger consumer.
18 * @irq: the corresponding irq as allocated from the
20 * @timestamp: some devices need a timestamp grabbed as soon
21 * as possible after the trigger - hence handler
24 struct iio_poll_func
{
25 struct iio_dev
*indio_dev
;
26 irqreturn_t (*h
)(int irq
, void *p
);
27 irqreturn_t (*thread
)(int irq
, void *p
);
36 *iio_alloc_pollfunc(irqreturn_t (*h
)(int irq
, void *p
),
37 irqreturn_t (*thread
)(int irq
, void *p
),
39 struct iio_dev
*indio_dev
,
42 void iio_dealloc_pollfunc(struct iio_poll_func
*pf
);
43 irqreturn_t
iio_pollfunc_store_time(int irq
, void *p
);
45 void iio_trigger_notify_done(struct iio_trigger
*trig
);
48 * Two functions for common case where all that happens is a pollfunc
49 * is attached and detached from a trigger
51 int iio_triggered_buffer_postenable(struct iio_dev
*indio_dev
);
52 int iio_triggered_buffer_predisable(struct iio_dev
*indio_dev
);