Commit cf82cb8128496955a38fa62e1819ceb1d596e2eb

Authored by Jonathan Cameron
1 parent f699d10202

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>

Showing 2 changed files with 2 additions and 0 deletions Side-by-side Diff

drivers/iio/industrialio-core.c
... ... @@ -71,6 +71,7 @@
71 71 [IIO_MOD_Y] = "y",
72 72 [IIO_MOD_Z] = "z",
73 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 75 [IIO_MOD_LIGHT_BOTH] = "both",
75 76 [IIO_MOD_LIGHT_IR] = "ir",
76 77 };
include/linux/iio/types.h
... ... @@ -45,6 +45,7 @@
45 45 IIO_MOD_LIGHT_BOTH,
46 46 IIO_MOD_LIGHT_IR,
47 47 IIO_MOD_ROOT_SUM_SQUARED_X_Y,
  48 + IIO_MOD_SUM_SQUARED_X_Y_Z,
48 49 };
49 50  
50 51 #define IIO_VAL_INT 1