summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/Documentation/trigger.txt
blob: 650157f5c9debbd21854b9e1b1c7b8147a8ad25b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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();

allocates a trigger structure.  The key elements to then fill in within
a driver are:

trig->control_attrs
	Any sysfs attributes needed to control parameters of the trigger

trig->private_data
	Device specific private data.

trig->owner
	Typically set to THIS_MODULE. Used to ensure correct
	ownership of core allocated resources.

trig->name
	A unique name for the trigger.

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 ring
buffers and as such any device supporting INDIO_RING_TRIGGERED has the
consumer interface automatically created.