X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Fstaging%2Fiio%2FDocumentation%2Ftrigger.txt;fp=kernel%2Fdrivers%2Fstaging%2Fiio%2FDocumentation%2Ftrigger.txt;h=7c0e505e4f04a6f29a49077226475ecdc2815b34;hb=9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00;hp=0000000000000000000000000000000000000000;hpb=98260f3884f4a202f9ca5eabed40b1354c489b29;p=kvmfornfv.git diff --git a/kernel/drivers/staging/iio/Documentation/trigger.txt b/kernel/drivers/staging/iio/Documentation/trigger.txt new file mode 100644 index 000000000..7c0e505e4 --- /dev/null +++ b/kernel/drivers/staging/iio/Documentation/trigger.txt @@ -0,0 +1,35 @@ +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("", ...); + +allocates a trigger structure. The key elements to then fill in within +a driver are: + +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_BUFFER_TRIGGERED has the +consumer interface automatically created.