Skip to content

Commit cf82cb8

Browse files
committed
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>
1 parent f699d10 commit cf82cb8

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/iio/industrialio-core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static const char * const iio_modifier_names[] = {
7171
[IIO_MOD_Y] = "y",
7272
[IIO_MOD_Z] = "z",
7373
[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",
7475
[IIO_MOD_LIGHT_BOTH] = "both",
7576
[IIO_MOD_LIGHT_IR] = "ir",
7677
};

‎include/linux/iio/types.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ enum iio_modifier {
4545
IIO_MOD_LIGHT_BOTH,
4646
IIO_MOD_LIGHT_IR,
4747
IIO_MOD_ROOT_SUM_SQUARED_X_Y,
48+
IIO_MOD_SUM_SQUARED_X_Y_Z,
4849
};
4950

5051
#define IIO_VAL_INT 1

0 commit comments

Comments
 (0)