]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: tas2770: Fix order of operations for temperature calculation
authorJames Calligeros <jcalligeros99@gmail.com>
Sat, 25 Apr 2026 00:44:05 +0000 (10:44 +1000)
committerMark Brown <broonie@kernel.org>
Sun, 26 Apr 2026 21:58:07 +0000 (06:58 +0900)
commitc7ecb6a61908c2604dda6e42da66724d256de7b9
tree7120bb4f6f9053218eaf801c2d83e442fbfe032c
parent4cfb5971c2fbfac061c23fb4224a3a008199de81
ASoC: tas2770: Fix order of operations for temperature calculation

The order of operations to derive the temperature from the temp
register values was wrong, since 1000 / 16 is not an integer. This
resulted in the calculated temperature value deviating from the
value represented by the registers slightly, which was most obvious
when the registers were zeroed (-92.265 *C vs the expected -93.000 *C).

Scale the reading before dividing the whole thing by 16 to correct
this.

Fixes: ff73e2780169 ("ASoC: tas2770: expose die temp to hwmon")
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20260425-tas27xx-hwmon-fixes-v1-3-83c13b8e8f54@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2770.c