Skip to content

Commit a65b3c3

Browse files
committed
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 ...
2 parents d5e65d1 + 0aa0437 commit a65b3c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2150
-732
lines changed

Documentation/devicetree/bindings/input/elan,ekth6915.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ properties:
2323
- enum:
2424
- elan,ekth5015m
2525
- const: elan,ekth6915
26-
- const: elan,ekth6915
26+
- enum:
27+
- elan,ekth6915
28+
- elan,ekth6a12nay
2729

2830
reg:
2931
const: 0x10
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/input/goodix,gt7986u.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: GOODIX GT7986U SPI HID Touchscreen
8+
9+
maintainers:
10+
- Charles Wang <[email protected]>
11+
12+
description: Supports the Goodix GT7986U touchscreen.
13+
This touch controller reports data packaged according to the HID protocol,
14+
but is incompatible with Microsoft's HID-over-SPI protocol.
15+
16+
allOf:
17+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
18+
19+
properties:
20+
compatible:
21+
enum:
22+
- goodix,gt7986u
23+
24+
reg:
25+
maxItems: 1
26+
27+
interrupts:
28+
maxItems: 1
29+
30+
reset-gpios:
31+
maxItems: 1
32+
33+
goodix,hid-report-addr:
34+
$ref: /schemas/types.yaml#/definitions/uint32
35+
description:
36+
The register address for retrieving HID report data.
37+
This address is related to the device firmware and may
38+
change after a firmware update.
39+
40+
spi-max-frequency: true
41+
42+
additionalProperties: false
43+
44+
required:
45+
- compatible
46+
- reg
47+
- interrupts
48+
- reset-gpios
49+
- goodix,hid-report-addr
50+
51+
examples:
52+
- |
53+
#include <dt-bindings/interrupt-controller/irq.h>
54+
#include <dt-bindings/gpio/gpio.h>
55+
56+
spi {
57+
#address-cells = <1>;
58+
#size-cells = <0>;
59+
60+
touchscreen@0 {
61+
compatible = "goodix,gt7986u";
62+
reg = <0>;
63+
interrupt-parent = <&gpio>;
64+
interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
65+
reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
66+
spi-max-frequency = <10000000>;
67+
goodix,hid-report-addr = <0x22c8c>;
68+
};
69+
};
70+
71+
...

Documentation/hid/intel-ish-hid.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,35 @@ For more detailed information, please refer to the flow descriptions provided be
404404
| ISHTP Driver | | ISH Bootloader |
405405
+---------------+ +-----------------+
406406

407+
Vendor Custom Firmware Loading
408+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
409+
410+
The firmware running inside ISH can be provided by Intel or developed by vendors using the Firmware Development Kit (FDK) provided by Intel.
411+
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``.
412+
Vendors who wish to upstream their custom firmware should follow these guidelines for naming their firmware files:
413+
414+
- The firmware filename should use one of the following patterns:
415+
416+
- ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}_${PRODUCT_SKU_CRC32}.bin``
417+
- ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_SKU_CRC32}.bin``
418+
- ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}.bin``
419+
- ``ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}.bin``
420+
421+
- ``${intel_plat_gen}`` indicates the Intel platform generation (e.g., ``lnlm`` for Lunar Lake) and must not exceed 8 characters in length.
422+
- ``${SYS_VENDOR_CRC32}`` is the CRC32 checksum of the ``sys_vendor`` value from the DMI field ``DMI_SYS_VENDOR``.
423+
- ``${PRODUCT_NAME_CRC32}`` is the CRC32 checksum of the ``product_name`` value from the DMI field ``DMI_PRODUCT_NAME``.
424+
- ``${PRODUCT_SKU_CRC32}`` is the CRC32 checksum of the ``product_sku`` value from the DMI field ``DMI_PRODUCT_SKU``.
425+
426+
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:
427+
428+
1. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}_${PRODUCT_SKU_CRC32}.bin``
429+
2. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_SKU_CRC32}.bin``
430+
3. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}_${PRODUCT_NAME_CRC32}.bin``
431+
4. ``intel/ish/ish_${intel_plat_gen}_${SYS_VENDOR_CRC32}.bin``
432+
5. ``intel/ish/ish_${intel_plat_gen}.bin``
433+
434+
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.
435+
407436
ISH Debugging
408437
-------------
409438

drivers/hid/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@ config HID_VIVALDI_COMMON
404404
option so that drivers can use common code to parse the HID
405405
descriptors for vivaldi function row keymap.
406406

407+
config HID_GOODIX_SPI
408+
tristate "Goodix GT7986U SPI HID touchscreen"
409+
depends on SPI_MASTER
410+
help
411+
Support for Goodix GT7986U SPI HID touchscreen device.
412+
407413
config HID_GOOGLE_HAMMER
408414
tristate "Google Hammer Keyboard"
409415
select HID_VIVALDI_COMMON

drivers/hid/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ obj-$(CONFIG_HID_GEMBIRD) += hid-gembird.o
5454
obj-$(CONFIG_HID_GFRM) += hid-gfrm.o
5555
obj-$(CONFIG_HID_GLORIOUS) += hid-glorious.o
5656
obj-$(CONFIG_HID_VIVALDI_COMMON) += hid-vivaldi-common.o
57+
obj-$(CONFIG_HID_GOODIX_SPI) += hid-goodix-spi.o
5758
obj-$(CONFIG_HID_GOOGLE_HAMMER) += hid-google-hammer.o
5859
obj-$(CONFIG_HID_GOOGLE_STADIA_FF) += hid-google-stadiaff.o
5960
obj-$(CONFIG_HID_VIVALDI) += hid-vivaldi.o

drivers/hid/amd-sfh-hid/amd_sfh_hid.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ struct amdtp_hid_data {
7373
};
7474

7575
/* Interface functions between HID LL driver and AMD SFH client */
76-
void hid_amdtp_set_feature(struct hid_device *hid, char *buf, u32 len, int report_id);
77-
void hid_amdtp_get_report(struct hid_device *hid, int report_id, int report_type);
7876
int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data);
7977
void amdtp_hid_remove(struct amdtp_cl_data *cli_data);
8078
int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type);

drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ static void amd_sfh_set_ops(struct amd_mp2_dev *mp2)
299299

300300
sfh_interface_init(mp2);
301301
mp2_ops = mp2->mp2_ops;
302-
mp2_ops->clear_intr = amd_sfh_clear_intr_v2,
303-
mp2_ops->init_intr = amd_sfh_irq_init_v2,
302+
mp2_ops->clear_intr = amd_sfh_clear_intr_v2;
303+
mp2_ops->init_intr = amd_sfh_irq_init_v2;
304304
mp2_ops->suspend = amd_sfh_suspend;
305305
mp2_ops->resume = amd_sfh_resume;
306306
mp2_ops->remove = amd_mp2_pci_remove;

drivers/hid/bpf/hid_bpf_dispatch.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int dispatch_hid_bpf_output_report(struct hid_device *hdev,
148148
}
149149
EXPORT_SYMBOL_GPL(dispatch_hid_bpf_output_report);
150150

151-
u8 *call_hid_bpf_rdesc_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *size)
151+
u8 *call_hid_bpf_rdesc_fixup(struct hid_device *hdev, const u8 *rdesc, unsigned int *size)
152152
{
153153
int ret;
154154
struct hid_bpf_ctx_kern ctx_kern = {
@@ -179,9 +179,7 @@ u8 *call_hid_bpf_rdesc_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *s
179179
*size = ret;
180180
}
181181

182-
rdesc = krealloc(ctx_kern.data, *size, GFP_KERNEL);
183-
184-
return rdesc;
182+
return krealloc(ctx_kern.data, *size, GFP_KERNEL);
185183

186184
ignore_bpf:
187185
kfree(ctx_kern.data);

drivers/hid/hid-apple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static void apple_battery_timer_tick(struct timer_list *t)
620620
* MacBook JIS keyboard has wrong logical maximum
621621
* Magic Keyboard JIS has wrong logical maximum
622622
*/
623-
static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc,
623+
static const __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc,
624624
unsigned int *rsize)
625625
{
626626
struct apple_sc *asc = hid_get_drvdata(hdev);

drivers/hid/hid-asus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ static const __u8 asus_g752_fixed_rdesc[] = {
11261126
0x2A, 0xFF, 0x00, /* Usage Maximum (0xFF) */
11271127
};
11281128

1129-
static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
1129+
static const __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
11301130
unsigned int *rsize)
11311131
{
11321132
struct asus_drvdata *drvdata = hid_get_drvdata(hdev);

0 commit comments

Comments
 (0)