Skip to content

Commit d055f51

Browse files
clamor-ssre
authored andcommitted
power: supply: max17040: adjust thermal channel scaling
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>
1 parent 8c7cf0f commit d055f51

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/power/supply/max17040_battery.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,9 @@ static int max17040_get_property(struct power_supply *psy,
410410
if (!chip->channel_temp)
411411
return -ENODATA;
412412

413-
iio_read_channel_processed_scale(chip->channel_temp,
414-
&val->intval, 10);
413+
iio_read_channel_processed(chip->channel_temp, &val->intval);
414+
val->intval /= 100; /* Convert from milli- to deci-degree */
415+
415416
break;
416417
default:
417418
return -EINVAL;

0 commit comments

Comments
 (0)