Skip to content

Add spi-hid transport driver

Jingyuan Liang linux-devicetree linux-doc linux-input linux-spi linux-trace-kernel lkml sashiko-reviews 7 versions – In review

Get series with b4
b4 am [email protected] change-id 20260212-send-upstream-75f6fd9ed92e

Versions newest first

  1. v7 Latest11 patches 6 repliesIn review
  2. v611 patches 7 repliesSuperseded
  3. v511 patches 12 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v411 patches3 repliesSuperseded
v311 patches5 repliesSuperseded
v211 patches2 repliesSuperseded
v112 patches10 repliesSuperseded

Changes in v7 from the cover letter · 22 lines

- Drop the error counter sysfs attributes.
- Print error codes in power up/down failure messages.
- Reject an empty report descriptor.
- Check the minimum input report body size instead of max_input_length.
- Clear reset_attempts only after the report descriptor check succeeds.
- Drop pending work flags when the error handler resets the device.
- Don't schedule a reset when GET_FEATURE fails with -ENODEV.
- dt-bindings: drop the address/opcode properties and the "hid-over-spi" fallback; the compatible determines them.
- dt-bindings: fix authorship to match the Signed-off-by chain.
- dt-bindings: update maintainer email addresses.
- dt-bindings: drop Rob's Reviewed-by because the binding changed.
- of: use per-compatible match data; match only "microsoft,g6-touch-digitizer".
- pm: disable reset_work across suspend.
- pm: check deassert_reset(); schedule recovery on reset timeout.
- pm: skip hid_driver_reset_resume() when the device is not ready.
- pm: log power_down() failure instead of rolling back suspend.
- pm: use dev_err() instead of dev_WARN_ONCE() for a failed device
descriptor request.
- panel follower: start with reset_work disabled.
- Drop Dale's Tested-by from the OF, PM and panel follower patches
because they changed since v4.
- Link to v6: https://lore.kernel.org/r/[email protected]

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11Documentation: Correction in HID output_report callback description.Documentation/hid/hid-transport.rst+2 -20 replies
2/11HID: Add BUS_SPI support and define HID_SPI_DEVICE macrodrivers/hid/hid-core.c include/linux/hid.h+5 -00 replies
3/11HID: spi-hid: add transport driver skeleton for HID over SPI busdrivers/hid/Kconfig drivers/hid/Makefile drivers/hid/spi-hid/Kconfig +2 more+186 -00 replies
4/11HID: spi-hid: add spi-hid driver HID layerdrivers/hid/spi-hid/spi-hid-core.c+588 -00 replies
5/11HID: spi-hid: add HID SPI protocol implementationdrivers/hid/spi-hid/spi-hid-core.c+746 -351 reply
6/11HID: spi-hid: add spi_hid tracesdrivers/hid/spi-hid/Makefile drivers/hid/spi-hid/spi-hid-core.c drivers/hid/spi-hid/spi-hid-core.h +1 more+328 -860 replies
7/11HID: spi-hid: add ACPI support for HID over SPIdrivers/hid/spi-hid/Kconfig drivers/hid/spi-hid/Makefile drivers/hid/spi-hid/spi-hid-acpi.c +2 more+339 -270 replies
8/11dt-bindings: input: Document hid-over-spi DT schemaDocumentation/devicetree/bindings/input/hid-over-spi.yaml+75 -03 replies
9/11HID: spi-hid: add device tree support for HID over SPIdrivers/hid/spi-hid/Kconfig drivers/hid/spi-hid/Makefile drivers/hid/spi-hid/spi-hid-of.c+226 -00 replies
10/11HID: spi-hid: add power management implementationdrivers/hid/spi-hid/spi-hid-acpi.c drivers/hid/spi-hid/spi-hid-core.c drivers/hid/spi-hid/spi-hid-core.h +2 more+192 -21 reply
11/11HID: spi-hid: add panel follower supportdrivers/hid/spi-hid/Kconfig drivers/hid/spi-hid/spi-hid-core.c drivers/hid/spi-hid/spi-hid-core.h+177 -551 reply

Reviews trailers per patch

4 of 11 patches have a Reviewed-by or Acked-by.

PatchDmitry TorokhovDale WhinhamConor DooleyRob Herring (Arm)
1/11R-b
2/11R-b T-b
3/11T-b
4/11T-b
5/11T-b
6/11T-b
7/11R-b T-b
8/11R-b R-b
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v7 thread

Cover letter [PATCH v7 00/11] Add spi-hid transport driver

This series picks up the spi-hid driver work originally started by Microsoft. The patch breakdown has been modified and the implementation has been refactored to address upstream feedback and testing issues. We are submitting this as a new series while keeping the original sign-off chain to reflect the history.

Same as the original series, there is a change to HID documentation, some HID core changes to support a SPI device, the SPI HID transport driver, and HID over SPI Device Tree binding. We have added the HID over SPI ACPI support, power management, panel follower, and quirks for Ilitek touch controllers.

Original authors: Jarrett Schultz <[email protected]>,
Dmitry Antipov <[email protected]>

---
Changes in v7:
- Drop the error counter sysfs attributes.
- Print error codes in power up/down failure messages.
- Reject an empty report descriptor.
- Check the minimum input report body size instead of max_input_length.
- Clear reset_attempts only after the report descriptor check succeeds.
- Drop pending work flags when the error handler resets the device.
- Don't schedule a reset when GET_FEATURE fails with -ENODEV.
- dt-bindings: drop the address/opcode properties and the "hid-over-spi" fallback; the compatible determines them.
- dt-bindings: fix authorship to match the Signed-off-by chain.
- dt-bindings: update maintainer email addresses.
- dt-bindings: drop Rob's Reviewed-by because the binding changed.
- of: use per-compatible match data; match only "microsoft,g6-touch-digitizer".
- pm: disable reset_work across suspend.
- pm: check deassert_reset(); schedule recovery on reset timeout.
- pm: skip hid_driver_reset_resume() when the device is not ready.
- pm: log power_down() failure instead of rolling back suspend.
- pm: use dev_err() instead of dev_WARN_ONCE() for a failed device
descriptor request.
- panel follower: start with reset_work disabled.
- Drop Dale's Tested-by from the OF, PM and panel follower patches
because they changed since v4.
- Link to v6: https://lore.kernel.org/r/[email protected]

Changes in v6:
- Take output_lock while reallocating buffers in ll_start()
- Don't drop input reports while a refreshed device probes
- OF: drop mod_devicetable.h, use named initializers, fix alignment
- Move the dt-bindings patch before the OF driver patch
- Drop Tested-by from the documentation and DT binding patches
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- Fix request/response races; match GET_FEATURE responses by report ID
- Reset the device on response timeout; wait uninterruptibly
- Validate device descriptor and report lengths; fix buffer sizing
- Honor rtype in raw_request(); fix GET_REPORT off-by-one
- Use hid_safe_input_report(); forward input reports only while open
- Disable IRQ around hid_device teardown; fix a sparse warning
- Use disable_work_sync() for reset_work in remove()
- Cap trace copies at 64 bytes; cacheline-align read approval buffers
- ACPI: select RESET_CONTROLLER, use device_reset_optional()
- OF & DT: read opcodes as u8, use dev_err_probe(), require reg
- PM: cancel reset_work on suspend, wait for reset before
reset_resume(), fix IRQ imbalance on resume failure
- Panel follower: fix regulator/IRQ imbalance; depend on DRM || !DRM
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Extended io_lock scope to protect the shid->hid pointer lifecycle
against races with the IRQ handler
- Cacheline-aligned DMA buffers, enforced 4-byte alignment
- Added error rollback for failed suspend/resume transitions
- Moved IRQ request to probe with IRQF_NO_AUTOEN (disabled by default)
- DT Bindings & OF Driver:
- Required a device-specific compatible string in the schema.
- Added description to explain why opcodes and addresses properties
need to be defined in the schema
- Added spi-peripheral-props.yaml reference and switched to unevaluatedProperties: false.
- Added fallback to default timing parameters in OF driver if match
data is missing.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Add io_lock init
- Relocate tracepoints to drivers/hid/spi-hid/ and fix tracepoint macros
- Add tracepoints for sync, error handling, reset, and report processing
- Clean up internal includes and fix Makefile CFLAGS
- Add more details in v2 changelog
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Clean up DT bindings: fix formatting and remove timing and flags properties
- Update DT binding example: use a device-specific compatible and drop reset_assert
- Simplify ACPI/OF match tables by removing ACPI_PTR/of_match_ptr
- Refactor OF driver to use match data for timing parameters instead
of DT properties
- Switch to fsleep() for delays in ACPI and OF drivers
- Drop patch 12 as it is vendor specific
- Add a lock to fix input/output concurrency race
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Angela Czubak (2):
HID: spi-hid: add transport driver skeleton for HID over SPI bus
HID: spi-hid: add ACPI support for HID over SPI

Dmitry Antipov (1):
dt-bindings: input: Document hid-over-spi DT schema

Jarrett Schultz (3):
Documentation: Correction in HID output_report callback description.
HID: Add BUS_SPI support and define HID_SPI_DEVICE macro
HID: spi-hid: add device tree support for HID over SPI

Jingyuan Liang (5):
HID: spi-hid: add spi-hid driver HID layer
HID: spi-hid: add HID SPI protocol implementation
HID: spi-hid: add spi_hid traces
HID: spi-hid: add power management implementation
HID: spi-hid: add panel follower support

 .../devicetree/bindings/input/hid-over-spi.yaml    |   75 +
 Documentation/hid/hid-transport.rst                |    4 +-
 drivers/hid/Kconfig                                |    2 +
 drivers/hid/Makefile                               |    2 +
 drivers/hid/hid-core.c                             |    3 +
 drivers/hid/spi-hid/Kconfig                        |   50 +
 drivers/hid/spi-hid/Makefile                       |   12 +
 drivers/hid/spi-hid/spi-hid-acpi.c                 |  261 +++
 drivers/hid/spi-hid/spi-hid-core.c                 | 1698 ++++++++++++++++++++
 drivers/hid/spi-hid/spi-hid-core.h                 |  112 ++
 drivers/hid/spi-hid/spi-hid-of.c                   |  211 +++
 drivers/hid/spi-hid/spi-hid-trace.h                |  184 +++
 drivers/hid/spi-hid/spi-hid.h                      |   45 +
 include/linux/hid.h                                |    2 +
 14 files changed, 2659 insertions(+), 2 deletions(-)

---
base-commit: ee9c669f9bf5fd2c24206746ded9382fe810df89
change-id: 20260212-send-upstream-75f6fd9ed92e

Best regards,

Signature · 1 line
Jingyuan Liang <[email protected]>