]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: codecs: wsa884x: report temps to hwmon in millidegree of Celsius
authorAlexey Klimov <alexey.klimov@linaro.org>
Fri, 21 Feb 2025 04:40:24 +0000 (04:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:30 +0000 (14:39 +0200)
commitf8dfd7c50170cdf68183f73ecb3a3e87a9837081
tree840304a2748b6d23a4346f8bf44bb6bd0b862335
parente1fc76b2bbf36a687b1c060a421d3618326be15e
ASoC: codecs: wsa884x: report temps to hwmon in millidegree of Celsius

[ Upstream commit d776f016d24816f15033169dcd081f077b6c10f4 ]

Temperatures are reported in units of Celsius however hwmon expects
values to be in millidegree of Celsius. Userspace tools observe values
close to zero and report it as "Not available" or incorrect values like
0C or 1C. Add a simple conversion to fix that.

Before the change:

wsa884x-virtual-0
Adapter: Virtual device
temp1:         +0.0°C
--
wsa884x-virtual-0
Adapter: Virtual device
temp1:         +0.0°C

Also reported as N/A before first amplifier power on.

After this change and initial wsa884x power on:

wsa884x-virtual-0
Adapter: Virtual device
temp1:        +39.0°C
--
wsa884x-virtual-0
Adapter: Virtual device
temp1:        +37.0°C

Tested on sm8550 only.

Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Link: https://patch.msgid.link/20250221044024.1207921-1-alexey.klimov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/wsa884x.c