power: supply: max17040: adjust thermal channel scaling
Subsystems (2)
cover 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.
Svyatoslav Ryhel (1):
power: supply: max17040: adjust thermal channel scaling
drivers/power/supply/max17040_battery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.48.1
PATCH 1/1 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.
--- drivers/power/supply/max17040_battery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/power/supply/max17040_battery.c +3 -2
@@ -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 ;
Signature · 1 line
2.48.1
Sebastian Reichel
AppliedQuoted 10 lines · Svyatoslav Ryhel
IIO thermal channel is in millidegree while power supply framework expects decidegree values. Adjust scaling to get correct readings.
Svyatoslav Ryhel (1):
power: supply: max17040: adjust thermal channel scaling
drivers/power/supply/max17040_battery.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)[...]
Applied, thanks!
[1/1] power: supply: max17040: adjust thermal channel scaling
commit: d055f51731744243b244aafb1720f793a5b61f7b
Best regards,
Signature · 1 line
Sebastian Reichel <[email protected]>