Commit 22eaca42 authored by Javier Carrasco's avatar Javier Carrasco Committed by Jonathan Cameron
Browse files

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: 7b779f57 ("iio: light: add driver for veml6030 ambient light sensor")
Acked-by: default avatarMatti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: default avatarJavier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20250127-veml6030-scale-v3-2-4f32ba03df94@gmail.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent dbd2e08f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+217 −311

File changed.

Preview size limit exceeded, changes collapsed.