diff options
author | Hans de Goede <hansg@kernel.org> | 2025-08-31 12:48:23 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-09-10 19:47:04 +0100 |
commit | 05f958d003c9a9a215a5f8687a14534cc1dad271 (patch) | |
tree | 8f180649beabff5d230d94f0575aca95ec32bffc /rust/helpers/vmalloc.c | |
parent | cec1aec9c46305743a2d4a1bfb06f6b0374d5ed0 (diff) |
iio: Improve iio_read_channel_processed_scale() precision
Before this change iio_read_channel_processed_scale() always assumes that
channels which advertise IIO_CHAN_INFO_PROCESSED capability return
IIO_VAL_INT on success.
Ignoring any fractional values from drivers which return
IIO_VAL_INT_PLUS_MICRO / IIO_VAL_INT_PLUS_NANO. These fractional values
might become non fractional after scaling so these should be taken into
account for better precision.
Use the new iio_multiply_value() helper to do proper scaling taking
the fractionional values into account.
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Link: https://patch.msgid.link/20250831104825.15097-5-hansg@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'rust/helpers/vmalloc.c')
0 files changed, 0 insertions, 0 deletions