/drivers/staging/iio/Documentation/trigger.txt
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
- IIO trigger drivers.
- Many triggers are provided by hardware that will also be registered as
- an IIO device. Whilst this can create device specific complexities
- such triggers are registered with the core in the same way as
- stand-alone triggers.
- struct iio_trig *trig = iio_allocate_trigger("<trigger format string>", ...);
- allocates a trigger structure. The key elements to then fill in within
- a driver are:
- trig->private_data
- Device specific private data.
- trig->owner
- Typically set to THIS_MODULE. Used to ensure correct
- ownership of core allocated resources.
- trig->set_trigger_state:
- Function that enables / disables the underlying source of the trigger.
- There is also a
- trig->alloc_list which is useful for drivers that allocate multiple
- triggers to keep track of what they have created.
- When these have been set call:
- iio_trigger_register(trig);
- to register the trigger with the core, making it available to trigger
- consumers.
- Trigger Consumers
- Currently triggers are only used for the filling of software
- buffers and as such any device supporting INDIO_RING_TRIGGERED has the
- consumer interface automatically created.