All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Alexey Klimov <alexey.klimov@linaro.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>,
	lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: [PATCH AUTOSEL 6.13 02/16] ASoC: codecs: wsa884x: report temps to hwmon in millidegree of Celsius
Date: Mon, 17 Mar 2025 12:37:11 -0400	[thread overview]
Message-ID: <20250317163725.1892824-2-sashal@kernel.org> (raw)
In-Reply-To: <20250317163725.1892824-1-sashal@kernel.org>

From: Alexey Klimov <alexey.klimov@linaro.org>

[ 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
index 86df5152c547b..560a2c04b6955 100644
--- a/sound/soc/codecs/wsa884x.c
+++ b/sound/soc/codecs/wsa884x.c
@@ -1875,7 +1875,7 @@ static int wsa884x_get_temp(struct wsa884x_priv *wsa884x, long *temp)
 		 * Reading temperature is possible only when Power Amplifier is
 		 * off. Report last cached data.
 		 */
-		*temp = wsa884x->temperature;
+		*temp = wsa884x->temperature * 1000;
 		return 0;
 	}
 
@@ -1934,7 +1934,7 @@ static int wsa884x_get_temp(struct wsa884x_priv *wsa884x, long *temp)
 	if ((val > WSA884X_LOW_TEMP_THRESHOLD) &&
 	    (val < WSA884X_HIGH_TEMP_THRESHOLD)) {
 		wsa884x->temperature = val;
-		*temp = val;
+		*temp = val * 1000;
 		ret = 0;
 	} else {
 		ret = -EAGAIN;
-- 
2.39.5


  reply	other threads:[~2025-03-17 16:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 16:37 [PATCH AUTOSEL 6.13 01/16] x86/hyperv/vtl: Stop kernel from probing VTL0 low memory Sasha Levin
2025-03-17 16:37 ` Sasha Levin [this message]
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 03/16] ASoC: cs42l43: Add jack delay debounce after suspend Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 04/16] ASoC: rt1320: set wake_capable = 0 explicitly Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 05/16] wifi: mac80211: flush the station before moving it to UN-AUTHORIZED state Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 06/16] wifi: mac80211: fix SA Query processing in MLO Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 07/16] locking/semaphore: Use wake_q to wake up processes outside lock critical section Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 08/16] x86/hyperv: Fix output argument to hypercall that changes page visibility Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 09/16] x86/sgx: Warn explicitly if X86_FEATURE_SGX_LC is not enabled Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 10/16] drm/xe/guc_pc: Retry and wait longer for GuC PC start Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 11/16] nvme-pci: fix stuck reset on concurrent DPC and HP Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 12/16] drm/amd: Keep display off while going into S4 Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 13/16] net: devmem: do not WARN conditionally after netdev_rx_queue_restart() Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 14/16] platform/surface: aggregator_registry: Add Support for Surface Pro 11 Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 15/16] selftests: netfilter: skip br_netfilter queue tests if kernel is tainted Sasha Levin
2025-03-17 16:37 ` [PATCH AUTOSEL 6.13 16/16] ALSA: hda/realtek: Add mute LED quirk for HP Pavilion x360 14-dy1xxx Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250317163725.1892824-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alexey.klimov@linaro.org \
    --cc=broonie@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.