Linux 5.9.7
[linux/fpc-iii.git] / drivers / iio / iio_core_trigger.h
blob9d1a92cc648042292edbea9497f629b2c07923e3
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* The industrial I/O core, trigger consumer handling functions
5 * Copyright (c) 2008 Jonathan Cameron
6 */
8 #ifdef CONFIG_IIO_TRIGGER
9 /**
10 * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
11 * @indio_dev: iio_dev associated with the device that will consume the trigger
12 **/
13 void iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
15 /**
16 * iio_device_unregister_trigger_consumer() - reverse the registration process
17 * @indio_dev: iio_dev associated with the device that consumed the trigger
18 **/
19 void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
22 int iio_trigger_attach_poll_func(struct iio_trigger *trig,
23 struct iio_poll_func *pf);
24 int iio_trigger_detach_poll_func(struct iio_trigger *trig,
25 struct iio_poll_func *pf);
27 #else
29 /**
30 * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
31 * @indio_dev: iio_dev associated with the device that will consume the trigger
32 **/
33 static int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
35 return 0;
38 /**
39 * iio_device_unregister_trigger_consumer() - reverse the registration process
40 * @indio_dev: iio_dev associated with the device that consumed the trigger
41 **/
42 static void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
46 static inline int iio_trigger_attach_poll_func(struct iio_trigger *trig,
47 struct iio_poll_func *pf)
49 return 0;
51 static inline int iio_trigger_detach_poll_func(struct iio_trigger *trig,
52 struct iio_poll_func *pf)
54 return 0;
57 #endif /* CONFIG_TRIGGER_CONSUMER */