1
+ ===============================
1
2
Industrial IIO configfs support
3
+ ===============================
2
4
3
5
1. Overview
6
+ ===========
4
7
5
8
Configfs is a filesystem-based manager of kernel objects. IIO uses some
6
9
objects that could be easily configured using configfs (e.g.: devices,
@@ -10,61 +13,63 @@ See Documentation/filesystems/configfs/configfs.txt for more information
10
13
about how configfs works.
11
14
12
15
2. Usage
16
+ ========
13
17
14
18
In order to use configfs support in IIO we need to select it at compile
15
19
time via CONFIG_IIO_CONFIGFS config option.
16
20
17
- Then, mount the configfs filesystem (usually under /config directory):
21
+ Then, mount the configfs filesystem (usually under /config directory)::
18
22
19
- $ mkdir /config
20
- $ mount -t configfs none /config
23
+ $ mkdir /config
24
+ $ mount -t configfs none /config
21
25
22
26
At this point, all default IIO groups will be created and can be accessed
23
27
under /config/iio. Next chapters will describe available IIO configuration
24
28
objects.
25
29
26
30
3. Software triggers
31
+ ====================
27
32
28
33
One of the IIO default configfs groups is the "triggers" group. It is
29
34
automagically accessible when the configfs is mounted and can be found
30
35
under /config/iio/triggers.
31
36
32
37
IIO software triggers implementation offers support for creating multiple
33
38
trigger types. A new trigger type is usually implemented as a separate
34
- kernel module following the interface in include/linux/iio/sw_trigger.h:
39
+ kernel module following the interface in include/linux/iio/sw_trigger.h::
35
40
36
- /*
37
- * drivers/iio/trigger/iio-trig-sample.c
38
- * sample kernel module implementing a new trigger type
39
- */
40
- #include <linux/iio/sw_trigger.h>
41
+ /*
42
+ * drivers/iio/trigger/iio-trig-sample.c
43
+ * sample kernel module implementing a new trigger type
44
+ */
45
+ #include <linux/iio/sw_trigger.h>
41
46
42
47
43
- static struct iio_sw_trigger *iio_trig_sample_probe(const char *name)
44
- {
48
+ static struct iio_sw_trigger *iio_trig_sample_probe(const char *name)
49
+ {
45
50
/*
46
51
* This allocates and registers an IIO trigger plus other
47
52
* trigger type specific initialization.
48
53
*/
49
- }
54
+ }
50
55
51
- static int iio_trig_hrtimer_remove(struct iio_sw_trigger *swt)
52
- {
56
+ static int iio_trig_hrtimer_remove(struct iio_sw_trigger *swt)
57
+ {
53
58
/*
54
59
* This undoes the actions in iio_trig_sample_probe
55
60
*/
56
- }
61
+ }
57
62
58
- static const struct iio_sw_trigger_ops iio_trig_sample_ops = {
63
+ static const struct iio_sw_trigger_ops iio_trig_sample_ops = {
59
64
.probe = iio_trig_sample_probe,
60
65
.remove = iio_trig_sample_remove,
61
- };
66
+ };
62
67
63
- static struct iio_sw_trigger_type iio_trig_sample = {
68
+ static struct iio_sw_trigger_type iio_trig_sample = {
64
69
.name = "trig-sample",
65
70
.owner = THIS_MODULE,
66
71
.ops = &iio_trig_sample_ops,
67
- };
72
+ };
68
73
69
74
module_iio_sw_trigger_driver(iio_trig_sample);
70
75
@@ -73,21 +78,24 @@ iio-trig-sample module will create 'trig-sample' trigger type directory
73
78
/config/iio/triggers/trig-sample.
74
79
75
80
We support the following interrupt sources (trigger types):
81
+
76
82
* hrtimer, uses high resolution timers as interrupt source
77
83
78
84
3.1 Hrtimer triggers creation and destruction
85
+ ---------------------------------------------
79
86
80
87
Loading iio-trig-hrtimer module will register hrtimer trigger types allowing
81
88
users to create hrtimer triggers under /config/iio/triggers/hrtimer.
82
89
83
- e.g:
90
+ e.g::
84
91
85
- $ mkdir /config/iio/triggers/hrtimer/instance1
86
- $ rmdir /config/iio/triggers/hrtimer/instance1
92
+ $ mkdir /config/iio/triggers/hrtimer/instance1
93
+ $ rmdir /config/iio/triggers/hrtimer/instance1
87
94
88
95
Each trigger can have one or more attributes specific to the trigger type.
89
96
90
97
3.2 "hrtimer" trigger types attributes
98
+ --------------------------------------
91
99
92
100
"hrtimer" trigger type doesn't have any configurable attribute from /config dir.
93
101
It does introduce the sampling_frequency attribute to trigger directory.
0 commit comments