hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/tools/iio/iio_event_monitor.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* Industrialio event test code.
23 *
34 * Copyright (c) 2011-2012 Lars-Peter Clausen <lars@metafoo.de>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License version 2 as published by
7
- * the Free Software Foundation.
85 *
96 * This program is primarily intended as an example application.
107 * Reads the current buffer setup from sysfs and starts a short capture
....@@ -60,6 +57,17 @@
6057 [IIO_GRAVITY] = "gravity",
6158 [IIO_POSITIONRELATIVE] = "positionrelative",
6259 [IIO_PHASE] = "phase",
60
+ [IIO_MASSCONCENTRATION] = "massconcentration",
61
+#ifdef CONFIG_NO_GKI
62
+ [IIO_SIGN_MOTION] = "signmotion",
63
+ [IIO_STEP_DETECTOR] = "stepdetector",
64
+ [IIO_STEP_COUNTER] = "stepcounter",
65
+ [IIO_TILT] = "tilt",
66
+ [IIO_TAP] = "tap",
67
+ [IIO_TAP_TAP] = "taptap",
68
+ [IIO_WRIST_TILT_GESTURE] = "wristtiltgesture",
69
+ [IIO_GESTURE] = "gesture",
70
+#endif
6371 };
6472
6573 static const char * const iio_ev_type_text[] = {
....@@ -69,12 +77,19 @@
6977 [IIO_EV_TYPE_THRESH_ADAPTIVE] = "thresh_adaptive",
7078 [IIO_EV_TYPE_MAG_ADAPTIVE] = "mag_adaptive",
7179 [IIO_EV_TYPE_CHANGE] = "change",
80
+#ifdef CONFIG_NO_GKI
81
+ [IIO_EV_TYPE_FIFO_FLUSH] = "fifo_flush",
82
+#endif
7283 };
7384
7485 static const char * const iio_ev_dir_text[] = {
7586 [IIO_EV_DIR_EITHER] = "either",
7687 [IIO_EV_DIR_RISING] = "rising",
77
- [IIO_EV_DIR_FALLING] = "falling"
88
+ [IIO_EV_DIR_FALLING] = "falling",
89
+#ifdef CONFIG_NO_GKI
90
+ [IIO_EV_DIR_FIFO_EMPTY] = "empty",
91
+ [IIO_EV_DIR_FIFO_DATA] = "data",
92
+#endif
7893 };
7994
8095 static const char * const iio_modifier_names[] = {
....@@ -114,7 +129,14 @@
114129 [IIO_MOD_I] = "i",
115130 [IIO_MOD_Q] = "q",
116131 [IIO_MOD_CO2] = "co2",
132
+ [IIO_MOD_ETHANOL] = "ethanol",
133
+ [IIO_MOD_H2] = "h2",
117134 [IIO_MOD_VOC] = "voc",
135
+ [IIO_MOD_PM1] = "pm1",
136
+ [IIO_MOD_PM2P5] = "pm2p5",
137
+ [IIO_MOD_PM4] = "pm4",
138
+ [IIO_MOD_PM10] = "pm10",
139
+ [IIO_MOD_O2] = "o2",
118140 };
119141
120142 static bool event_is_known(struct iio_event_data *event)
....@@ -156,6 +178,7 @@
156178 case IIO_GRAVITY:
157179 case IIO_POSITIONRELATIVE:
158180 case IIO_PHASE:
181
+ case IIO_MASSCONCENTRATION:
159182 break;
160183 default:
161184 return false;
....@@ -199,7 +222,14 @@
199222 case IIO_MOD_I:
200223 case IIO_MOD_Q:
201224 case IIO_MOD_CO2:
225
+ case IIO_MOD_ETHANOL:
226
+ case IIO_MOD_H2:
202227 case IIO_MOD_VOC:
228
+ case IIO_MOD_PM1:
229
+ case IIO_MOD_PM2P5:
230
+ case IIO_MOD_PM4:
231
+ case IIO_MOD_PM10:
232
+ case IIO_MOD_O2:
203233 break;
204234 default:
205235 return false;