]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: ath12k: add basic hwmon temperature reporting
authorMaharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
Mon, 23 Feb 2026 13:26:22 +0000 (18:56 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 26 Feb 2026 21:25:39 +0000 (13:25 -0800)
commit151322bccdbdb132f5a73cc8ad5d3ab89b90ed52
treeb95dcc8c89db97bc87febb8e9afff0078e593f9e
parent0ef4738f0d38f103e525ffb12c112a935c2cf011
wifi: ath12k: add basic hwmon temperature reporting

Add initial thermal support by wiring up a per-radio (pdev) hwmon temperature
sensor backed by the existing WMI pdev temperature command and event.
When userspace reads the sysfs file temp1_input, the driver sends
WMI_PDEV_GET_TEMPERATURE_CMDID (tag WMI_TAG_PDEV_GET_TEMPERATURE_CMD) and waits
for the corresponding WMI_PDEV_TEMPERATURE_EVENTID
(tag WMI_TAG_PDEV_TEMPERATURE_EVENT) to get the temperature and pdev_id.

Export the reported value in millidegrees Celsius as required by hwmon.
The temperature reported is per-radio (pdev). In a multi-radio wiphy under a
single phy, a separate hwmon device is created for each radio.

Sample command and output:
$ cat /sys/devices/pci0000:00/.../ieee80211/phyX/hwmonY/temp1_input
$ 50000

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3

Co-developed-by: Aishwarya R <aishwarya.r@oss.qualcomm.com>
Signed-off-by: Aishwarya R <aishwarya.r@oss.qualcomm.com>
Signed-off-by: Maharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20260223132622.43464-1-maharaja.kennadyrajan@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/Makefile
drivers/net/wireless/ath/ath12k/core.c
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/mac.c
drivers/net/wireless/ath/ath12k/thermal.c [new file with mode: 0644]
drivers/net/wireless/ath/ath12k/thermal.h [new file with mode: 0644]
drivers/net/wireless/ath/ath12k/wmi.c