Loading...
1
2/* The industrial I/O core, trigger consumer handling functions
3 *
4 * Copyright (c) 2008 Jonathan Cameron
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.
9 */
10
11#ifdef CONFIG_IIO_TRIGGER
12/**
13 * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
14 * @indio_dev: iio_dev associated with the device that will consume the trigger
15 **/
16void iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
17
18/**
19 * iio_device_unregister_trigger_consumer() - reverse the registration process
20 * @indio_dev: iio_dev associated with the device that consumed the trigger
21 **/
22void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
23
24#else
25
26/**
27 * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
28 * @indio_dev: iio_dev associated with the device that will consume the trigger
29 **/
30static int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
31{
32 return 0;
33}
34
35/**
36 * iio_device_unregister_trigger_consumer() - reverse the registration process
37 * @indio_dev: iio_dev associated with the device that consumed the trigger
38 **/
39static void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
40{
41}
42
43#endif /* CONFIG_TRIGGER_CONSUMER */
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3/* The industrial I/O core, trigger consumer handling functions
4 *
5 * Copyright (c) 2008 Jonathan Cameron
6 */
7
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 * Return 0 if successful, negative otherwise
14 **/
15int iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
16
17/**
18 * iio_device_unregister_trigger_consumer() - reverse the registration process
19 * @indio_dev: iio_dev associated with the device that consumed the trigger
20 **/
21void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
22
23
24int iio_trigger_attach_poll_func(struct iio_trigger *trig,
25 struct iio_poll_func *pf);
26int iio_trigger_detach_poll_func(struct iio_trigger *trig,
27 struct iio_poll_func *pf);
28
29#else
30
31/**
32 * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
33 * @indio_dev: iio_dev associated with the device that will consume the trigger
34 **/
35static inline int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
36{
37 return 0;
38}
39
40/**
41 * iio_device_unregister_trigger_consumer() - reverse the registration process
42 * @indio_dev: iio_dev associated with the device that consumed the trigger
43 **/
44static inline void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
45{
46}
47
48static inline int iio_trigger_attach_poll_func(struct iio_trigger *trig,
49 struct iio_poll_func *pf)
50{
51 return 0;
52}
53static inline int iio_trigger_detach_poll_func(struct iio_trigger *trig,
54 struct iio_poll_func *pf)
55{
56 return 0;
57}
58
59#endif /* CONFIG_TRIGGER_CONSUMER */