iio: humidity: hdc3020: add threshold events support
authorDimitri Fedrau <dima.fedrau@gmail.com>
Wed, 14 Feb 2024 08:53:45 +0000 (09:53 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 17 Feb 2024 16:16:12 +0000 (16:16 +0000)
commit3ad0e7e5f0cb4d1cb1f1fb687d10e45cabf1928c
treeb854e21b27ab5150911b4486e14e75241fa42dac
parent9f9bfae410e6cdfa454e779c9ef3b737a213ce2c
iio: humidity: hdc3020: add threshold events support

Add threshold events support for temperature and relative humidity. To
enable them the higher and lower threshold registers must be programmed
and the higher threshold must be greater then or equal to the lower
threshold. Otherwise the event is disabled. Invalid hysteresis values
are ignored by the device. There is no further configuration possible.

Tested by setting thresholds/hysteresis and turning the heater on/off.
Used iio_event_monitor in tools/iio to catch events while constantly
displaying temperature and humidity values.

Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Tested-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240214085350.19382-4-dima.fedrau@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/humidity/hdc3020.c