瀏覽代碼

IIO: Add a modifier for sqrt(x^2+y^2)

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>
Jonathan Cameron 13 年之前
父節點
當前提交
8f5879b20b
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      drivers/iio/industrialio-core.c
  2. 1 0
      include/linux/iio/types.h

+ 1 - 0
drivers/iio/industrialio-core.c

@@ -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",
 };

+ 1 - 0
include/linux/iio/types.h

@@ -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