diff options
| author | Jonathan Cameron <jic23@kernel.org> | 2012-05-05 05:56:41 -0400 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2012-06-30 05:15:28 -0400 |
| commit | cf82cb8128496955a38fa62e1819ceb1d596e2eb (patch) | |
| tree | 330d177db4e6737e1a2b23a5708259c193c19d8f | |
| parent | f699d10202d50a764614ff9191b5c4b9dd75e36c (diff) | |
IIO: Add a modifier for x^2+y^2+z^2
There will probably be a number of such modifiers eventually but
this one is used in the adis16240 accelerometer driver.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| -rw-r--r-- | drivers/iio/industrialio-core.c | 1 | ||||
| -rw-r--r-- | include/linux/iio/types.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index e42749ec5c3c..bb3c692e49b8 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
| @@ -71,6 +71,7 @@ static const char * const iio_modifier_names[] = { | |||
| 71 | [IIO_MOD_Y] = "y", | 71 | [IIO_MOD_Y] = "y", |
| 72 | [IIO_MOD_Z] = "z", | 72 | [IIO_MOD_Z] = "z", |
| 73 | [IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)", | 73 | [IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)", |
| 74 | [IIO_MOD_SUM_SQUARED_X_Y_Z] = "x^2+y^2+z^2", | ||
| 74 | [IIO_MOD_LIGHT_BOTH] = "both", | 75 | [IIO_MOD_LIGHT_BOTH] = "both", |
| 75 | [IIO_MOD_LIGHT_IR] = "ir", | 76 | [IIO_MOD_LIGHT_IR] = "ir", |
| 76 | }; | 77 | }; |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 210559ddf8a3..e25040173346 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
| @@ -45,6 +45,7 @@ enum iio_modifier { | |||
| 45 | IIO_MOD_LIGHT_BOTH, | 45 | IIO_MOD_LIGHT_BOTH, |
| 46 | IIO_MOD_LIGHT_IR, | 46 | IIO_MOD_LIGHT_IR, |
| 47 | IIO_MOD_ROOT_SUM_SQUARED_X_Y, | 47 | IIO_MOD_ROOT_SUM_SQUARED_X_Y, |
| 48 | IIO_MOD_SUM_SQUARED_X_Y_Z, | ||
| 48 | }; | 49 | }; |
| 49 | 50 | ||
| 50 | #define IIO_VAL_INT 1 | 51 | #define IIO_VAL_INT 1 |
