diff options
author | Roberta Dobrescu <roberta.dobrescu@gmail.com> | 2014-10-22 09:50:17 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-10-25 05:56:04 -0400 |
commit | a9bef750135cc261bfceff6840a30a3f357df8da (patch) | |
tree | a6fa9e9c0b6a70e7a1d50e25ddc831bc101919ad | |
parent | ed56330df215b014c45940cceb97590d283b865f (diff) |
staging: iio: iio_event_monitor: Add support for missing IIO modifiers
This patch adds the missing IIO modifiers in event_is_known function
and iio_modifier_names vector.
Additionally, it removes duplicate name entries of IIO_MOD_LIGHT_BOTH
and IIO_MOD_LIGHT_IR in iio_modifier_names.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/staging/iio/Documentation/iio_event_monitor.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/staging/iio/Documentation/iio_event_monitor.c b/drivers/staging/iio/Documentation/iio_event_monitor.c index 569d6f8face5..940ed2399e73 100644 --- a/drivers/staging/iio/Documentation/iio_event_monitor.c +++ b/drivers/staging/iio/Documentation/iio_event_monitor.c | |||
@@ -69,16 +69,29 @@ static const char * const iio_modifier_names[] = { | |||
69 | [IIO_MOD_X] = "x", | 69 | [IIO_MOD_X] = "x", |
70 | [IIO_MOD_Y] = "y", | 70 | [IIO_MOD_Y] = "y", |
71 | [IIO_MOD_Z] = "z", | 71 | [IIO_MOD_Z] = "z", |
72 | [IIO_MOD_X_AND_Y] = "x&y", | ||
73 | [IIO_MOD_X_AND_Z] = "x&z", | ||
74 | [IIO_MOD_Y_AND_Z] = "y&z", | ||
75 | [IIO_MOD_X_AND_Y_AND_Z] = "x&y&z", | ||
76 | [IIO_MOD_X_OR_Y] = "x|y", | ||
77 | [IIO_MOD_X_OR_Z] = "x|z", | ||
78 | [IIO_MOD_Y_OR_Z] = "y|z", | ||
79 | [IIO_MOD_X_OR_Y_OR_Z] = "x|y|z", | ||
72 | [IIO_MOD_LIGHT_BOTH] = "both", | 80 | [IIO_MOD_LIGHT_BOTH] = "both", |
73 | [IIO_MOD_LIGHT_IR] = "ir", | 81 | [IIO_MOD_LIGHT_IR] = "ir", |
74 | [IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)", | 82 | [IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)", |
75 | [IIO_MOD_SUM_SQUARED_X_Y_Z] = "x^2+y^2+z^2", | 83 | [IIO_MOD_SUM_SQUARED_X_Y_Z] = "x^2+y^2+z^2", |
76 | [IIO_MOD_LIGHT_BOTH] = "both", | ||
77 | [IIO_MOD_LIGHT_IR] = "ir", | ||
78 | [IIO_MOD_LIGHT_CLEAR] = "clear", | 84 | [IIO_MOD_LIGHT_CLEAR] = "clear", |
79 | [IIO_MOD_LIGHT_RED] = "red", | 85 | [IIO_MOD_LIGHT_RED] = "red", |
80 | [IIO_MOD_LIGHT_GREEN] = "green", | 86 | [IIO_MOD_LIGHT_GREEN] = "green", |
81 | [IIO_MOD_LIGHT_BLUE] = "blue", | 87 | [IIO_MOD_LIGHT_BLUE] = "blue", |
88 | [IIO_MOD_QUATERNION] = "quaternion", | ||
89 | [IIO_MOD_TEMP_AMBIENT] = "ambient", | ||
90 | [IIO_MOD_TEMP_OBJECT] = "object", | ||
91 | [IIO_MOD_NORTH_MAGN] = "from_north_magnetic", | ||
92 | [IIO_MOD_NORTH_TRUE] = "from_north_true", | ||
93 | [IIO_MOD_NORTH_MAGN_TILT_COMP] = "from_north_magnetic_tilt_comp", | ||
94 | [IIO_MOD_NORTH_TRUE_TILT_COMP] = "from_north_true_tilt_comp", | ||
82 | }; | 95 | }; |
83 | 96 | ||
84 | static bool event_is_known(struct iio_event_data *event) | 97 | static bool event_is_known(struct iio_event_data *event) |
@@ -118,6 +131,14 @@ static bool event_is_known(struct iio_event_data *event) | |||
118 | case IIO_MOD_X: | 131 | case IIO_MOD_X: |
119 | case IIO_MOD_Y: | 132 | case IIO_MOD_Y: |
120 | case IIO_MOD_Z: | 133 | case IIO_MOD_Z: |
134 | case IIO_MOD_X_AND_Y: | ||
135 | case IIO_MOD_X_AND_Z: | ||
136 | case IIO_MOD_Y_AND_Z: | ||
137 | case IIO_MOD_X_AND_Y_AND_Z: | ||
138 | case IIO_MOD_X_OR_Y: | ||
139 | case IIO_MOD_X_OR_Z: | ||
140 | case IIO_MOD_Y_OR_Z: | ||
141 | case IIO_MOD_X_OR_Y_OR_Z: | ||
121 | case IIO_MOD_LIGHT_BOTH: | 142 | case IIO_MOD_LIGHT_BOTH: |
122 | case IIO_MOD_LIGHT_IR: | 143 | case IIO_MOD_LIGHT_IR: |
123 | case IIO_MOD_ROOT_SUM_SQUARED_X_Y: | 144 | case IIO_MOD_ROOT_SUM_SQUARED_X_Y: |
@@ -126,6 +147,13 @@ static bool event_is_known(struct iio_event_data *event) | |||
126 | case IIO_MOD_LIGHT_RED: | 147 | case IIO_MOD_LIGHT_RED: |
127 | case IIO_MOD_LIGHT_GREEN: | 148 | case IIO_MOD_LIGHT_GREEN: |
128 | case IIO_MOD_LIGHT_BLUE: | 149 | case IIO_MOD_LIGHT_BLUE: |
150 | case IIO_MOD_QUATERNION: | ||
151 | case IIO_MOD_TEMP_AMBIENT: | ||
152 | case IIO_MOD_TEMP_OBJECT: | ||
153 | case IIO_MOD_NORTH_MAGN: | ||
154 | case IIO_MOD_NORTH_TRUE: | ||
155 | case IIO_MOD_NORTH_MAGN_TILT_COMP: | ||
156 | case IIO_MOD_NORTH_TRUE_TILT_COMP: | ||
129 | break; | 157 | break; |
130 | default: | 158 | default: |
131 | return false; | 159 | return false; |