diff options
| author | Javier Carrasco <javier.carrasco.cruz@gmail.com> | 2025-01-27 20:30:23 +0100 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-02-08 15:16:29 +0000 |
| commit | 22eaca4283b216f5e1f7721e4ad0ecb3d23c6774 (patch) | |
| tree | 474e6e083ccdc6d7cd332ddb45ed559c3ed528be /drivers/iio/light/Kconfig | |
| parent | dbd2e08ff09fd6bd51215b44474899cc1b7b7a16 (diff) | |
iio: light: veml6030: fix scale to conform to ABI
The current scale is not ABI-compliant as it is just the sensor gain
instead of the value that acts as a multiplier to be applied to the raw
value (there is no offset).
Use the iio-gts helpers to obtain the proper scale values according to
the gain and integration time to match the resolution tables from the
datasheet and drop dedicated variables to store the current values of
the integration time, gain and resolution. When at it, use 'scale'
instead of 'gain' consistently for the get/set functions to avoid
misunderstandings.
Fixes: 7b779f573c48 ("iio: light: add driver for veml6030 ambient light sensor")
Acked-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20250127-veml6030-scale-v3-2-4f32ba03df94@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light/Kconfig')
| -rw-r--r-- | drivers/iio/light/Kconfig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index 9260056f0af8..89aec08df739 100644 --- a/drivers/iio/light/Kconfig +++ b/drivers/iio/light/Kconfig @@ -694,6 +694,7 @@ config VEML6030 select REGMAP_I2C select IIO_BUFFER select IIO_TRIGGERED_BUFFER + select IIO_GTS_HELPER depends on I2C help Say Y here if you want to build a driver for the Vishay VEML6030 |
