diff options
author | Matti Vaittinen <mazziesaccount@gmail.com> | 2024-01-15 15:26:07 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-02-17 17:16:09 +0100 |
commit | cf996f039679e6ebb9eefce28afe465482f4fc3a (patch) | |
tree | bdd4c19b3763aade4ff2aefd80b9fce8aadb20ef /MAINTAINERS | |
parent | iio: light: vcnl4000: Set ps high definition for 4040/4200 (diff) | |
download | linux-cf996f039679e6ebb9eefce28afe465482f4fc3a.tar.xz linux-cf996f039679e6ebb9eefce28afe465482f4fc3a.zip |
iio: test: test gain-time-scale helpers
Some light sensors can adjust both the HW-gain and integration time.
There are cases where adjusting the integration time has similar impact
to the scale of the reported values as gain setting has.
IIO users do typically expect to handle scale by a single writable 'scale'
entry. Driver should then adjust the gain/time accordingly.
It however is difficult for a driver to know whether it should change
gain or integration time to meet the requested scale. Usually it is
preferred to have longer integration time which usually improves
accuracy, but there may be use-cases where long measurement times can be
an issue. Thus it can be preferable to allow also changing the
integration time - but mitigate the scale impact by also changing the gain
underneath. Eg, if integration time change doubles the measured values,
the driver can reduce the HW-gain to half.
The theory of the computations of gain-time-scale is simple. However,
some people (undersigned) got that implemented wrong for more than once.
Hence some gain-time-scale helpers were introduced.
Add some simple tests to verify the most hairy functions.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/0f7505b43f91394dc3bb636369489c897b7e01a7.1705328293.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions