]> Pileus Git - ~andy/linux/blob - drivers/staging/iio/Documentation/trigger.txt
Merge tag 'stmp-dev' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[~andy/linux] / 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->private_data
14         Device specific private data.
15
16 trig->owner
17         Typically set to THIS_MODULE. Used to ensure correct
18         ownership of core allocated resources.
19
20 trig->set_trigger_state:
21         Function that enables / disables the underlying source of the trigger.
22
23 There is also a
24 trig->alloc_list which is useful for drivers that allocate multiple
25 triggers to keep track of what they have created.
26
27 When these have been set call:
28
29 iio_trigger_register(trig);
30
31 to register the trigger with the core, making it available to trigger
32 consumers.
33
34 Trigger Consumers
35
36 Currently triggers are only used for the filling of software
37 buffers and as such any device supporting INDIO_RING_TRIGGERED has the
38 consumer interface automatically created.