Skip to content

Commit b57807c

Browse files
committed
Merge tag 'hid-for-linus-2024111801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID updates from Jiri Kosina: - improvement in the way hid-bpf coexists with specific drivers (others than hid-generic) that are already bound to devices (Benjamin Tissoires) - removal of three way-too-aggressive BUG_ON()s from HID drivers (He Lugang) - assorted cleanups and small code fixes to HID core (Dmitry Torokhov, Yan Zhen, Nathan Chancellor, Andy Shevchenko) - support for Corsair Void headset family (Stuart Hayhurst) - Support for Goodix GT7986U SPI (Charles Wang) - initial vendor-specific driver for Kysona, currently adding support for Kysona M600 (Lode Willems) - other assorted code cleanups and small bugfixes all over the place * tag 'hid-for-linus-2024111801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (40 commits) HID: multitouch: make mt_set_mode() less cryptic HID: hid-goodix-spi: Add OF supports dt-bindings: input: Goodix GT7986U SPI HID Touchscreen HID: hyperv: streamline driver probe to avoid devres issues HID: magicmouse: Apple Magic Trackpad 2 USB-C driver support HID: rmi: Add select RMI4_F3A in Kconfig HID: wacom: Interpret tilt data from Intuos Pro BT as signed values HID: steelseries: Add capacity_level mapping HID: steelseries: Fix battery requests stopping after some time HID: hid-goodix: Fix HID get/set feature operation overwritten problem HID: hid-goodix: Return 0 when receiving an empty HID feature package HID: bpf: drop use of Logical|Physical|UsageRange HID: bpf: Fix Rapoo M50 Plus Silent side buttons HID: bpf: Fix NKRO on Mistel MD770 HID: replace BUG_ON() with WARN_ON() HID: wacom: Set eraser status when either 'Eraser' or 'Invert' usage is set HID: Kysona: add basic online status HID: Kysona: check battery status every 5s using a workqueue HID: Kysona: Add basic battery reporting for Kysona M600 HID: Add IDs for Kysona ...
2 parents e6de688 + 9037968 commit b57807c

Some content is hidden

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

50 files changed

+2288
-412
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
What: /sys/bus/hid/drivers/hid-corsair-void/<dev>/fw_version_headset
2+
Date: January 2024
3+
KernelVersion: 6.13
4+
Contact: Stuart Hayhurst <[email protected]>
5+
Description: (R) The firmware version of the headset
6+
* Returns -ENODATA if no version was reported
7+
8+
What: /sys/bus/hid/drivers/hid-corsair-void/<dev>/fw_version_receiver
9+
Date: January 2024
10+
KernelVersion: 6.13
11+
Contact: Stuart Hayhurst <[email protected]>
12+
Description: (R) The firmware version of the receiver
13+
14+
What: /sys/bus/hid/drivers/hid-corsair-void/<dev>/microphone_up
15+
Date: July 2023
16+
KernelVersion: 6.13
17+
Contact: Stuart Hayhurst <[email protected]>
18+
Description: (R) Get the physical position of the microphone
19+
* 1 -> Microphone up
20+
* 0 -> Microphone down
21+
22+
What: /sys/bus/hid/drivers/hid-corsair-void/<dev>/send_alert
23+
Date: July 2023
24+
KernelVersion: 6.13
25+
Contact: Stuart Hayhurst <[email protected]>
26+
Description: (W) Play a built-in notification from the headset (0 / 1)
27+
28+
What: /sys/bus/hid/drivers/hid-corsair-void/<dev>/set_sidetone
29+
Date: December 2023
30+
KernelVersion: 6.13
31+
Contact: Stuart Hayhurst <[email protected]>
32+
Description: (W) Set the sidetone volume (0 - sidetone_max)
33+
34+
What: /sys/bus/hid/drivers/hid-corsair-void/<dev>/sidetone_max
35+
Date: July 2024
36+
KernelVersion: 6.13
37+
Contact: Stuart Hayhurst <[email protected]>
38+
Description: (R) Report the maximum sidetone volume
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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-spifw.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: |
13+
Supports the Goodix GT7986U touchscreen.
14+
This touch controller reports data packaged according to the HID protocol
15+
over the SPI bus, but it is incompatible with Microsoft's HID-over-SPI protocol.
16+
17+
NOTE: these bindings are distinct from the bindings used with the
18+
GT7986U when the chip is running I2C firmware. This is because there's
19+
not a single device that talks over both I2C and SPI but rather
20+
distinct touchscreens that happen to be built with the same ASIC but
21+
that are distinct products running distinct firmware.
22+
23+
allOf:
24+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
25+
26+
properties:
27+
compatible:
28+
enum:
29+
- goodix,gt7986u-spifw
30+
31+
reg:
32+
maxItems: 1
33+
34+
interrupts:
35+
maxItems: 1
36+
37+
reset-gpios:
38+
maxItems: 1
39+
40+
spi-max-frequency: true
41+
42+
required:
43+
- compatible
44+
- reg
45+
- interrupts
46+
- reset-gpios
47+
48+
unevaluatedProperties: false
49+
50+
examples:
51+
- |
52+
#include <dt-bindings/interrupt-controller/irq.h>
53+
#include <dt-bindings/gpio/gpio.h>
54+
55+
spi {
56+
#address-cells = <1>;
57+
#size-cells = <0>;
58+
59+
touchscreen@0 {
60+
compatible = "goodix,gt7986u-spifw";
61+
reg = <0>;
62+
interrupt-parent = <&gpio>;
63+
interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
64+
reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
65+
spi-max-frequency = <10000000>;
66+
};
67+
};
68+
69+
...

drivers/hid/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,16 @@ config HID_CHICONY
213213
config HID_CORSAIR
214214
tristate "Corsair devices"
215215
depends on USB_HID && LEDS_CLASS
216+
select POWER_SUPPLY
216217
help
217218
Support for Corsair devices that are not fully compliant with the
218219
HID standard.
220+
Support for Corsair Void headsets.
219221

220222
Supported devices:
221223
- Vengeance K90
222224
- Scimitar PRO RGB
225+
- Corsair Void headsets
223226

224227
config HID_COUGAR
225228
tristate "Cougar devices"
@@ -465,6 +468,15 @@ config HID_KYE
465468
- MousePen i608X tablet
466469
- EasyPen M610X tablet
467470

471+
config HID_KYSONA
472+
tristate "Kysona devices"
473+
depends on USB_HID
474+
help
475+
Support for Kysona mice.
476+
477+
Say Y here if you have a Kysona M600 mouse
478+
and want to be able to read its battery capacity.
479+
468480
config HID_UCLOGIC
469481
tristate "UC-Logic"
470482
depends on USB_HID
@@ -1096,6 +1108,7 @@ config HID_RMI
10961108
select RMI4_F11
10971109
select RMI4_F12
10981110
select RMI4_F30
1111+
select RMI4_F3A
10991112
help
11001113
Support for Synaptics RMI4 touchpads.
11011114
Say Y here if you have a Synaptics RMI4 touchpads over i2c-hid or usbhid

drivers/hid/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ obj-$(CONFIG_HID_BIGBEN_FF) += hid-bigbenff.o
3838
obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
3939
obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
4040
obj-$(CONFIG_HID_CMEDIA) += hid-cmedia.o
41-
obj-$(CONFIG_HID_CORSAIR) += hid-corsair.o
41+
obj-$(CONFIG_HID_CORSAIR) += hid-corsair.o hid-corsair-void.o
4242
obj-$(CONFIG_HID_COUGAR) += hid-cougar.o
4343
obj-$(CONFIG_HID_CP2112) += hid-cp2112.o
4444
obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
@@ -70,6 +70,7 @@ obj-$(CONFIG_HID_JABRA) += hid-jabra.o
7070
obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o
7171
obj-$(CONFIG_HID_KEYTOUCH) += hid-keytouch.o
7272
obj-$(CONFIG_HID_KYE) += hid-kye.o
73+
obj-$(CONFIG_HID_KYSONA) += hid-kysona.o
7374
obj-$(CONFIG_HID_LCPOWER) += hid-lcpower.o
7475
obj-$(CONFIG_HID_LENOVO) += hid-lenovo.o
7576
obj-$(CONFIG_HID_LETSKETCH) += hid-letsketch.o

drivers/hid/bpf/hid_bpf_dispatch.c

Lines changed: 6 additions & 3 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, const u8 *rdesc, unsigned int *size)
151+
const 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 = {
@@ -183,7 +183,7 @@ u8 *call_hid_bpf_rdesc_fixup(struct hid_device *hdev, const u8 *rdesc, unsigned
183183

184184
ignore_bpf:
185185
kfree(ctx_kern.data);
186-
return kmemdup(rdesc, *size, GFP_KERNEL);
186+
return rdesc;
187187
}
188188
EXPORT_SYMBOL_GPL(call_hid_bpf_rdesc_fixup);
189189

@@ -260,8 +260,11 @@ int hid_bpf_allocate_event_data(struct hid_device *hdev)
260260

261261
int hid_bpf_reconnect(struct hid_device *hdev)
262262
{
263-
if (!test_and_set_bit(ffs(HID_STAT_REPROBED), &hdev->status))
263+
if (!test_and_set_bit(ffs(HID_STAT_REPROBED), &hdev->status)) {
264+
/* trigger call to call_hid_bpf_rdesc_fixup() during the next probe */
265+
hdev->bpf_rsize = 0;
264266
return device_reprobe(&hdev->dev);
267+
}
265268

266269
return 0;
267270
}

drivers/hid/bpf/hid_bpf_struct_ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static int hid_bpf_ops_btf_struct_access(struct bpf_verifier_log *log,
7979
WRITE_RANGE(hid_device, name, true),
8080
WRITE_RANGE(hid_device, uniq, true),
8181
WRITE_RANGE(hid_device, phys, true),
82+
WRITE_RANGE(hid_device, quirks, false),
8283
};
8384
#undef WRITE_RANGE
8485
const struct btf_type *state = NULL;

drivers/hid/bpf/progs/Huion__Dial-2.bpf.c

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ static const __u8 fixed_rdesc_pad[] = {
214214
CollectionApplication(
215215
// -- Byte 0 in report
216216
ReportId(PAD_REPORT_ID)
217-
LogicalRange_i8(0, 1)
217+
LogicalMaximum_i8(0)
218+
LogicalMaximum_i8(1)
218219
UsagePage_Digitizers
219220
Usage_Dig_TabletFunctionKeys
220221
CollectionPhysical(
@@ -234,14 +235,17 @@ static const __u8 fixed_rdesc_pad[] = {
234235
Input(Var|Abs)
235236
// Byte 4 in report is the dial
236237
Usage_GD_Wheel
237-
LogicalRange_i8(-1, 1)
238+
LogicalMinimum_i8(-1)
239+
LogicalMaximum_i8(1)
238240
ReportCount(1)
239241
ReportSize(8)
240242
Input(Var|Rel)
241243
// Byte 5 is the button state
242244
UsagePage_Button
243-
UsageRange_i8(0x01, 0x8)
244-
LogicalRange_i8(0x0, 0x1)
245+
UsageMinimum_i8(0x01)
246+
UsageMaximum_i8(0x08)
247+
LogicalMinimum_i8(0x0)
248+
LogicalMaximum_i8(0x1)
245249
ReportCount(7)
246250
ReportSize(1)
247251
Input(Var|Abs)
@@ -265,7 +269,8 @@ static const __u8 fixed_rdesc_pen[] = {
265269
Usage_Dig_TipSwitch
266270
Usage_Dig_BarrelSwitch
267271
Usage_Dig_SecondaryBarrelSwitch // maps eraser to BTN_STYLUS2
268-
LogicalRange_i8(0, 1)
272+
LogicalMinimum_i8(0)
273+
LogicalMaximum_i8(1)
269274
ReportSize(1)
270275
ReportCount(3)
271276
Input(Var|Abs)
@@ -280,22 +285,28 @@ static const __u8 fixed_rdesc_pen[] = {
280285
UsagePage_GenericDesktop
281286
Unit(cm)
282287
UnitExponent(-1)
283-
PhysicalRange_i16(0, 266)
284-
LogicalRange_i16(0, 32767)
288+
PhysicalMinimum_i16(0)
289+
PhysicalMaximum_i16(266)
290+
LogicalMinimum_i16(0)
291+
LogicalMaximum_i16(32767)
285292
Usage_GD_X
286293
Input(Var|Abs) // Bytes 2+3
287-
PhysicalRange_i16(0, 166)
288-
LogicalRange_i16(0, 32767)
294+
PhysicalMinimum_i16(0)
295+
PhysicalMaximum_i16(166)
296+
LogicalMinimum_i16(0)
297+
LogicalMaximum_i16(32767)
289298
Usage_GD_Y
290299
Input(Var|Abs) // Bytes 4+5
291300
)
292301
UsagePage_Digitizers
293302
Usage_Dig_TipPressure
294-
LogicalRange_i16(0, 8191)
303+
LogicalMinimum_i16(0)
304+
LogicalMaximum_i16(8191)
295305
Input(Var|Abs) // Byte 6+7
296306
ReportSize(8)
297307
ReportCount(2)
298-
LogicalRange_i8(-60, 60)
308+
LogicalMinimum_i8(-60)
309+
LogicalMaximum_i8(60)
299310
Usage_Dig_XTilt
300311
Usage_Dig_YTilt
301312
Input(Var|Abs) // Byte 8+9
@@ -313,7 +324,8 @@ static const __u8 fixed_rdesc_vendor[] = {
313324
Usage_Dig_Pen
314325
CollectionPhysical(
315326
// Byte 1 are the buttons
316-
LogicalRange_i8(0, 1)
327+
LogicalMinimum_i8(0)
328+
LogicalMaximum_i8(1)
317329
ReportSize(1)
318330
Usage_Dig_TipSwitch
319331
Usage_Dig_BarrelSwitch
@@ -333,25 +345,31 @@ static const __u8 fixed_rdesc_vendor[] = {
333345
UnitExponent(-1)
334346
// Note: reported logical range differs
335347
// from the pen report ID for x and y
336-
LogicalRange_i16(0, 53340)
337-
PhysicalRange_i16(0, 266)
348+
LogicalMinimum_i16(0)
349+
LogicalMaximum_i16(53340)
350+
PhysicalMinimum_i16(0)
351+
PhysicalMaximum_i16(266)
338352
// Bytes 2/3 in report
339353
Usage_GD_X
340354
Input(Var|Abs)
341-
LogicalRange_i16(0, 33340)
342-
PhysicalRange_i16(0, 166)
355+
LogicalMinimum_i16(0)
356+
LogicalMaximum_i16(33340)
357+
PhysicalMinimum_i16(0)
358+
PhysicalMaximum_i16(166)
343359
// Bytes 4/5 in report
344360
Usage_GD_Y
345361
Input(Var|Abs)
346362
)
347363
// Bytes 6/7 in report
348-
LogicalRange_i16(0, 8191)
364+
LogicalMinimum_i16(0)
365+
LogicalMaximum_i16(8191)
349366
Usage_Dig_TipPressure
350367
Input(Var|Abs)
351368
// Bytes 8/9 in report
352369
ReportCount(1) // Padding
353370
Input(Const)
354-
LogicalRange_i8(-60, 60)
371+
LogicalMinimum_i8(-60)
372+
LogicalMaximum_i8(60)
355373
// Byte 10 in report
356374
Usage_Dig_XTilt
357375
// Byte 11 in report
@@ -366,7 +384,8 @@ static const __u8 fixed_rdesc_vendor[] = {
366384
CollectionApplication(
367385
// Byte 0
368386
ReportId(PAD_REPORT_ID)
369-
LogicalRange_i8(0, 1)
387+
LogicalMinimum_i8(0)
388+
LogicalMaximum_i8(1)
370389
UsagePage_Digitizers
371390
Usage_Dig_TabletFunctionKeys
372391
CollectionPhysical(
@@ -386,15 +405,18 @@ static const __u8 fixed_rdesc_vendor[] = {
386405
Input(Var|Abs)
387406
// Byte 4 is the button state
388407
UsagePage_Button
389-
UsageRange_i8(0x01, 0x8)
390-
LogicalRange_i8(0x0, 0x1)
408+
UsageMinimum_i8(0x1)
409+
UsageMaximum_i8(0x8)
410+
LogicalMinimum_i8(0x0)
411+
LogicalMaximum_i8(0x1)
391412
ReportCount(8)
392413
ReportSize(1)
393414
Input(Var|Abs)
394415
// Byte 5 is the top dial
395416
UsagePage_GenericDesktop
396417
Usage_GD_Wheel
397-
LogicalRange_i8(-1, 1)
418+
LogicalMinimum_i8(-1)
419+
LogicalMaximum_i8(1)
398420
ReportCount(1)
399421
ReportSize(8)
400422
Input(Var|Rel)

0 commit comments

Comments
 (0)