Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2700442e authored by puneet's avatar puneet Committed by Gerrit - the friendly Code Review server
Browse files

driver: iio: imu: fix temperature issue of iam20680



The temperature data below 25 degree is in negative value
which is not read properly because of s32 type casting.

CRs-Fixed: 2292417
Change-Id: I38d3abd47f298350e79af9eeb6b6b3c22ad24548
Signed-off-by: default avatarpuneet <puneet@codeaurora.org>
parent 80922117
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -746,7 +746,7 @@ static ssize_t inv_temperature_show(struct device *dev,
		return res;
	mutex_unlock(&indio_dev->mlock);

	temp = (s32)be16_to_cpup((__be16 *)(data)) * 10000;
	temp = (s16)be16_to_cpup((__be16 *)(data)) * 10000;
	temp = temp / TEMP_SENSITIVITY + TEMP_OFFSET;

	return snprintf(buf, MAX_WR_SZ, "%d %lld\n", temp, get_time_ns());