Skip to content

Commit 27c0278

Browse files
committed
Merge tag 'hid-for-linus-2025012001' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID updates from Jiri Kosina: - newly added support for Intel Touch Host Controller (Even Xu, Xinpeng Sun) - hid-core fix for long-standing syzbot-reported cornercase of Resolution Multiplier not being present in any of the Logical Collections in the device HID report descriptor (Alan Stern) - improvement of behavior for non-standard LED brightness values for Wacom driver (Jason Gerecke) - PCI Wacom device support (depends on Intel THC support) (Even Xu) - SteelSeries Arctis 9 support (Christian Mayer) - constification of 'struct bin_attribute' in various HID driver (Thomas Weißschuh) - other assorted code cleanups / fixes and device ID additions * tag 'hid-for-linus-2025012001' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (63 commits) HID: hid-asus: Disable OOBE mode on the ProArt P16 HID: steelseries: remove unnecessary return HID: steelseries: export model and manufacturer HID: steelseries: export charging state for the SteelSeries Arctis 9 headset HID: steelseries: add SteelSeries Arctis 9 support HID: steelseries: preparation for adding SteelSeries Arctis 9 support HID: intel-thc-hid: fix build errors in um mode HID: intel-thc-hid: intel-quicki2c: fix potential memory corruption HID: intel-thc-hid: intel-thc: Fix error code in thc_i2c_subip_init() HID: lenovo: Fix undefined platform_profile_cycle in ThinkPad X12 keyboard patch HID: uclogic: make const read-only array touch_ring_model_params_buf static HID: hid-steam: Make sure rumble work is canceled on removal HID: Wacom: Add PCI Wacom device support HID: intel-thc-hid: intel-quicki2c: Add PM implementation HID: intel-thc-hid: intel-quicki2c: Complete THC QuickI2C driver HID: intel-thc-hid: intel-quicki2c: Add HIDI2C protocol implementation HID: intel-thc-hid: intel-quicki2c: Add THC QuickI2C ACPI interfaces HID: intel-thc-hid: intel-quicki2c: Add THC QuickI2C driver hid layer HID: intel-thc-hid: intel-quicki2c: Add THC QuickI2C driver skeleton HID: intel-thc-hid: intel-quickspi: Add PM implementation ...
2 parents d78794d + 973d690 commit 27c0278

Some content is hidden

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

62 files changed

+8444
-277
lines changed

Documentation/hid/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ Human Interface Devices (HID)
1818

1919
hid-alps
2020
intel-ish-hid
21+
intel-thc-hid
2122
amd-sfh-hid

Documentation/hid/intel-thc-hid.rst

Lines changed: 568 additions & 0 deletions
Large diffs are not rendered by default.

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11918,6 +11918,12 @@ S: Maintained
1191811918
F: arch/x86/include/asm/intel_telemetry.h
1191911919
F: drivers/platform/x86/intel/telemetry/
1192011920

11921+
INTEL TOUCH HOST CONTROLLER (THC) DRIVER
11922+
M: Even Xu <even.xu@intel.com>
11923+
M: Xinpeng Sun <xinpeng.sun@intel.com>
11924+
S: Maintained
11925+
F: drivers/hid/intel-thc-hid/
11926+
1192111927
INTEL TPMI DRIVER
1192211928
M: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
1192311929
L: platform-driver-x86@vger.kernel.org

drivers/hid/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ config HID_NINTENDO
787787
Adds support for the Nintendo Switch Joy-Cons, NSO, Pro Controller.
788788
All controllers support bluetooth, and the Pro Controller also supports
789789
its USB mode. This also includes support for the Nintendo Switch Online
790-
Controllers which include the Genesis, SNES, and N64 controllers.
790+
Controllers which include the NES, Genesis, SNES, and N64 controllers.
791791

792792
To compile this driver as a module, choose M here: the
793793
module will be called hid-nintendo.
@@ -1386,4 +1386,6 @@ source "drivers/hid/amd-sfh-hid/Kconfig"
13861386

13871387
source "drivers/hid/surface-hid/Kconfig"
13881388

1389+
source "drivers/hid/intel-thc-hid/Kconfig"
1390+
13891391
endif # HID_SUPPORT

drivers/hid/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,5 @@ obj-$(INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ish-hid/
171171
obj-$(CONFIG_AMD_SFH_HID) += amd-sfh-hid/
172172

173173
obj-$(CONFIG_SURFACE_HID_CORE) += surface-hid/
174+
175+
obj-$(CONFIG_INTEL_THC_HID) += intel-thc-hid/

drivers/hid/hid-asus.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,26 @@ static int asus_kbd_get_functions(struct hid_device *hdev,
432432
return ret;
433433
}
434434

435+
static int asus_kbd_disable_oobe(struct hid_device *hdev)
436+
{
437+
const u8 init[][6] = {
438+
{ FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 },
439+
{ FEATURE_KBD_REPORT_ID, 0xBA, 0xC5, 0xC4 },
440+
{ FEATURE_KBD_REPORT_ID, 0xD0, 0x8F, 0x01 },
441+
{ FEATURE_KBD_REPORT_ID, 0xD0, 0x85, 0xFF }
442+
};
443+
int ret;
444+
445+
for (size_t i = 0; i < ARRAY_SIZE(init); i++) {
446+
ret = asus_kbd_set_report(hdev, init[i], sizeof(init[i]));
447+
if (ret < 0)
448+
return ret;
449+
}
450+
451+
hid_info(hdev, "Disabled OOBE for keyboard\n");
452+
return 0;
453+
}
454+
435455
static void asus_schedule_work(struct asus_kbd_leds *led)
436456
{
437457
unsigned long flags;
@@ -534,6 +554,12 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
534554
ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID2);
535555
if (ret < 0)
536556
return ret;
557+
558+
if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
559+
ret = asus_kbd_disable_oobe(hdev);
560+
if (ret < 0)
561+
return ret;
562+
}
537563
} else {
538564
/* Initialize keyboard */
539565
ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);

drivers/hid/hid-core.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,8 @@ static void hid_apply_multiplier(struct hid_device *hid,
11631163
while (multiplier_collection->parent_idx != -1 &&
11641164
multiplier_collection->type != HID_COLLECTION_LOGICAL)
11651165
multiplier_collection = &hid->collection[multiplier_collection->parent_idx];
1166+
if (multiplier_collection->type != HID_COLLECTION_LOGICAL)
1167+
multiplier_collection = NULL;
11661168

11671169
effective_multiplier = hid_calculate_multiplier(hid, multiplier);
11681170

@@ -2174,9 +2176,9 @@ static bool hid_hiddev(struct hid_device *hdev)
21742176

21752177

21762178
static ssize_t
2177-
read_report_descriptor(struct file *filp, struct kobject *kobj,
2178-
struct bin_attribute *attr,
2179-
char *buf, loff_t off, size_t count)
2179+
report_descriptor_read(struct file *filp, struct kobject *kobj,
2180+
const struct bin_attribute *attr,
2181+
char *buf, loff_t off, size_t count)
21802182
{
21812183
struct device *dev = kobj_to_dev(kobj);
21822184
struct hid_device *hdev = to_hid_device(dev);
@@ -2193,24 +2195,17 @@ read_report_descriptor(struct file *filp, struct kobject *kobj,
21932195
}
21942196

21952197
static ssize_t
2196-
show_country(struct device *dev, struct device_attribute *attr,
2197-
char *buf)
2198+
country_show(struct device *dev, struct device_attribute *attr,
2199+
char *buf)
21982200
{
21992201
struct hid_device *hdev = to_hid_device(dev);
22002202

22012203
return sprintf(buf, "%02x\n", hdev->country & 0xff);
22022204
}
22032205

2204-
static struct bin_attribute dev_bin_attr_report_desc = {
2205-
.attr = { .name = "report_descriptor", .mode = 0444 },
2206-
.read = read_report_descriptor,
2207-
.size = HID_MAX_DESCRIPTOR_SIZE,
2208-
};
2206+
static const BIN_ATTR_RO(report_descriptor, HID_MAX_DESCRIPTOR_SIZE);
22092207

2210-
static const struct device_attribute dev_attr_country = {
2211-
.attr = { .name = "country", .mode = 0444 },
2212-
.show = show_country,
2213-
};
2208+
static const DEVICE_ATTR_RO(country);
22142209

22152210
int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
22162211
{
@@ -2800,13 +2795,13 @@ static struct attribute *hid_dev_attrs[] = {
28002795
&dev_attr_modalias.attr,
28012796
NULL,
28022797
};
2803-
static struct bin_attribute *hid_dev_bin_attrs[] = {
2804-
&dev_bin_attr_report_desc,
2798+
static const struct bin_attribute *hid_dev_bin_attrs[] = {
2799+
&bin_attr_report_descriptor,
28052800
NULL
28062801
};
28072802
static const struct attribute_group hid_dev_group = {
28082803
.attrs = hid_dev_attrs,
2809-
.bin_attrs = hid_dev_bin_attrs,
2804+
.bin_attrs_new = hid_dev_bin_attrs,
28102805
};
28112806
__ATTRIBUTE_GROUPS(hid_dev);
28122807

drivers/hid/hid-ids.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@
506506
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_E100 0xe100
507507

508508
#define I2C_VENDOR_ID_GOODIX 0x27c6
509-
#define I2C_DEVICE_ID_GOODIX_01E0 0x01e0
510509
#define I2C_DEVICE_ID_GOODIX_01E8 0x01e8
511510
#define I2C_DEVICE_ID_GOODIX_01E9 0x01e9
512511
#define I2C_DEVICE_ID_GOODIX_01F0 0x01f0
@@ -1089,6 +1088,8 @@
10891088
#define USB_VENDOR_ID_PRODIGE 0x05af
10901089
#define USB_DEVICE_ID_PRODIGE_CORDLESS 0x3062
10911090

1091+
#define I2C_VENDOR_ID_QTEC 0x6243
1092+
10921093
#define USB_VENDOR_ID_QUANTA 0x0408
10931094
#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH 0x3000
10941095
#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001

drivers/hid/hid-input.c

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -810,10 +810,23 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
810810
break;
811811
}
812812

813-
if ((usage->hid & 0xf0) == 0x90) { /* SystemControl*/
814-
switch (usage->hid & 0xf) {
815-
case 0xb: map_key_clear(KEY_DO_NOT_DISTURB); break;
816-
default: goto ignore;
813+
if ((usage->hid & 0xf0) == 0x90) { /* SystemControl & D-pad */
814+
switch (usage->hid) {
815+
case HID_GD_UP: usage->hat_dir = 1; break;
816+
case HID_GD_DOWN: usage->hat_dir = 5; break;
817+
case HID_GD_RIGHT: usage->hat_dir = 3; break;
818+
case HID_GD_LEFT: usage->hat_dir = 7; break;
819+
case HID_GD_DO_NOT_DISTURB:
820+
map_key_clear(KEY_DO_NOT_DISTURB); break;
821+
default: goto unknown;
822+
}
823+
824+
if (usage->hid <= HID_GD_LEFT) {
825+
if (field->dpad) {
826+
map_abs(field->dpad);
827+
goto ignore;
828+
}
829+
map_abs(ABS_HAT0X);
817830
}
818831
break;
819832
}
@@ -844,22 +857,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
844857
if (field->application == HID_GD_SYSTEM_CONTROL)
845858
goto ignore;
846859

847-
if ((usage->hid & 0xf0) == 0x90) { /* D-pad */
848-
switch (usage->hid) {
849-
case HID_GD_UP: usage->hat_dir = 1; break;
850-
case HID_GD_DOWN: usage->hat_dir = 5; break;
851-
case HID_GD_RIGHT: usage->hat_dir = 3; break;
852-
case HID_GD_LEFT: usage->hat_dir = 7; break;
853-
default: goto unknown;
854-
}
855-
if (field->dpad) {
856-
map_abs(field->dpad);
857-
goto ignore;
858-
}
859-
map_abs(ABS_HAT0X);
860-
break;
861-
}
862-
863860
switch (usage->hid) {
864861
/* These usage IDs map directly to the usage codes. */
865862
case HID_GD_X: case HID_GD_Y: case HID_GD_Z:

0 commit comments

Comments
 (0)