upload tizen1.0 source
[kernel/linux-2.6.36.git] / 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_allocate_trigger();
9
10 allocates a trigger structure.  The key elements to then fill in within
11 a driver are:
12
13 trig->control_attrs
14         Any sysfs attributes needed to control parameters of the trigger
15
16 trig->private_data
17         Device specific private data.
18
19 trig->owner
20         Typically set to THIS_MODULE. Used to ensure correct
21         ownership of core allocated resources.
22
23 trig->name
24         A unique name for the trigger.
25
26 When these have been set call:
27
28 iio_trigger_register(trig);
29
30 to register the trigger with the core, making it available to trigger
31 consumers.
32
33
34 Trigger Consumers
35
36 Currently triggers are only used for the filling of software ring
37 buffers and as such any device supporting INDIO_RING_TRIGGERED has the
38 consumer interface automatically created.