linux-IllusionX/drivers/iio/humidity
Dimitri Fedrau 9547d6a4c6 iio: humidity: hdc3020: fix hysteresis representation
According to the ABI docs hysteresis values are represented as offsets to
threshold values. Current implementation represents hysteresis values as
absolute values which is wrong. Nevertheless the device stores them as
absolute values and the datasheet refers to them as clear thresholds. Fix
the reading and writing of hysteresis values by including thresholds into
calculations. Hysteresis values that result in threshold clear values
that are out of limits will be truncated.

To check that the threshold clear values are correct, registers are read
out using i2ctransfer and the corresponding temperature and relative
humidity thresholds are calculated using the formulas in the datasheet.

Fixes: 3ad0e7e5f0 ("iio: humidity: hdc3020: add threshold events support")
Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240605192136.38146-1-dima.fedrau@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-06-09 11:05:03 +01:00
..
am2315.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
dht11.c iio: humidity: dht11: Switch from of headers to mod_devicetable.h 2022-02-06 15:21:43 +00:00
hdc100x.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
hdc2010.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
hdc3020.c iio: humidity: hdc3020: fix hysteresis representation 2024-06-09 11:05:03 +01:00
hid-sensor-humidity.c iio: humidity: hid-sensor-humidity: Convert to platform remove callback returning void 2023-09-23 15:06:55 +01:00
hts221.h iio: humidity: hts211: Use devm_regulator_get_enable() 2022-11-23 19:44:02 +00:00
hts221_buffer.c iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
hts221_core.c iio: humidity: hts211: drop casting to void in dev_set_drvdata 2024-03-25 20:10:12 +00:00
hts221_i2c.c iio: humidity: hts221: Drop ACPI_PTR() usage 2024-01-23 22:06:55 +00:00
hts221_spi.c iio: humidity: hts221: Move symbol exports into IIO_HTS221 namespace 2022-06-15 22:07:09 +01:00
htu21.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
Kconfig iio: humidity: hdc3020: Add Makefile, Kconfig and MAINTAINERS entry 2024-01-22 18:59:07 +00:00
Makefile iio: humidity: hdc3020: Add Makefile, Kconfig and MAINTAINERS entry 2024-01-22 18:59:07 +00:00
si7005.c iio: si7005: Add device tree support 2023-10-14 17:12:21 +01:00
si7020.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00