linux-stable/drivers/staging/iio/Documentation/trigger.txt
Lars-Peter Clausen 7cbb753701 staging:iio: Streamline API function naming
Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.

In particular the following renames are performed by the patch:
	iio_put_device -> iio_device_put
	iio_allocate_device -> iio_device_alloc
	iio_free_device -> iio_device_free
	iio_get_trigger -> iio_trigger_get
	iio_put_trigger -> iio_trigger_put
	iio_allocate_trigger -> iio_trigger_alloc
	iio_free_trigger -> iio_trigger_free

The conversion was done with the following coccinelle patch with manual fixes to
comments and documentation.

<smpl>
@@
@@
-iio_put_device
+iio_device_put
@@
@@
-iio_allocate_device
+iio_device_alloc
@@
@@
-iio_free_device
+iio_device_free
@@
@@
-iio_get_trigger
+iio_trigger_get
@@
@@
-iio_put_trigger
+iio_trigger_put
@@
@@
-iio_allocate_trigger
+iio_trigger_alloc
@@
@@
-iio_free_trigger
+iio_trigger_free
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 21:23:49 -04:00

38 lines
1.1 KiB
Text

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_trigger_alloc("<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.