iio_core_trigger.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. * Return 0 if successful, negative otherwise
  12. **/
  13. int iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
  14. /**
  15. * iio_device_unregister_trigger_consumer() - reverse the registration process
  16. * @indio_dev: iio_dev associated with the device that consumed the trigger
  17. **/
  18. void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
  19. int iio_trigger_attach_poll_func(struct iio_trigger *trig,
  20. struct iio_poll_func *pf);
  21. int iio_trigger_detach_poll_func(struct iio_trigger *trig,
  22. struct iio_poll_func *pf);
  23. #else
  24. /**
  25. * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
  26. * @indio_dev: iio_dev associated with the device that will consume the trigger
  27. **/
  28. static inline int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
  29. {
  30. return 0;
  31. }
  32. /**
  33. * iio_device_unregister_trigger_consumer() - reverse the registration process
  34. * @indio_dev: iio_dev associated with the device that consumed the trigger
  35. **/
  36. static inline void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
  37. {
  38. }
  39. static inline int iio_trigger_attach_poll_func(struct iio_trigger *trig,
  40. struct iio_poll_func *pf)
  41. {
  42. return 0;
  43. }
  44. static inline int iio_trigger_detach_poll_func(struct iio_trigger *trig,
  45. struct iio_poll_func *pf)
  46. {
  47. return 0;
  48. }
  49. #endif /* CONFIG_TRIGGER_CONSUMER */