iio: humidity: hdc100x: add triggered buffer support for HDC100X
PATCH v3 1/1 iio: humidity: hdc100x: add triggered buffer support for HDC100X
Triggered buffer support uses the HDC100X's dual acquisition mode to read both humidity and temperature in one shot.
This patch depends on
447136effbf4 ("iio: humidity: hdc100x: fix sensor data reads of
temp and humidity")---
Changes in v3:
Thanks for the review Jonathan
- This patch now depends on
447136effbf4 ("iio: humidity: hdc100x: fix sensor data reads of temp and humidity")
- remove i2c functionality check, done in dependent patch
- remove unused define HDC100X_ALL_CHANNEL_MASK
- define and use available_scan_masks to demux between temp &/or humid data in buffered mode
- changed timestamp channel scan_index from 3 to 2.
- put back private data lock in read_raw
(we'll lock private data lock and claim_direct_mode on raw reads)
- remove unneeded NULL parameters in iio_buffer_setup_ops
- add private data lock on buffered read
We are going to allow configuration changes while the sensor is in buffered mode. We need to allow the toggling of the Heater Enable bit because the heater only functions during measurements. The lock will ensure that the config change and buffer read transaction do not collide.
- blank lines added for readability per reviewer
Changes in v2:
Thanks for the review Peter
- switched endianness from IIO_CPU to IIO_BE
- use only one buffer in the handler
- simplify selection of temp &/or humidity to push to buffer
drivers/iio/humidity/Kconfig | 2 + drivers/iio/humidity/hdc100x.c | 128 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 128 insertions(+), 2 deletions(-)
drivers/iio/humidity/Kconfig +2 -0
@@ -25,6 +25,8 @@ config DHT11 config HDC100X tristate "TI HDC100x relative humidity and temperature sensor" depends on I2C + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER help Say yes here to build support for the Texas Instruments HDC1000 and HDC1008 relative humidity and temperature sensors.
drivers/iio/humidity/hdc100x.c +126 -2
196 lines not on this page · raw message
Signature · 1 line
2.1.4