1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_IIO_TRIGGERED_BUFFER_H_
3 #define _LINUX_IIO_TRIGGERED_BUFFER_H_
5 #include <linux/iio/buffer.h>
6 #include <linux/interrupt.h>
10 struct iio_buffer_setup_ops
;
12 int iio_triggered_buffer_setup_ext(struct iio_dev
*indio_dev
,
13 irqreturn_t (*h
)(int irq
, void *p
),
14 irqreturn_t (*thread
)(int irq
, void *p
),
15 enum iio_buffer_direction direction
,
16 const struct iio_buffer_setup_ops
*setup_ops
,
17 const struct iio_dev_attr
**buffer_attrs
);
18 void iio_triggered_buffer_cleanup(struct iio_dev
*indio_dev
);
20 #define iio_triggered_buffer_setup(indio_dev, h, thread, setup_ops) \
21 iio_triggered_buffer_setup_ext((indio_dev), (h), (thread), \
22 IIO_BUFFER_DIRECTION_IN, (setup_ops), \
25 int devm_iio_triggered_buffer_setup_ext(struct device
*dev
,
26 struct iio_dev
*indio_dev
,
27 irqreturn_t (*h
)(int irq
, void *p
),
28 irqreturn_t (*thread
)(int irq
, void *p
),
29 enum iio_buffer_direction direction
,
30 const struct iio_buffer_setup_ops
*ops
,
31 const struct iio_dev_attr
**buffer_attrs
);
33 #define devm_iio_triggered_buffer_setup(dev, indio_dev, h, thread, setup_ops) \
34 devm_iio_triggered_buffer_setup_ext((dev), (indio_dev), (h), (thread), \
35 IIO_BUFFER_DIRECTION_IN, \