diff options
author | Svyatoslav Ryhel <clamor95@gmail.com> | 2025-04-30 09:02:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-06-27 11:11:28 +0100 |
commit | 05713a9fc20a0ec3e62798448c048cc3c8e66c20 (patch) | |
tree | 59aa39a4a4460ccc10fcab400d8b43467dabb7b8 | |
parent | 1f152ae557d6d516cf32a8b787005cb3bd051358 (diff) |
power: supply: max17040: adjust thermal channel scaling
[ Upstream commit d055f51731744243b244aafb1720f793a5b61f7b ]
IIO thermal channel is in millidegree while power supply framework expects
decidegree values. Adjust scaling to get correct readings.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Link: https://lore.kernel.org/r/20250430060239.12085-2-clamor95@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/power/supply/max17040_battery.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c index 51310f6e4803b..c1640bc6accd2 100644 --- a/drivers/power/supply/max17040_battery.c +++ b/drivers/power/supply/max17040_battery.c @@ -410,8 +410,9 @@ static int max17040_get_property(struct power_supply *psy, if (!chip->channel_temp) return -ENODATA; - iio_read_channel_processed_scale(chip->channel_temp, - &val->intval, 10); + iio_read_channel_processed(chip->channel_temp, &val->intval); + val->intval /= 100; /* Convert from milli- to deci-degree */ + break; default: return -EINVAL; |