Skip to content

HID: intel-thc-hid: intel-ipts: support THC IPTS ports

Emfox Zhou linux-input lkml 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest5 patches 1 replyIn review
  2. v85 patches 0 repliesSuperseded
  3. v75 patches 0 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v65 patches0 repliesSuperseded
v55 patches0 repliesSuperseded
v45 patches0 repliesSuperseded
v35 patches0 repliesSuperseded
v25 patches0 repliesSuperseded
v15 patches0 repliesSuperseded

Changes in v9 from the cover letter

- The reset count a feature answer is compared with is sampled inside the send, under the lock a reset must take, so only one that started after the frame went out can change it.

- The interrupt is masked before a resume brings the port back, as probe already does.

- A failed reset no longer wakes the queue, which no waiter could act
on: the port stays masked until it is started again.

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5HID: intel-thc-hid: intel-ipts: bring up the portdrivers/hid/intel-thc-hid/Kconfig drivers/hid/intel-thc-hid/Makefile drivers/hid/intel-thc-hid/intel-ipts/ipts.c +2 more+502 -00 replies
2/5HID: intel-thc-hid: intel-ipts: receive reportsdrivers/hid/intel-thc-hid/intel-ipts/ipts.c drivers/hid/intel-thc-hid/intel-ipts/ipts.h drivers/hid/intel-thc-hid/intel-ipts/pci-ipts.c+385 -00 replies
3/5HID: intel-thc-hid: intel-ipts: add the HID devicedrivers/hid/intel-thc-hid/intel-ipts/ipts.c drivers/hid/intel-thc-hid/intel-ipts/ipts.h drivers/hid/intel-thc-hid/intel-ipts/pci-ipts.c+509 -200 replies
4/5HID: intel-thc-hid: intel-ipts: handle system sleepdrivers/hid/intel-thc-hid/intel-ipts/pci-ipts.c+33 -00 replies
5/5HID: intel-thc-hid: intel-ipts: document the IPTS modeDocumentation/hid/intel-thc-hid.rst+108 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v9 yet.

Read the v9 thread

Cover letter [PATCH v9 0/5] HID: intel-thc-hid: intel-ipts: support THC IPTS ports

The THC ports on Tiger Lake, Lakefield, Alder Lake and Raptor Lake 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.

It is based on v7.4-rc3 with two core fix series applied, both still under review:

https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]

One gives the DMA engines a lifetime, the other keeps a PRD table from overrunning after a reset, and the recovery path here relies on both. They overlap in intel-thc-dma.c: apply the first, then the second.

Register, DMA and interrupt work goes through the exported intel-thc API, except in four places where the core has no call for it: the reset, port-supported and quiesce-state bits of THC_M_PRT_CONTROL are accessed directly. Nothing outside the new directory changes except Kconfig and Makefile.

The hardware facts - port IDs, configuration block layout, frame codes and header sizes - come from the ithc driver linux-surface ships, at
https://github.com/quo/ithc-linux 6d53c9c (dual licensed GPL-2.0 / BSD-2-Clause); no code is taken from it. The layout, the frame format and the ordering between quiesce, interrupt configuration and the DMA engines are the parts most likely to need scrutiny; each is argued in the commit message that relies on it. All of it was confirmed on a Surface Pro 8 with a 045e:0c37 controller.

The first four patches each leave a state that builds and loads: port bring-up, DMA and interrupts, HID registration, system sleep. The fifth documents the frame format and the IPTS handshake.

Link to v8: https://lore.kernel.org/r/[email protected]

Changes in v9:

- The reset count a feature answer is compared with is sampled inside the send, under the lock a reset must take, so only one that started after the frame went out can change it.

- The interrupt is masked before a resume brings the port back, as probe already does.

- A failed reset no longer wakes the queue, which no waiter could act
on: the port stays masked until it is started again.

Emfox Zhou (5):
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           | 109 +-
 drivers/hid/intel-thc-hid/Kconfig             |  14 +
 drivers/hid/intel-thc-hid/Makefile            |   4 +
 drivers/hid/intel-thc-hid/intel-ipts/ipts.c   | 989 ++++++++++++++++++
 drivers/hid/intel-thc-hid/intel-ipts/ipts.h   | 201 ++++
 .../hid/intel-thc-hid/intel-ipts/pci-ipts.c   | 201 ++++
 6 files changed, 1517 insertions(+), 1 deletion(-)
 create mode 100644 drivers/hid/intel-thc-hid/intel-ipts/ipts.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: aebb7274476403040d582c61478df8f4a7bf9cd3