linux/drivers/iio
Vasileios Amoiridis 4241665e6e iio: chemical: bme680: Fix sensor data read operation
A read operation is happening as follows:

a) Set sensor to forced mode
b) Sensor measures values and update data registers and sleeps again
c) Read data registers

In the current implementation the read operation happens immediately
after the sensor is set to forced mode so the sensor does not have
the time to update properly the registers. This leads to the following
2 problems:

1) The first ever value which is read by the register is always wrong
2) Every read operation, puts the register into forced mode and reads
the data that were calculated in the previous conversion.

This behaviour was tested in 2 ways:

1) The internal meas_status_0 register was read before and after every
read operation in order to verify that the data were ready even before
the register was set to forced mode and also to check that after the
forced mode was set the new data were not yet ready.

2) Physically changing the temperature and measuring the temperature

This commit adds the waiting time in between the set of the forced mode
and the read of the data. The function is taken from the Bosch BME68x
Sensor API [1].

[1]: https://github.com/boschsensortec/BME68x_SensorAPI/blob/v4.4.8/bme68x.c#L490

Fixes: 1b3bd85927 ("iio: chemical: Add support for Bosch BME680 sensor")
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://lore.kernel.org/r/20240606212313.207550-5-vassilisamir@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-06-09 12:02:34 +01:00
..
accel iio: accel: fxls8962af: select IIO_BUFFER & IIO_KFIFO_BUF 2024-06-08 18:52:45 +01:00
adc iio: adc: ad7266: Fix variable checking bug 2024-06-08 18:26:57 +01:00
addac Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
afe iio: afe: rescale: Accept only offset channels 2023-10-17 20:25:32 +01:00
amplifiers iio: amplifiers: hmc425a: add support for LTC6373 Instrumentation Amplifier 2024-02-28 19:26:36 +00:00
buffer iio: buffer-dmaengine: Enable write support 2024-04-20 15:41:32 +01:00
cdc iio: cdc: ad7150: relax return value check for IRQ get 2023-08-01 18:55:55 +01:00
chemical iio: chemical: bme680: Fix sensor data read operation 2024-06-09 12:02:34 +01:00
common iio: invensense: fix odr switching to same value 2024-05-27 09:49:20 +01:00
dac iio: dac: fix ad9739a random config compile error 2024-06-09 10:41:30 +01:00
dummy iio: dummy: Use automatic lock and direct mode cleanup. 2024-02-17 16:16:10 +00:00
filter drivers: iio: filter: admv8818: add bypass mode 2023-08-08 09:51:06 +01:00
frequency Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
gyro i2c: mux: Remove class argument from i2c_mux_add_adapter() 2024-05-13 16:13:19 +02:00
health iio: health: max30102: add support for max30101 2024-03-28 13:22:15 +00:00
humidity iio: humidity: hdc3020: fix hysteresis representation 2024-06-09 11:05:03 +01:00
imu iio: imu: inv_mpu6050: stabilized timestamping in interrupt 2024-06-03 19:05:56 +01:00
light iio: light: stk3310: Drop most likely fake ACPI ID 2024-04-29 20:53:25 +01:00
magnetometer iio: magnetometer: add a driver for Voltafield AF8133J magnetometer 2024-02-28 19:26:37 +00:00
multiplexer iio: multiplexer: Switch to use dev_err_probe() helper 2022-11-23 19:43:57 +00:00
orientation iio: orientation: hid-sensor-rotation: Convert to platform remove callback returning void 2023-09-23 15:06:56 +01:00
position iio: position: hid-sensor-custom-intel-hinge: Convert to platform remove callback returning void 2023-09-23 15:06:56 +01:00
potentiometer iio: potentiometer: max5487: Drop ACPI_PTR() usage 2024-01-23 22:06:55 +00:00
potentiostat iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
pressure iio: pressure: bmp280: Fix BMP580 temperature reading 2024-05-27 09:49:20 +01:00
proximity iio: proximity: isl29501: make use of of_device_id table 2024-02-28 19:26:38 +00:00
resolver iio: resolver: ad2s1210: add reset gpio support 2023-11-16 19:10:25 +00:00
temperature iio: temperature: mlx90635: Fix ERR_PTR dereference in mlx90635_probe() 2024-05-27 09:49:20 +01:00
test iio: test: test gain-time-scale helpers 2024-02-17 16:16:09 +00:00
trigger iio: trigger: stm32-timer: Convert to platform remove callback returning void 2023-09-23 15:06:56 +01:00
iio_core_trigger.h
iio_core.h iio: Remove unused declarations 2023-09-12 10:42:03 +01:00
industrialio-acpi.c iio: core: Add iio_read_acpi_mount_matrix() helper function 2024-04-29 20:53:25 +01:00
industrialio-backend.c iio: backend: add API for interface tuning 2024-04-29 20:53:26 +01:00
industrialio-buffer.c iio: buffer: initialize masklength accumulator to 0 2024-04-29 20:53:24 +01:00
industrialio-configfs.c
industrialio-core.c iio: core: move to cleanup.h magic 2024-03-25 20:10:14 +00:00
industrialio-event.c iio: event: add optional event label support 2023-10-11 15:54:41 +01:00
industrialio-gts-helper.c iio: gts-helper: Fix division loop 2024-02-19 19:32:12 +00:00
industrialio-sw-device.c iio: Don't use bare "unsigned" 2022-07-01 11:19:08 +01:00
industrialio-sw-trigger.c iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails 2022-11-12 17:53:35 +00:00
industrialio-trigger.c iio: trigger: move to the cleanup.h magic 2024-03-25 20:10:14 +00:00
industrialio-triggered-event.c
inkern.c iio: inkern: fix channel read regression 2024-06-03 20:29:31 +01:00
Kconfig iio: add the IIO backend framework 2024-02-19 19:32:22 +00:00
Makefile iio: core: Add iio_read_acpi_mount_matrix() helper function 2024-04-29 20:53:25 +01:00
TODO iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00