Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH v2] hwmon: Add NCT6801D EC sensor support for Lenovo workstations
@ 2026-11-13 10:25 Jiqi Li
  2026-11-13 10:25 ` [PATCH v2 1/1] hwmon: Add driver for the NCT6801D EC sensor window Jiqi Li
  0 siblings, 1 reply; 3+ messages in thread
From: Jiqi Li @ 2026-11-13 10:25 UTC (permalink / raw)
  To: linux-hwmon; +Cc: linux, jdelvare, lijq9

This adds a hwmon driver for the fan and temperature sensors that the
Nuvoton NCT6801D EC publishes in a shared-memory window, as found on the
Lenovo P3 TWR.

The controller has no hardware monitor logical device. LDN 0Bh is the
ATXPGD/BEEP/DDR4 block, and the registers nct6683 expects at
0x100/0x140/0x160 do not exist in the Datasheet at all.

The window is read directly. The DSDT also defines WQD1..WQD5, which read
the same offsets under the MWMI mutex, gated by FAAS bit 3. That bit is
clear on this firmware, and the driver refuses to bind if it is set at
probe time, so the two access paths do not run concurrently as long as
the BIOS leaves the flag clear.

Testing on a Lenovo P3 TWR: the driver locates the window (0xfe500200)
without any module parameter. Under full load the CPU fan goes from 808
to 2920 RPM and the CPU temperature from 32 to 100 C. At the same moment
ACPI TCPU reads 100.05 C, TCPU_PCI 100.00 C, x86_pkg_temp 100.00 C and
coretemp 101.0 C, i.e. four independent sources agree within 1 C.
checkpatch reports 0 errors and 0 warnings.

The layout inside the window is defined by platform firmware rather than
by the controller, so the offsets in this driver are the ones the P3 TWR
firmware generates and each layout is selected by DMI. The driver is
named after the Lenovo EC shared-memory window mechanism rather than
after the controller or a single model: the same mechanism may appear on
other Lenovo systems with a different layout, and supporting one then
means one more DMI entry and one more layout table. A machine whose
firmware lays the window out differently fails the plausibility check and
reports no sensors rather than wrong ones.

Changes in v2:
- Drop the nct6683 patch. That driver cannot drive this part, so adding
  the ID only turned into a probe failure.
- Match by DMI instead of the controller ID, since the layout comes from
  the firmware.
- Name the driver after the window mechanism instead of the controller.
- Read the ACPI FAAS flag at probe and refuse to bind if the ACPI sensor
  interface is enabled.


Jiqi Li (1):
  hwmon: Add driver for the NCT6801D EC sensor window

 drivers/hwmon/Kconfig              |  18 +
 drivers/hwmon/Makefile             |   1 +
 drivers/hwmon/lenovo-shm-sensors.c | 547 +++++++++++++++++++++++++++++
 3 files changed, 566 insertions(+)
 create mode 100644 drivers/hwmon/lenovo-shm-sensors.c

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-13 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 10:25 [PATCH v2] hwmon: Add NCT6801D EC sensor support for Lenovo workstations Jiqi Li
2026-11-13 10:25 ` [PATCH v2 1/1] hwmon: Add driver for the NCT6801D EC sensor window Jiqi Li
2026-11-13 10:50   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox