iio: light: vcnl4000: Add period for vcnl4040/4200
authorAstrid Rost <astrid.rost@axis.com>
Tue, 13 Jun 2023 13:50:22 +0000 (15:50 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 20 Jul 2023 18:21:29 +0000 (19:21 +0100)
commit7f8651270c6c9c662281232dde9d1ca5a983730f
tree43920443bbe3f4b075e61cf328f6d6b1f1ace10b
parentbc292aaf9cb46d88fc66c33f875fd4c0e12a5009
iio: light: vcnl4000: Add period for vcnl4040/4200

Add read/write attribute for proximity and illuminance period. The
period is set in the interrupt persistence flags(PS_PERS and ALS_PERS).
An interrupt will not be asserted if the raw value is not over (or lower)
than the threshold for the set continued amount of measurements.
The time in seconds is calculated by the number of continued refreshes
multiplied with the integration time.
It will always pick the next lower possible value. The period changes,
if the integration time is changed.

Signed-off-by: Astrid Rost <astrid.rost@axis.com>
Link: https://lore.kernel.org/r/20230613135025.2596641-7-astrid.rost@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/vcnl4000.c