···11+What: /config/iio22+Date: October 201533+KernelVersion: 4.444+Contact: linux-iio@vger.kernel.org55+Description:66+ This represents Industrial IO configuration entry point77+ directory. It contains sub-groups corresponding to IIO88+ objects.99+1010+What: /config/iio/triggers1111+Date: October 20151212+KernelVersion: 4.41313+Description:1414+ Industrial IO software triggers directory.1515+1616+What: /config/iio/triggers/hrtimers1717+Date: October 20151818+KernelVersion: 4.41919+Description:2020+ High resolution timers directory. Creating a directory here2121+ will result in creating a hrtimer trigger in the IIO subsystem.
+93
Documentation/iio/iio_configfs.txt
···11+Industrial IIO configfs support22+33+1. Overview44+55+Configfs is a filesystem-based manager of kernel objects. IIO uses some66+objects that could be easily configured using configfs (e.g.: devices,77+triggers).88+99+See Documentation/filesystems/configfs/configfs.txt for more information1010+about how configfs works.1111+1212+2. Usage1313+1414+In order to use configfs support in IIO we need to select it at compile1515+time via CONFIG_IIO_CONFIGFS config option.1616+1717+Then, mount the configfs filesystem (usually under /config directory):1818+1919+$ mkdir /config2020+$ mount -t configfs none /config2121+2222+At this point, all default IIO groups will be created and can be accessed2323+under /config/iio. Next chapters will describe available IIO configuration2424+objects.2525+2626+3. Software triggers2727+2828+One of the IIO default configfs groups is the "triggers" group. It is2929+automagically accessible when the configfs is mounted and can be found3030+under /config/iio/triggers.3131+3232+IIO software triggers implementation offers support for creating multiple3333+trigger types. A new trigger type is usually implemented as a separate3434+kernel module following the interface in include/linux/iio/sw_trigger.h:3535+3636+/*3737+ * drivers/iio/trigger/iio-trig-sample.c3838+ * sample kernel module implementing a new trigger type3939+ */4040+#include <linux/iio/sw_trigger.h>4141+4242+4343+static struct iio_sw_trigger *iio_trig_sample_probe(const char *name)4444+{4545+ /*4646+ * This allocates and registers an IIO trigger plus other4747+ * trigger type specific initialization.4848+ */4949+}5050+5151+static int iio_trig_hrtimer_remove(struct iio_sw_trigger *swt)5252+{5353+ /*5454+ * This undoes the actions in iio_trig_sample_probe5555+ */5656+}5757+5858+static const struct iio_sw_trigger_ops iio_trig_sample_ops = {5959+ .probe = iio_trig_sample_probe,6060+ .remove = iio_trig_sample_remove,6161+};6262+6363+static struct iio_sw_trigger_type iio_trig_sample = {6464+ .name = "trig-sample",6565+ .owner = THIS_MODULE,6666+ .ops = &iio_trig_sample_ops,6767+};6868+6969+module_iio_sw_trigger_driver(iio_trig_sample);7070+7171+Each trigger type has its own directory under /config/iio/triggers. Loading7272+iio-trig-sample module will create 'trig-sample' trigger type directory7373+/config/iio/triggers/trig-sample.7474+7575+We support the following interrupt sources (trigger types):7676+ * hrtimer, uses high resolution timers as interrupt source7777+7878+3.1 Hrtimer triggers creation and destruction7979+8080+Loading iio-trig-hrtimer module will register hrtimer trigger types allowing8181+users to create hrtimer triggers under /config/iio/triggers/hrtimer.8282+8383+e.g:8484+8585+$ mkdir /config/triggers/hrtimer/instance18686+$ rmdir /config/triggers/hrtimer/instance18787+8888+Each trigger can have one or more attributes specific to the trigger type.8989+9090+3.2 "hrtimer" trigger types attributes9191+9292+"hrtimer" trigger type doesn't have any configurable attribute from /config dir.9393+It does introduce the sampling_frequency attribute to trigger directory.