iio: Add pressure channel type
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 20 Nov 2012 13:36:00 +0000 (13:36 +0000)
committerJonathan Cameron <jic23@kernel.org>
Tue, 20 Nov 2012 21:26:38 +0000 (21:26 +0000)
This patch adds support for a new IIO channel type for pressure measurements.
This can for example be used for barometric pressure sensors.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/ABI/testing/sysfs-bus-iio
drivers/iio/industrialio-core.c
include/linux/iio/types.h

index 2f06d40fe07d4d5c293561d4187a622cdd1bc05f..2e33dc6b23463046614586deba015d3f1c1ebb66 100644 (file)
@@ -189,6 +189,14 @@ Description:
                A computed peak value based on the sum squared magnitude of
                the underlying value in the specified directions.
 
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressureY_raw
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressure_raw
+KernelVersion: 3.8
+Contact:       linux-iio@vger.kernel.org
+Description:
+               Raw pressure measurement from channel Y. Units after
+               application of scale and offset are kilopascal.
+
 What:          /sys/bus/iio/devices/iio:deviceX/in_accel_offset
 What:          /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset
 What:          /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset
@@ -197,6 +205,8 @@ What:               /sys/bus/iio/devices/iio:deviceX/in_voltageY_offset
 What:          /sys/bus/iio/devices/iio:deviceX/in_voltage_offset
 What:          /sys/bus/iio/devices/iio:deviceX/in_tempY_offset
 What:          /sys/bus/iio/devices/iio:deviceX/in_temp_offset
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressureY_offset
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressure_offset
 KernelVersion: 2.6.35
 Contact:       linux-iio@vger.kernel.org
 Description:
@@ -226,6 +236,8 @@ What:               /sys/bus/iio/devices/iio:deviceX/in_magn_scale
 What:          /sys/bus/iio/devices/iio:deviceX/in_magn_x_scale
 What:          /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale
 What:          /sys/bus/iio/devices/iio:deviceX/in_magn_z_scale
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressureY_scale
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressure_scale
 KernelVersion: 2.6.35
 Contact:       linux-iio@vger.kernel.org
 Description:
@@ -245,6 +257,8 @@ What:               /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibbias
 What:          /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibbias
 What:          /sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibbias
 What:          /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibbias
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressureY_calibbias
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressure_calibbias
 KernelVersion: 2.6.35
 Contact:       linux-iio@vger.kernel.org
 Description:
@@ -262,6 +276,8 @@ What                /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibscale
 What           /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibscale
 what           /sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibscale
 what           /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibscale
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressureY_calibscale
+What:          /sys/bus/iio/devices/iio:deviceX/in_pressure_calibscale
 KernelVersion: 2.6.35
 Contact:       linux-iio@vger.kernel.org
 Description:
@@ -275,6 +291,8 @@ What:               /sys/.../iio:deviceX/in_voltage-voltage_scale_available
 What:          /sys/.../iio:deviceX/out_voltageX_scale_available
 What:          /sys/.../iio:deviceX/out_altvoltageX_scale_available
 What:          /sys/.../iio:deviceX/in_capacitance_scale_available
+What:          /sys/.../iio:deviceX/in_pressure_scale_available
+What:          /sys/.../iio:deviceX/in_pressureY_scale_available
 KernelVersion: 2.6.35
 Contact:       linux-iio@vger.kernel.org
 Description:
@@ -694,6 +712,8 @@ What:               /sys/.../buffer/scan_elements/in_voltageY_en
 What:          /sys/.../buffer/scan_elements/in_voltageY-voltageZ_en
 What:          /sys/.../buffer/scan_elements/in_incli_x_en
 What:          /sys/.../buffer/scan_elements/in_incli_y_en
+What:          /sys/.../buffer/scan_elements/in_pressureY_en
+What:          /sys/.../buffer/scan_elements/in_pressure_en
 KernelVersion: 2.6.37
 Contact:       linux-iio@vger.kernel.org
 Description:
@@ -707,6 +727,8 @@ What:               /sys/.../buffer/scan_elements/in_voltageY_type
 What:          /sys/.../buffer/scan_elements/in_voltage_type
 What:          /sys/.../buffer/scan_elements/in_voltageY_supply_type
 What:          /sys/.../buffer/scan_elements/in_timestamp_type
+What:          /sys/.../buffer/scan_elements/in_pressureY_type
+What:          /sys/.../buffer/scan_elements/in_pressure_type
 KernelVersion: 2.6.37
 Contact:       linux-iio@vger.kernel.org
 Description:
@@ -751,6 +773,8 @@ What:               /sys/.../buffer/scan_elements/in_magn_z_index
 What:          /sys/.../buffer/scan_elements/in_incli_x_index
 What:          /sys/.../buffer/scan_elements/in_incli_y_index
 What:          /sys/.../buffer/scan_elements/in_timestamp_index
+What:          /sys/.../buffer/scan_elements/in_pressureY_index
+What:          /sys/.../buffer/scan_elements/in_pressure_index
 KernelVersion: 2.6.37
 Contact:       linux-iio@vger.kernel.org
 Description:
index 060a4045be85e00536f9a018524bcf03b3b72af6..3dccd6c3a8898f46cb34deb244578888b6210101 100644 (file)
@@ -65,6 +65,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_CAPACITANCE] = "capacitance",
        [IIO_ALTVOLTAGE] = "altvoltage",
        [IIO_CCT] = "cct",
+       [IIO_PRESSURE] = "pressure",
 };
 
 static const char * const iio_modifier_names[] = {
index 87b196a2d69839ac5a5e2b2cf40d44877bb42fa4..88bf0f0d27b4a973b6b211b06ececfd294c82c4c 100644 (file)
@@ -28,6 +28,7 @@ enum iio_chan_type {
        IIO_CAPACITANCE,
        IIO_ALTVOLTAGE,
        IIO_CCT,
+       IIO_PRESSURE,
 };
 
 enum iio_modifier {