Skip to content

Commit 7a324b3

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina: - touch_max detection improvements and quirk handling fixes in wacom driver from Jason Gerecke and Ping Cheng - Palm rejection from Dmitry Torokhov and _dial support from Benjamin Tissoires for hid-multitouch driver - Low voltage support for i2c-hid driver from Stephen Boyd - Guitar-Hero support from Nicolas Adenis-Lamarre - other assorted small fixes and device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (40 commits) HID: intel_ish-hid: tx_buf memory leak on probe/remove HID: intel-ish-hid: Prevent loading of driver on Mehlow HID: cougar: Add support for the Cougar 500k Gaming Keyboard HID: cougar: make compare_device_paths reusable HID: intel-ish-hid: remove redundant variable num_frags HID: multitouch: handle palm for touchscreens HID: multitouch: touchscreens also use confidence reports HID: multitouch: report MT_TOOL_PALM for non-confident touches HID: microsoft: support the Surface Dial HID: core: do not upper bound the collection stack HID: input: enable Totem on the Dell Canvas 27 HID: multitouch: remove one copy of values HID: multitouch: ditch mt_report_id HID: multitouch: store a per application quirks value HID: multitouch: Store per collection multitouch data HID: multitouch: make sure the static list of class is not changed input: add MT_TOOL_DIAL HID: elan: Add support for touchpad on the Toshiba Click Mini L9W HID: elan: Add USB-id for HP x2 10-n000nd touchpad HID: elan: Add a flag for selecting if the touchpad has a LED ...
2 parents 61c4fc1 + 1429b47 commit 7a324b3

27 files changed

Lines changed: 1824 additions & 748 deletions

‎Documentation/devicetree/bindings/input/hid-over-i2c.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ device-specific compatible properties, which should be used in addition to the
2525

2626
- compatible:
2727
* "wacom,w9013" (Wacom W9013 digitizer). Supports:
28-
- vdd-supply
28+
- vdd-supply (3.3V)
29+
- vddl-supply (1.8V)
2930
- post-power-on-delay-ms
3031

3132
- vdd-supply: phandle of the regulator that provides the supply voltage.

‎Documentation/input/multi-touch-protocol.rst‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,12 @@ ABS_MT_TOOL_Y
310310
ABS_MT_TOOL_TYPE
311311
The type of approaching tool. A lot of kernel drivers cannot distinguish
312312
between different tool types, such as a finger or a pen. In such cases, the
313-
event should be omitted. The protocol currently supports MT_TOOL_FINGER,
314-
MT_TOOL_PEN, and MT_TOOL_PALM [#f2]_. For type B devices, this event is
315-
handled by input core; drivers should instead use
316-
input_mt_report_slot_state(). A contact's ABS_MT_TOOL_TYPE may change over
317-
time while still touching the device, because the firmware may not be able
318-
to determine which tool is being used when it first appears.
313+
event should be omitted. The protocol currently mainly supports
314+
MT_TOOL_FINGER, MT_TOOL_PEN, and MT_TOOL_PALM [#f2]_.
315+
For type B devices, this event is handled by input core; drivers should
316+
instead use input_mt_report_slot_state(). A contact's ABS_MT_TOOL_TYPE may
317+
change over time while still touching the device, because the firmware may
318+
not be able to determine which tool is being used when it first appears.
319319

320320
ABS_MT_BLOB_ID
321321
The BLOB_ID groups several packets together into one arbitrarily shaped

‎drivers/hid/Kconfig‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ config HID_CORSAIR
207207
- Vengeance K90
208208
- Scimitar PRO RGB
209209

210+
config HID_COUGAR
211+
tristate "Cougar devices"
212+
depends on HID
213+
help
214+
Support for Cougar devices that are not fully compliant with the
215+
HID standard.
216+
217+
Supported devices:
218+
- Cougar 500k Gaming Keyboard
219+
210220
config HID_PRODIKEYS
211221
tristate "Prodikeys PC-MIDI Keyboard support"
212222
depends on HID && SND

‎drivers/hid/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
3535
obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
3636
obj-$(CONFIG_HID_CMEDIA) += hid-cmedia.o
3737
obj-$(CONFIG_HID_CORSAIR) += hid-corsair.o
38+
obj-$(CONFIG_HID_COUGAR) += hid-cougar.o
3839
obj-$(CONFIG_HID_CP2112) += hid-cp2112.o
3940
obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
4041
obj-$(CONFIG_HID_DRAGONRISE) += hid-dr.o

‎drivers/hid/hid-core.c‎

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,19 @@ static int open_collection(struct hid_parser *parser, unsigned type)
128128

129129
usage = parser->local.usage[0];
130130

131-
if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) {
132-
hid_err(parser->device, "collection stack overflow\n");
133-
return -EINVAL;
131+
if (parser->collection_stack_ptr == parser->collection_stack_size) {
132+
unsigned int *collection_stack;
133+
unsigned int new_size = parser->collection_stack_size +
134+
HID_COLLECTION_STACK_SIZE;
135+
136+
collection_stack = krealloc(parser->collection_stack,
137+
new_size * sizeof(unsigned int),
138+
GFP_KERNEL);
139+
if (!collection_stack)
140+
return -ENOMEM;
141+
142+
parser->collection_stack = collection_stack;
143+
parser->collection_stack_size = new_size;
134144
}
135145

136146
if (parser->device->maxcollection == parser->device->collection_size) {
@@ -840,6 +850,7 @@ static int hid_scan_report(struct hid_device *hid)
840850
break;
841851
}
842852

853+
kfree(parser->collection_stack);
843854
vfree(parser);
844855
return 0;
845856
}
@@ -1939,6 +1950,29 @@ static int hid_bus_match(struct device *dev, struct device_driver *drv)
19391950
return hid_match_device(hdev, hdrv) != NULL;
19401951
}
19411952

1953+
/**
1954+
* hid_compare_device_paths - check if both devices share the same path
1955+
* @hdev_a: hid device
1956+
* @hdev_b: hid device
1957+
* @separator: char to use as separator
1958+
*
1959+
* Check if two devices share the same path up to the last occurrence of
1960+
* the separator char. Both paths must exist (i.e., zero-length paths
1961+
* don't match).
1962+
*/
1963+
bool hid_compare_device_paths(struct hid_device *hdev_a,
1964+
struct hid_device *hdev_b, char separator)
1965+
{
1966+
int n1 = strrchr(hdev_a->phys, separator) - hdev_a->phys;
1967+
int n2 = strrchr(hdev_b->phys, separator) - hdev_b->phys;
1968+
1969+
if (n1 != n2 || n1 <= 0 || n2 <= 0)
1970+
return false;
1971+
1972+
return !strncmp(hdev_a->phys, hdev_b->phys, n1);
1973+
}
1974+
EXPORT_SYMBOL_GPL(hid_compare_device_paths);
1975+
19421976
static int hid_device_probe(struct device *dev)
19431977
{
19441978
struct hid_driver *hdrv = to_hid_driver(dev->driver);

0 commit comments

Comments
 (0)