diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-11-20 08:36:00 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-11-20 16:26:38 -0500 |
commit | c4f0c6936762ecd6b453275611a785dfdee0d417 (patch) | |
tree | dda78d1d4c27ca0144185cc2316556ca1551ed74 | |
parent | 484a0bf091c93c379e6524a17bb037c33c898e01 (diff) |
iio: Add pressure channel type
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>
-rw-r--r-- | Documentation/ABI/testing/sysfs-bus-iio | 24 | ||||
-rw-r--r-- | drivers/iio/industrialio-core.c | 1 | ||||
-rw-r--r-- | include/linux/iio/types.h | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 2f06d40fe07d..2e33dc6b2346 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio | |||
@@ -189,6 +189,14 @@ Description: | |||
189 | A computed peak value based on the sum squared magnitude of | 189 | A computed peak value based on the sum squared magnitude of |
190 | the underlying value in the specified directions. | 190 | the underlying value in the specified directions. |
191 | 191 | ||
192 | What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_raw | ||
193 | What: /sys/bus/iio/devices/iio:deviceX/in_pressure_raw | ||
194 | KernelVersion: 3.8 | ||
195 | Contact: linux-iio@vger.kernel.org | ||
196 | Description: | ||
197 | Raw pressure measurement from channel Y. Units after | ||
198 | application of scale and offset are kilopascal. | ||
199 | |||
192 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_offset | 200 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_offset |
193 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset | 201 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset |
194 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset | 202 | 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 | |||
197 | What: /sys/bus/iio/devices/iio:deviceX/in_voltage_offset | 205 | What: /sys/bus/iio/devices/iio:deviceX/in_voltage_offset |
198 | What: /sys/bus/iio/devices/iio:deviceX/in_tempY_offset | 206 | What: /sys/bus/iio/devices/iio:deviceX/in_tempY_offset |
199 | What: /sys/bus/iio/devices/iio:deviceX/in_temp_offset | 207 | What: /sys/bus/iio/devices/iio:deviceX/in_temp_offset |
208 | What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_offset | ||
209 | What: /sys/bus/iio/devices/iio:deviceX/in_pressure_offset | ||
200 | KernelVersion: 2.6.35 | 210 | KernelVersion: 2.6.35 |
201 | Contact: linux-iio@vger.kernel.org | 211 | Contact: linux-iio@vger.kernel.org |
202 | Description: | 212 | Description: |
@@ -226,6 +236,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_scale | |||
226 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_x_scale | 236 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_x_scale |
227 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale | 237 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale |
228 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_z_scale | 238 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_z_scale |
239 | What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_scale | ||
240 | What: /sys/bus/iio/devices/iio:deviceX/in_pressure_scale | ||
229 | KernelVersion: 2.6.35 | 241 | KernelVersion: 2.6.35 |
230 | Contact: linux-iio@vger.kernel.org | 242 | Contact: linux-iio@vger.kernel.org |
231 | Description: | 243 | Description: |
@@ -245,6 +257,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibbias | |||
245 | What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibbias | 257 | What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibbias |
246 | What: /sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibbias | 258 | What: /sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibbias |
247 | What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibbias | 259 | What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibbias |
260 | What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_calibbias | ||
261 | What: /sys/bus/iio/devices/iio:deviceX/in_pressure_calibbias | ||
248 | KernelVersion: 2.6.35 | 262 | KernelVersion: 2.6.35 |
249 | Contact: linux-iio@vger.kernel.org | 263 | Contact: linux-iio@vger.kernel.org |
250 | Description: | 264 | Description: |
@@ -262,6 +276,8 @@ What /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibscale | |||
262 | What /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibscale | 276 | What /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibscale |
263 | what /sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibscale | 277 | what /sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibscale |
264 | what /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibscale | 278 | what /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibscale |
279 | What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_calibscale | ||
280 | What: /sys/bus/iio/devices/iio:deviceX/in_pressure_calibscale | ||
265 | KernelVersion: 2.6.35 | 281 | KernelVersion: 2.6.35 |
266 | Contact: linux-iio@vger.kernel.org | 282 | Contact: linux-iio@vger.kernel.org |
267 | Description: | 283 | Description: |
@@ -275,6 +291,8 @@ What: /sys/.../iio:deviceX/in_voltage-voltage_scale_available | |||
275 | What: /sys/.../iio:deviceX/out_voltageX_scale_available | 291 | What: /sys/.../iio:deviceX/out_voltageX_scale_available |
276 | What: /sys/.../iio:deviceX/out_altvoltageX_scale_available | 292 | What: /sys/.../iio:deviceX/out_altvoltageX_scale_available |
277 | What: /sys/.../iio:deviceX/in_capacitance_scale_available | 293 | What: /sys/.../iio:deviceX/in_capacitance_scale_available |
294 | What: /sys/.../iio:deviceX/in_pressure_scale_available | ||
295 | What: /sys/.../iio:deviceX/in_pressureY_scale_available | ||
278 | KernelVersion: 2.6.35 | 296 | KernelVersion: 2.6.35 |
279 | Contact: linux-iio@vger.kernel.org | 297 | Contact: linux-iio@vger.kernel.org |
280 | Description: | 298 | Description: |
@@ -694,6 +712,8 @@ What: /sys/.../buffer/scan_elements/in_voltageY_en | |||
694 | What: /sys/.../buffer/scan_elements/in_voltageY-voltageZ_en | 712 | What: /sys/.../buffer/scan_elements/in_voltageY-voltageZ_en |
695 | What: /sys/.../buffer/scan_elements/in_incli_x_en | 713 | What: /sys/.../buffer/scan_elements/in_incli_x_en |
696 | What: /sys/.../buffer/scan_elements/in_incli_y_en | 714 | What: /sys/.../buffer/scan_elements/in_incli_y_en |
715 | What: /sys/.../buffer/scan_elements/in_pressureY_en | ||
716 | What: /sys/.../buffer/scan_elements/in_pressure_en | ||
697 | KernelVersion: 2.6.37 | 717 | KernelVersion: 2.6.37 |
698 | Contact: linux-iio@vger.kernel.org | 718 | Contact: linux-iio@vger.kernel.org |
699 | Description: | 719 | Description: |
@@ -707,6 +727,8 @@ What: /sys/.../buffer/scan_elements/in_voltageY_type | |||
707 | What: /sys/.../buffer/scan_elements/in_voltage_type | 727 | What: /sys/.../buffer/scan_elements/in_voltage_type |
708 | What: /sys/.../buffer/scan_elements/in_voltageY_supply_type | 728 | What: /sys/.../buffer/scan_elements/in_voltageY_supply_type |
709 | What: /sys/.../buffer/scan_elements/in_timestamp_type | 729 | What: /sys/.../buffer/scan_elements/in_timestamp_type |
730 | What: /sys/.../buffer/scan_elements/in_pressureY_type | ||
731 | What: /sys/.../buffer/scan_elements/in_pressure_type | ||
710 | KernelVersion: 2.6.37 | 732 | KernelVersion: 2.6.37 |
711 | Contact: linux-iio@vger.kernel.org | 733 | Contact: linux-iio@vger.kernel.org |
712 | Description: | 734 | Description: |
@@ -751,6 +773,8 @@ What: /sys/.../buffer/scan_elements/in_magn_z_index | |||
751 | What: /sys/.../buffer/scan_elements/in_incli_x_index | 773 | What: /sys/.../buffer/scan_elements/in_incli_x_index |
752 | What: /sys/.../buffer/scan_elements/in_incli_y_index | 774 | What: /sys/.../buffer/scan_elements/in_incli_y_index |
753 | What: /sys/.../buffer/scan_elements/in_timestamp_index | 775 | What: /sys/.../buffer/scan_elements/in_timestamp_index |
776 | What: /sys/.../buffer/scan_elements/in_pressureY_index | ||
777 | What: /sys/.../buffer/scan_elements/in_pressure_index | ||
754 | KernelVersion: 2.6.37 | 778 | KernelVersion: 2.6.37 |
755 | Contact: linux-iio@vger.kernel.org | 779 | Contact: linux-iio@vger.kernel.org |
756 | Description: | 780 | Description: |
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 060a4045be85..3dccd6c3a889 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
@@ -65,6 +65,7 @@ static const char * const iio_chan_type_name_spec[] = { | |||
65 | [IIO_CAPACITANCE] = "capacitance", | 65 | [IIO_CAPACITANCE] = "capacitance", |
66 | [IIO_ALTVOLTAGE] = "altvoltage", | 66 | [IIO_ALTVOLTAGE] = "altvoltage", |
67 | [IIO_CCT] = "cct", | 67 | [IIO_CCT] = "cct", |
68 | [IIO_PRESSURE] = "pressure", | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | static const char * const iio_modifier_names[] = { | 71 | static const char * const iio_modifier_names[] = { |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 87b196a2d698..88bf0f0d27b4 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
@@ -28,6 +28,7 @@ enum iio_chan_type { | |||
28 | IIO_CAPACITANCE, | 28 | IIO_CAPACITANCE, |
29 | IIO_ALTVOLTAGE, | 29 | IIO_ALTVOLTAGE, |
30 | IIO_CCT, | 30 | IIO_CCT, |
31 | IIO_PRESSURE, | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | enum iio_modifier { | 34 | enum iio_modifier { |