]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: tas2764: Deal with bogus initial temperature register value
authorJames Calligeros <jcalligeros99@gmail.com>
Sun, 3 May 2026 12:23:23 +0000 (22:23 +1000)
committerMark Brown <broonie@kernel.org>
Tue, 5 May 2026 01:49:20 +0000 (10:49 +0900)
commit915f9860fe1c9f7eb6c48c299b2db64fd57ef32f
tree74182ff3072796b0681f3c51dac0eb1b3beb9d9c
parente8446a4a574d19f0fb39c06af15dbc5165079474
ASoC: tas2764: Deal with bogus initial temperature register value

The TAS2764 datasheet specifies that the chip initialises the
temperature register such that the temperature reading is 2.6 *C,
ostensibly to prevent tripping the chip's protection circuitry.
The chip is not capable of representing 2.6 *C however, and the
register is actually initialised to 0. The ADC does not start
sampling until the chip is powered up, and the last sampled
temperature persists in the register during software shutdown.
Therefore, any reading returning 0 is almost certain to be
from before the ADC has actually started sampling, meaning that
it is invalid.

Return -ENODATA early if the temperature has not yet been sampled
by the chip, and indicate a fault condition using HWMON_T_FAULT.

Fixes: 186dfc85f9a8 ("ASoC: tas2764: expose die temp to hwmon")
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2764.c