浏览代码

iio: ph: add IIO_PH channel type

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Matt Ranostay 10 年之前
父节点
当前提交
ecb3a7ccc6
共有 3 个文件被更改,包括 9 次插入0 次删除
  1. 7 0
      Documentation/ABI/testing/sysfs-bus-iio
  2. 1 0
      drivers/iio/industrialio-core.c
  3. 1 0
      include/uapi/linux/iio/types.h

+ 7 - 0
Documentation/ABI/testing/sysfs-bus-iio

@@ -1493,3 +1493,10 @@ Description:
 		This ABI is especially applicable for humidity sensors
 		to heatup the device and get rid of any condensation
 		in some humidity environment
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_ph_raw
+KernelVersion:	4.5
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Raw (unscaled no offset etc.) pH reading of a substance as a negative
+		base-10 logarithm of hydrodium ions in a litre of water.

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

@@ -77,6 +77,7 @@ static const char * const iio_chan_type_name_spec[] = {
 	[IIO_VELOCITY] = "velocity",
 	[IIO_CONCENTRATION] = "concentration",
 	[IIO_RESISTANCE] = "resistance",
+	[IIO_PH] = "ph",
 };
 
 static const char * const iio_modifier_names[] = {

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

@@ -37,6 +37,7 @@ enum iio_chan_type {
 	IIO_VELOCITY,
 	IIO_CONCENTRATION,
 	IIO_RESISTANCE,
+	IIO_PH,
 };
 
 enum iio_modifier {