PageRenderTime 30ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 1ms

/drivers/staging/iio/Documentation/trigger.txt

https://bitbucket.org/wisechild/galaxy-nexus
Plain Text | 38 lines | 26 code | 12 blank | 0 comment | 0 complexity | 152c04c57d85a9275a028bef9137e9d5 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
  1. IIO trigger drivers.
  2. Many triggers are provided by hardware that will also be registered as
  3. an IIO device. Whilst this can create device specific complexities
  4. such triggers are registered with the core in the same way as
  5. stand-alone triggers.
  6. struct iio_trig *trig = iio_allocate_trigger("<trigger format string>", ...);
  7. allocates a trigger structure. The key elements to then fill in within
  8. a driver are:
  9. trig->private_data
  10. Device specific private data.
  11. trig->owner
  12. Typically set to THIS_MODULE. Used to ensure correct
  13. ownership of core allocated resources.
  14. trig->set_trigger_state:
  15. Function that enables / disables the underlying source of the trigger.
  16. There is also a
  17. trig->alloc_list which is useful for drivers that allocate multiple
  18. triggers to keep track of what they have created.
  19. When these have been set call:
  20. iio_trigger_register(trig);
  21. to register the trigger with the core, making it available to trigger
  22. consumers.
  23. Trigger Consumers
  24. Currently triggers are only used for the filling of software
  25. buffers and as such any device supporting INDIO_RING_TRIGGERED has the
  26. consumer interface automatically created.