iio_core_trigger.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* The industrial I/O core, trigger consumer handling functions
  3. *
  4. * Copyright (c) 2008 Jonathan Cameron
  5. */
  6. #ifdef CONFIG_IIO_TRIGGER
  7. /**
  8. * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
  9. * @indio_dev: iio_dev associated with the device that will consume the trigger
  10. **/
  11. void iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
  12. /**
  13. * iio_device_unregister_trigger_consumer() - reverse the registration process
  14. * @indio_dev: iio_dev associated with the device that consumed the trigger
  15. **/
  16. void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
  17. int iio_trigger_attach_poll_func(struct iio_trigger *trig,
  18. struct iio_poll_func *pf);
  19. int iio_trigger_detach_poll_func(struct iio_trigger *trig,
  20. struct iio_poll_func *pf);
  21. #else
  22. /**
  23. * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
  24. * @indio_dev: iio_dev associated with the device that will consume the trigger
  25. **/
  26. static inline int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
  27. {
  28. return 0;
  29. }
  30. /**
  31. * iio_device_unregister_trigger_consumer() - reverse the registration process
  32. * @indio_dev: iio_dev associated with the device that consumed the trigger
  33. **/
  34. static inline void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
  35. {
  36. }
  37. static inline int iio_trigger_attach_poll_func(struct iio_trigger *trig,
  38. struct iio_poll_func *pf)
  39. {
  40. return 0;
  41. }
  42. static inline int iio_trigger_detach_poll_func(struct iio_trigger *trig,
  43. struct iio_poll_func *pf)
  44. {
  45. return 0;
  46. }
  47. #endif /* CONFIG_TRIGGER_CONSUMER */