mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Emfox Zhou <emfox@debian.org>
To: Even Xu <even.xu@intel.com>, Xinpeng Sun <xinpeng.sun@intel.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v11 0/6] HID: intel-thc-hid: intel-ipts: support THC IPTS ports
Date: Thu,  3 Dec 2026 10:04:09 +0800	[thread overview]
Message-ID: <cover.1796215044.git.emfox@debian.org> (raw)

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@debian.org/

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@debian.org/

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

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

             reply	other threads:[~2026-12-03  2:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  2:04 Emfox Zhou [this message]
2026-12-03  2:04 ` [PATCH v11 1/6] HID: intel-thc-hid: intel-thc: expose the port operations IPTS needs Emfox Zhou
2026-12-03  2:04 ` [PATCH v11 2/6] HID: intel-thc-hid: intel-ipts: bring up the port Emfox Zhou
2026-12-03  2:04 ` [PATCH v11 3/6] HID: intel-thc-hid: intel-ipts: receive reports Emfox Zhou
2026-12-03  2:04 ` [PATCH v11 4/6] HID: intel-thc-hid: intel-ipts: add the HID device Emfox Zhou
2026-12-03  2:04 ` [PATCH v11 5/6] HID: intel-thc-hid: intel-ipts: handle system sleep Emfox Zhou
2026-12-03  2:04 ` [PATCH v11 6/6] HID: intel-thc-hid: intel-ipts: document the IPTS mode Emfox Zhou

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=cover.1796215044.git.emfox@debian.org \
    --to=emfox@debian.org \
    --cc=bentiss@kernel.org \
    --cc=even.xu@intel.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xinpeng.sun@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®