]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: tas2770: expose die temp to hwmon
authorJames Calligeros <jcalligeros99@gmail.com>
Sat, 5 Apr 2025 23:15:11 +0000 (09:15 +1000)
committerMark Brown <broonie@kernel.org>
Sun, 13 Apr 2025 19:23:35 +0000 (20:23 +0100)
commitff73e2780169a43617cc339686f5bd3d74fa8652
tree5d56e1a78445347f4f38d3067172e2faf63c7abe
parentf33b01e0947d81c514bc8ff31ad28cae7ff6d91f
ASoC: tas2770: expose die temp to hwmon

TAS2770 includes an ADC which reports the chip's die temperature.
As per the datasheet, the temperature in degrees Celsius is derived
by taking the raw value stored in the ADC's registers, dividing by 16,
then subtracting 93.

Create and register a hwmon device to expose the chip's die temperature
to the hwmon interface.

The ADC is shut down during software shutdown mode, and its registers
are initialised to 0 on reset. This means that the die temperature will
read -93 *C until the chip has been fully powered up at least once (e.g.
the PCM its attached to is opened). Once the chip is put into software
shutdown again, the ADC will also shut down. The last value sampled
before this happens will persist in the ADC's registers.

Co-developed-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250406-apple-codec-changes-v5-7-50a00ec850a3@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2770.c