Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / iio / Documentation / trigger.txt
1 IIO trigger drivers.
2
3 Many triggers are provided by hardware that will also be registered as
4 an IIO device.  Whilst this can create device specific complexities
5 such triggers are registered with the core in the same way as
6 stand-alone triggers.
7
8 struct iio_trig *trig = iio_trigger_alloc("<trigger format string>", ...);
9
10 allocates a trigger structure.  The key elements to then fill in within
11 a driver are:
12
13 trig->owner
14         Typically set to THIS_MODULE. Used to ensure correct
15         ownership of core allocated resources.
16
17 trig->set_trigger_state:
18         Function that enables / disables the underlying source of the trigger.
19
20 There is also a
21 trig->alloc_list which is useful for drivers that allocate multiple
22 triggers to keep track of what they have created.
23
24 When these have been set call:
25
26 iio_trigger_register(trig);
27
28 to register the trigger with the core, making it available to trigger
29 consumers.
30
31 Trigger Consumers
32
33 Currently triggers are only used for the filling of software
34 buffers and as such any device supporting INDIO_BUFFER_TRIGGERED has the
35 consumer interface automatically created.