Commit d055f517 authored by Svyatoslav Ryhel's avatar Svyatoslav Ryhel Committed by Sebastian Reichel
Browse files

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: default avatarSvyatoslav Ryhel <clamor95@gmail.com>
Link: https://lore.kernel.org/r/20250430060239.12085-2-clamor95@gmail.com


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 8c7cf0fc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;