Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 
0003 /* The industrial I/O core, trigger consumer handling functions
0004  *
0005  * Copyright (c) 2008 Jonathan Cameron
0006  */
0007 
0008 #ifdef CONFIG_IIO_TRIGGER
0009 /**
0010  * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
0011  * @indio_dev: iio_dev associated with the device that will consume the trigger
0012  *
0013  * Return 0 if successful, negative otherwise
0014  **/
0015 int iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
0016 
0017 /**
0018  * iio_device_unregister_trigger_consumer() - reverse the registration process
0019  * @indio_dev: iio_dev associated with the device that consumed the trigger
0020  **/
0021 void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
0022 
0023 
0024 int iio_trigger_attach_poll_func(struct iio_trigger *trig,
0025                  struct iio_poll_func *pf);
0026 int iio_trigger_detach_poll_func(struct iio_trigger *trig,
0027                  struct iio_poll_func *pf);
0028 
0029 #else
0030 
0031 /**
0032  * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
0033  * @indio_dev: iio_dev associated with the device that will consume the trigger
0034  **/
0035 static inline int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
0036 {
0037     return 0;
0038 }
0039 
0040 /**
0041  * iio_device_unregister_trigger_consumer() - reverse the registration process
0042  * @indio_dev: iio_dev associated with the device that consumed the trigger
0043  **/
0044 static inline void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
0045 {
0046 }
0047 
0048 static inline int iio_trigger_attach_poll_func(struct iio_trigger *trig,
0049                            struct iio_poll_func *pf)
0050 {
0051     return 0;
0052 }
0053 static inline int iio_trigger_detach_poll_func(struct iio_trigger *trig,
0054                            struct iio_poll_func *pf)
0055 {
0056     return 0;
0057 }
0058 
0059 #endif /* CONFIG_TRIGGER_CONSUMER */