On 24/12/2024 12:59, Javier Carrasco wrote:
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. When at it, use 'scale' instead of 'gain' consistently for
the get/set functions to avoid misunderstandings.
Fixes: c5a23f80c164 ("iio: light: add support for veml3235")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
---
This looks good to me, although I now think we made a mistake with the
naming of the iio_gts_find_gain_sel_in_times().
The intended use is finding the gain and time (selector) for the new
scale (while preferring keeping the time unchanged if possible), right?
So, in this regard it'd be better to use name which reflects the fact
that the function finds gain and time for given scale.
I would now (after having to look the doc of this new function while
reviewing the code 2 weeks after reviewing this new function :rolleyes:)
name it something like:
iio_gts_find_gain_time_sel_for_scale()
Well, it's not really in the scope of the review anymore, but I'd love
to see a renaming patch while we have only one user... :)
Anyways:
Reviewed-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
Yours,
-- Matti