]> www.infradead.org Git - users/willy/xarray.git/commit
power: supply: ab8500: Use iio_read_channel_processed_scale()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 22 Jun 2024 07:04:25 +0000 (09:04 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 26 Jun 2024 13:00:53 +0000 (15:00 +0200)
commitdc6ce568afd3452ac682261ea0db570d28f7d82d
tree0d331f7fe42c482b6f6e2c3ea11ce7de62870b1e
parent3288757087cbb93b91019ba6b7de53a1908c9d48
power: supply: ab8500: Use iio_read_channel_processed_scale()

Instead of rescaling current or voltage channels after the fact, use the
dedicated scaling API. This should reduce any inaccuracies resulting from
the scaling.

This is also slightly more efficient as it saves a function call and a
multiplication.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/5668d73b92eb6318c7f094a9a8fa914c909485ca.1719037737.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500_charger.c