[PATCH v11 0/6] HID: intel-thc-hid: intel-ipts: support THC IPTS ports

From: Emfox Zhou

Date: Wed Dec 02 2026 - 21:04:43 EST


The THC ports on Tiger Lake, Lakefield, Alder Lake and Raptor Lake can
run in IPTS mode: plain SPI with a private framing instead of HIDSPI,
which is all intel-thc-hid handles today. This adds a backend for them
next to intel-quickspi and intel-quicki2c, on top of the same core.

1/6 expose the port operations IPTS needs (core)
2/6 bring up the port
3/6 receive reports
4/6 add the HID device
5/6 handle system sleep
6/6 document the IPTS mode

Changes in v11:

- The two reset calls are one thc_port_reset(hold): the start asserts
the line, waits and releases it, the stop keeps it asserted. DEVRST
is zero for asserted and one for released, as the THC datasheet
describes it.
- thc_spi_hz_from_div() is gone, and so is the clamp around it: the
driver converts the divisor the configuration block reports on its
own and lets thc_get_spi_freq_div_val() pick the gear. A Surface Pro 8
reports 0x09e351e8, divisor 4, 31.25 MHz.
- The quiesce warning stays: a call that changes nothing is worth
knowing about.
- ipts.c is split into ipts-protocol.c and ipts-hid.c, the way
quickspi and quicki2c are laid out.
- Commit messages are shorter; the design detail they carried moved to
Documentation/hid/intel-thc-hid.rst, which gains a section on the
driver structure.
- Comments follow the kernel style across the series.
- Also from our own review: the interrupt is left open whenever no reset
is running, and a run that finds a reset in flight claims nothing, so a
transmit completion already on the wire is still delivered; the tables
of a failed reset are freed on the next start or stop, and the SPI
divisor is rounded up before the gear is picked.

v10: https://lore.kernel.org/linux-input/cover.1795794049.git.emfox@xxxxxxxxxx/

This is based on the two intel-thc fix series below, applied in this order:

[PATCH v3 0/5] HID: intel-thc-hid: intel-thc: DMA lifetime fixes
https://lore.kernel.org/linux-input/cover.1795791500.git.emfox@xxxxxxxxxx/

[PATCH v8] HID: intel-thc-hid: intel-thc: restore PRD table capacity
https://lore.kernel.org/linux-input/20261127234500.424242-1-emfox@xxxxxxxxxx/

The first gives the DMA engines a lifetime, the second keeps a PRD table
from overrunning after a reset; the recovery path here relies on both,
and they overlap in intel-thc-dma.c, so apply them in that order.

The base-commit below is the tree those two series are based on. The six
patches here apply on top of them, not to the base alone: 1/6 extends the
core file the first series rewrites.

The hardware facts this driver relies on - port IDs, the configuration
block layout, frame codes and header sizes - were confirmed on a Surface
Pro 8 with a 045e:0c37 controller.

Emfox Zhou (6):
HID: intel-thc-hid: intel-thc: expose the port operations IPTS needs
HID: intel-thc-hid: intel-ipts: bring up the port
HID: intel-thc-hid: intel-ipts: receive reports
HID: intel-thc-hid: intel-ipts: add the HID device
HID: intel-thc-hid: intel-ipts: handle system sleep
HID: intel-thc-hid: intel-ipts: document the IPTS mode

Documentation/hid/intel-thc-hid.rst | 136 +++-
drivers/hid/intel-thc-hid/Kconfig | 13 +
drivers/hid/intel-thc-hid/Makefile | 5 +
.../hid/intel-thc-hid/intel-ipts/ipts-hid.c | 267 +++++++
.../intel-thc-hid/intel-ipts/ipts-protocol.c | 682 ++++++++++++++++++
drivers/hid/intel-thc-hid/intel-ipts/ipts.h | 225 ++++++
.../hid/intel-thc-hid/intel-ipts/pci-ipts.c | 228 ++++++
.../intel-thc-hid/intel-thc/intel-thc-dev.c | 58 ++
.../intel-thc-hid/intel-thc/intel-thc-dev.h | 2 +
9 files changed, 1615 insertions(+), 1 deletion(-)
create mode 100644 drivers/hid/intel-thc-hid/intel-ipts/ipts-hid.c
create mode 100644 drivers/hid/intel-thc-hid/intel-ipts/ipts-protocol.c
create mode 100644 drivers/hid/intel-thc-hid/intel-ipts/ipts.h
create mode 100644 drivers/hid/intel-thc-hid/intel-ipts/pci-ipts.c


base-commit: 4f048c56c2697000105a75c28b918ae76f11fcef
prerequisite-patch-id: 1921888f4500ace81255e73142f40b89e4a75fd2
prerequisite-patch-id: e87bd84cb62f9d122e80b0636ec02103ee4eef96
prerequisite-patch-id: 682e6eeea6eb7792c7b2f00b14226cb9a3d1c56c
prerequisite-patch-id: efd51e0ca2778c5028ba030ddfaee6da5a82622d
prerequisite-patch-id: 1fa0e32622986734adb7ce7040400f169bc26f2b
prerequisite-patch-id: 06a128cb2c3db1f80116b314d11d69cda0d4dce0