IIO: Add a modifier for sqrt(x^2+y^2)
authorJonathan Cameron <jic23@kernel.org>
Sat, 5 May 2012 09:39:22 +0000 (10:39 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 30 Jun 2012 09:15:22 +0000 (10:15 +0100)
There will probably be a number of such modifiers eventually but
this one is used in the adis16204 accelerometer driver.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/industrialio-core.c
include/linux/iio/types.h

index a5a446beb2fa2964f85f7be42c709d17df0e4878..e42749ec5c3cb79fb85409fdcf49f6b952906d69 100644 (file)
@@ -70,6 +70,7 @@ static const char * const iio_modifier_names[] = {
        [IIO_MOD_X] = "x",
        [IIO_MOD_Y] = "y",
        [IIO_MOD_Z] = "z",
+       [IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)",
        [IIO_MOD_LIGHT_BOTH] = "both",
        [IIO_MOD_LIGHT_IR] = "ir",
 };
index d086736a9033f7832866b200490dfb69ade4b6c8..210559ddf8a3d13a8c786f40debc445e8654014e 100644 (file)
@@ -44,6 +44,7 @@ enum iio_modifier {
        IIO_MOD_X_OR_Y_OR_Z,
        IIO_MOD_LIGHT_BOTH,
        IIO_MOD_LIGHT_IR,
+       IIO_MOD_ROOT_SUM_SQUARED_X_Y,
 };
 
 #define IIO_VAL_INT 1