Commit a65b3c3e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hid-for-linus-2024091602' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid

Pull HID updates from Jiri Kosina:

 - New HID over SPI driver for Goodix devices that don't follow
   Microsoft's HID-over-SPI specification, so a separate driver is
   needed. Currently supported device is GT7986U touchscreen (Charles
   Wang)

 - support for new hardware features in Wacom driver (high-res wheel
   scrolling, touchstrings with relative motions, support for two
   touchrings) (Jason Gerecke)

 - support for customized vendor firmware loading in intel-ish driver
   (Zhang Lixu)

 - fix for theoretical race condition in i2c-hid (Dmitry Torokhov)

 - support for HIDIOCREVOKE -- evdev's EVIOCREVOKE equivalent in hidraw
   (Peter Hutterer)

 - initial hidraw selftest implementation (Benjamin Tissoires)

 - constification of device-specific report descriptors (Thomas
   Weißschuh)

 - other small assorted fixes and device ID / quirk additions

* tag 'hid-for-linus-2024091602' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (54 commits)
  hid: cp2112: Use irq_get_trigger_type() helper
  HID: i2c-hid: ensure various commands do not interfere with each other
  HID: multitouch: Add support for Thinkpad X12 Gen 2 Kbd Portfolio
  HID: wacom: Do not warn about dropped packets for first packet
  HID: wacom: Support sequence numbers smaller than 16-bit
  HID: lg: constify fixed up report descriptor
  HID: uclogic: constify fixed up report descriptor
  HID: waltop: constify fixed up report descriptor
  HID: sony: constify fixed up report descriptor
  HID: pxrc: constify fixed up report descriptor
  HID: steelseries: constify fixed up report descriptor
  HID: viewsonic: constify fixed up report descriptor
  HID: vrc2: constify fixed up report descriptor
  HID: xiaomi: constify fixed up report descriptor
  HID: maltron: constify fixed up report descriptor
  HID: keytouch: constify fixed up report descriptor
  HID: holtek-kbd: constify fixed up report descriptor
  HID: dr: constify fixed up report descriptor
  HID: bigbenff: constify fixed up report descriptor
  HID: picoLCD: Use backlight power constants
  ...
parents d5e65d1f 0aa04373
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -23,7 +23,9 @@ properties:
          - enum:
              - elan,ekth5015m
          - const: elan,ekth6915
      - const: elan,ekth6915
      - enum:
          - elan,ekth6915
          - elan,ekth6a12nay

  reg:
    const: 0x10
+71 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/goodix,gt7986u.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GOODIX GT7986U SPI HID Touchscreen

maintainers:
  - Charles Wang <charles.goodix@gmail.com>

description: Supports the Goodix GT7986U touchscreen.
  This touch controller reports data packaged according to the HID protocol,
  but is incompatible with Microsoft's HID-over-SPI protocol.

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

properties:
  compatible:
    enum:
      - goodix,gt7986u

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  reset-gpios:
    maxItems: 1

  goodix,hid-report-addr:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      The register address for retrieving HID report data.
      This address is related to the device firmware and may
      change after a firmware update.

  spi-max-frequency: true

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - reset-gpios
  - goodix,hid-report-addr

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/gpio/gpio.h>

    spi {
      #address-cells = <1>;
      #size-cells = <0>;

      touchscreen@0 {
        compatible = "goodix,gt7986u";
        reg = <0>;
        interrupt-parent = <&gpio>;
        interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
        reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
        spi-max-frequency = <10000000>;
        goodix,hid-report-addr = <0x22c8c>;
      };
    };

...
+29 −0
Original line number Diff line number Diff line
@@ -404,6 +404,35 @@ For more detailed information, please refer to the flow descriptions provided be
  | ISHTP Driver  |                                                    | ISH Bootloader  |
  +---------------+                                                    +-----------------+

Vendor Custom Firmware Loading
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The firmware running inside ISH can be provided by Intel or developed by vendors using the Firmware Development Kit (FDK) provided by Intel.
Intel will upstream the Intel-built firmware to the ``linux-firmware.git`` repository, located under the path ``intel/ish/``. For the Lunar Lake platform, the Intel-built ISH firmware will be named ``ish_lnlm.bin``.
Vendors who wish to upstream their custom firmware should follow these guidelines for naming their firmware files:

- The firmware filename should use one of the following patterns:

  - ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}_${PRODUCT_SKU_CRC32}.bin``
  - ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_SKU_CRC32}.bin``
  - ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}.bin``
  - ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}.bin``

- ``${intel_plat_gen}`` indicates the Intel platform generation (e.g., ``lnlm`` for Lunar Lake) and must not exceed 8 characters in length.
- ``${SYS_VENDOR_CRC32}`` is the CRC32 checksum of the ``sys_vendor`` value from the DMI field ``DMI_SYS_VENDOR``.
- ``${PRODUCT_NAME_CRC32}`` is the CRC32 checksum of the ``product_name`` value from the DMI field ``DMI_PRODUCT_NAME``.
- ``${PRODUCT_SKU_CRC32}`` is the CRC32 checksum of the ``product_sku`` value from the DMI field ``DMI_PRODUCT_SKU``.

During system boot, the ISH Linux driver will attempt to load the firmware in the following order, prioritizing custom firmware with more precise matching patterns:

1. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}_${PRODUCT_SKU_CRC32}.bin``
2. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_SKU_CRC32}.bin``
3. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}.bin``
4. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}.bin``
5. ``intel/ish/ish_${intel_plat_gen}.bin``

The driver will load the first matching firmware and skip the rest. If no matching firmware is found, it will proceed to the next pattern in the specified order. If all searches fail, the default Intel firmware, listed last in the order above, will be loaded.

ISH Debugging
-------------

+6 −0
Original line number Diff line number Diff line
@@ -404,6 +404,12 @@ config HID_VIVALDI_COMMON
	  option so that drivers can use common code to parse the HID
	  descriptors for vivaldi function row keymap.

config HID_GOODIX_SPI
	tristate "Goodix GT7986U SPI HID touchscreen"
	depends on SPI_MASTER
	help
	  Support for Goodix GT7986U SPI HID touchscreen device.

config HID_GOOGLE_HAMMER
	tristate "Google Hammer Keyboard"
	select HID_VIVALDI_COMMON
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ obj-$(CONFIG_HID_GEMBIRD) += hid-gembird.o
obj-$(CONFIG_HID_GFRM)		+= hid-gfrm.o
obj-$(CONFIG_HID_GLORIOUS)  += hid-glorious.o
obj-$(CONFIG_HID_VIVALDI_COMMON) += hid-vivaldi-common.o
obj-$(CONFIG_HID_GOODIX_SPI)	+= hid-goodix-spi.o
obj-$(CONFIG_HID_GOOGLE_HAMMER)	+= hid-google-hammer.o
obj-$(CONFIG_HID_GOOGLE_STADIA_FF)	+= hid-google-stadiaff.o
obj-$(CONFIG_HID_VIVALDI)	+= hid-vivaldi.o
Loading