Skip to content

Commit c11fb13

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - regression fixes (reverts) for module loading changes that turned out to be incompatible with some userspace, from Benjamin Tissoires - regression fix for special Logitech unifiying receiver 0xc52f, from Hans de Goede - a few device ID additions to logitech driver, from Hans de Goede - fix for Bluetooth support on 2nd-gen Wacom Intuos Pro, from Jason Gerecke * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: logitech-dj: Fix 064d:c52f receiver support Revert "HID: core: Call request_module before doing device_add" Revert "HID: core: Do not call request_module() in async context" Revert "HID: Increase maximum report size allowed by hid_field_extract()" HID: a4tech: fix horizontal scrolling HID: hyperv: Add a module description line HID: logitech-hidpp: Add support for the S510 remote control HID: multitouch: handle faulty Elo touch device HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact HID: wacom: Don't report anything prior to the tool entering range HID: wacom: Don't set tool type until we're in range HID: rmi: Use SET_REPORT request on control endpoint for Acer Switch 3 and 5 HID: logitech-hidpp: add support for the MX5500 keyboard HID: logitech-dj: add support for the Logitech MX5500's Bluetooth Mini-Receiver HID: i2c-hid: add iBall Aer3 to descriptor override
2 parents b076173 + 3ed224e commit c11fb13

File tree

10 files changed

+136
-54
lines changed

10 files changed

+136
-54
lines changed

drivers/hid/hid-a4tech.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,
3535
{
3636
struct a4tech_sc *a4 = hid_get_drvdata(hdev);
3737

38-
if (usage->type == EV_REL && usage->code == REL_WHEEL)
38+
if (usage->type == EV_REL && usage->code == REL_WHEEL_HI_RES) {
3939
set_bit(REL_HWHEEL, *bit);
40+
set_bit(REL_HWHEEL_HI_RES, *bit);
41+
}
4042

4143
if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007)
4244
return -1;
@@ -57,14 +59,16 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field,
5759
input = field->hidinput->input;
5860

5961
if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8) {
60-
if (usage->type == EV_REL && usage->code == REL_WHEEL) {
62+
if (usage->type == EV_REL && usage->code == REL_WHEEL_HI_RES) {
6163
a4->delayed_value = value;
6264
return 1;
6365
}
6466

6567
if (usage->hid == 0x000100b8) {
6668
input_event(input, EV_REL, value ? REL_HWHEEL :
6769
REL_WHEEL, a4->delayed_value);
70+
input_event(input, EV_REL, value ? REL_HWHEEL_HI_RES :
71+
REL_WHEEL_HI_RES, a4->delayed_value * 120);
6872
return 1;
6973
}
7074
}
@@ -74,8 +78,9 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field,
7478
return 1;
7579
}
7680

77-
if (usage->code == REL_WHEEL && a4->hw_wheel) {
81+
if (usage->code == REL_WHEEL_HI_RES && a4->hw_wheel) {
7882
input_event(input, usage->type, REL_HWHEEL, value);
83+
input_event(input, usage->type, REL_HWHEEL_HI_RES, value * 120);
7984
return 1;
8085
}
8186

drivers/hid/hid-core.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <linux/vmalloc.h>
2828
#include <linux/sched.h>
2929
#include <linux/semaphore.h>
30-
#include <linux/async.h>
3130

3231
#include <linux/hid.h>
3332
#include <linux/hiddev.h>
@@ -1311,10 +1310,10 @@ static u32 __extract(u8 *report, unsigned offset, int n)
13111310
u32 hid_field_extract(const struct hid_device *hid, u8 *report,
13121311
unsigned offset, unsigned n)
13131312
{
1314-
if (n > 256) {
1315-
hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n",
1313+
if (n > 32) {
1314+
hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n",
13161315
n, current->comm);
1317-
n = 256;
1316+
n = 32;
13181317
}
13191318

13201319
return __extract(report, offset, n);
@@ -2362,15 +2361,6 @@ int hid_add_device(struct hid_device *hdev)
23622361
dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
23632362
hdev->vendor, hdev->product, atomic_inc_return(&id));
23642363

2365-
/*
2366-
* Try loading the module for the device before the add, so that we do
2367-
* not first have hid-generic binding only to have it replaced
2368-
* immediately afterwards with a specialized driver.
2369-
*/
2370-
if (!current_is_async())
2371-
request_module("hid:b%04Xg%04Xv%08Xp%08X", hdev->bus,
2372-
hdev->group, hdev->vendor, hdev->product);
2373-
23742364
hid_debug_register(hdev, dev_name(&hdev->dev));
23752365
ret = device_add(&hdev->dev);
23762366
if (!ret)

drivers/hid/hid-hyperv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,5 +606,7 @@ static void __exit mousevsc_exit(void)
606606
}
607607

608608
MODULE_LICENSE("GPL");
609+
MODULE_DESCRIPTION("Microsoft Hyper-V Synthetic HID Driver");
610+
609611
module_init(mousevsc_init);
610612
module_exit(mousevsc_exit);

drivers/hid/hid-ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@
10861086
#define USB_DEVICE_ID_SYNAPTICS_HD 0x0ac3
10871087
#define USB_DEVICE_ID_SYNAPTICS_QUAD_HD 0x1ac3
10881088
#define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710
1089+
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7
10891090

10901091
#define USB_VENDOR_ID_TEXAS_INSTRUMENTS 0x2047
10911092
#define USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA 0x0855

drivers/hid/hid-logitech-dj.c

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ enum recvr_type {
113113
recvr_type_dj,
114114
recvr_type_hidpp,
115115
recvr_type_gaming_hidpp,
116+
recvr_type_mouse_only,
116117
recvr_type_27mhz,
117118
recvr_type_bluetooth,
118119
};
@@ -864,9 +865,12 @@ static void logi_dj_recv_queue_notification(struct dj_receiver_dev *djrcv_dev,
864865
schedule_work(&djrcv_dev->work);
865866
}
866867

867-
static void logi_hidpp_dev_conn_notif_equad(struct hidpp_event *hidpp_report,
868+
static void logi_hidpp_dev_conn_notif_equad(struct hid_device *hdev,
869+
struct hidpp_event *hidpp_report,
868870
struct dj_workitem *workitem)
869871
{
872+
struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
873+
870874
workitem->type = WORKITEM_TYPE_PAIRED;
871875
workitem->device_type = hidpp_report->params[HIDPP_PARAM_DEVICE_INFO] &
872876
HIDPP_DEVICE_TYPE_MASK;
@@ -880,6 +884,8 @@ static void logi_hidpp_dev_conn_notif_equad(struct hidpp_event *hidpp_report,
880884
break;
881885
case REPORT_TYPE_MOUSE:
882886
workitem->reports_supported |= STD_MOUSE | HIDPP;
887+
if (djrcv_dev->type == recvr_type_mouse_only)
888+
workitem->reports_supported |= MULTIMEDIA;
883889
break;
884890
}
885891
}
@@ -923,7 +929,7 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
923929
case 0x01:
924930
device_type = "Bluetooth";
925931
/* Bluetooth connect packet contents is the same as (e)QUAD */
926-
logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem);
932+
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
927933
if (!(hidpp_report->params[HIDPP_PARAM_DEVICE_INFO] &
928934
HIDPP_MANUFACTURER_MASK)) {
929935
hid_info(hdev, "Non Logitech device connected on slot %d\n",
@@ -937,18 +943,18 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
937943
break;
938944
case 0x03:
939945
device_type = "QUAD or eQUAD";
940-
logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem);
946+
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
941947
break;
942948
case 0x04:
943949
device_type = "eQUAD step 4 DJ";
944-
logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem);
950+
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
945951
break;
946952
case 0x05:
947953
device_type = "DFU Lite";
948954
break;
949955
case 0x06:
950956
device_type = "eQUAD step 4 Lite";
951-
logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem);
957+
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
952958
break;
953959
case 0x07:
954960
device_type = "eQUAD step 4 Gaming";
@@ -958,11 +964,11 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
958964
break;
959965
case 0x0a:
960966
device_type = "eQUAD nano Lite";
961-
logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem);
967+
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
962968
break;
963969
case 0x0c:
964970
device_type = "eQUAD Lightspeed";
965-
logi_hidpp_dev_conn_notif_equad(hidpp_report, &workitem);
971+
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
966972
workitem.reports_supported |= STD_KEYBOARD;
967973
break;
968974
}
@@ -1313,7 +1319,8 @@ static int logi_dj_ll_parse(struct hid_device *hid)
13131319
if (djdev->reports_supported & STD_MOUSE) {
13141320
dbg_hid("%s: sending a mouse descriptor, reports_supported: %llx\n",
13151321
__func__, djdev->reports_supported);
1316-
if (djdev->dj_receiver_dev->type == recvr_type_gaming_hidpp)
1322+
if (djdev->dj_receiver_dev->type == recvr_type_gaming_hidpp ||
1323+
djdev->dj_receiver_dev->type == recvr_type_mouse_only)
13171324
rdcat(rdesc, &rsize, mse_high_res_descriptor,
13181325
sizeof(mse_high_res_descriptor));
13191326
else if (djdev->dj_receiver_dev->type == recvr_type_27mhz)
@@ -1556,15 +1563,19 @@ static int logi_dj_raw_event(struct hid_device *hdev,
15561563
data[0] = data[1];
15571564
data[1] = 0;
15581565
}
1559-
/* The 27 MHz mouse-only receiver sends unnumbered mouse data */
1566+
/*
1567+
* Mouse-only receivers send unnumbered mouse data. The 27 MHz
1568+
* receiver uses 6 byte packets, the nano receiver 8 bytes.
1569+
*/
15601570
if (djrcv_dev->unnumbered_application == HID_GD_MOUSE &&
1561-
size == 6) {
1562-
u8 mouse_report[7];
1571+
size <= 8) {
1572+
u8 mouse_report[9];
15631573

15641574
/* Prepend report id */
15651575
mouse_report[0] = REPORT_TYPE_MOUSE;
1566-
memcpy(mouse_report + 1, data, 6);
1567-
logi_dj_recv_forward_input_report(hdev, mouse_report, 7);
1576+
memcpy(mouse_report + 1, data, size);
1577+
logi_dj_recv_forward_input_report(hdev, mouse_report,
1578+
size + 1);
15681579
}
15691580

15701581
return false;
@@ -1635,6 +1646,7 @@ static int logi_dj_probe(struct hid_device *hdev,
16351646
case recvr_type_dj: no_dj_interfaces = 3; break;
16361647
case recvr_type_hidpp: no_dj_interfaces = 2; break;
16371648
case recvr_type_gaming_hidpp: no_dj_interfaces = 3; break;
1649+
case recvr_type_mouse_only: no_dj_interfaces = 2; break;
16381650
case recvr_type_27mhz: no_dj_interfaces = 2; break;
16391651
case recvr_type_bluetooth: no_dj_interfaces = 2; break;
16401652
}
@@ -1808,10 +1820,10 @@ static const struct hid_device_id logi_dj_receivers[] = {
18081820
{HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18091821
USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2),
18101822
.driver_data = recvr_type_dj},
1811-
{ /* Logitech Nano (non DJ) receiver */
1823+
{ /* Logitech Nano mouse only receiver */
18121824
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18131825
USB_DEVICE_ID_LOGITECH_NANO_RECEIVER),
1814-
.driver_data = recvr_type_hidpp},
1826+
.driver_data = recvr_type_mouse_only},
18151827
{ /* Logitech Nano (non DJ) receiver */
18161828
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18171829
USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2),
@@ -1836,6 +1848,14 @@ static const struct hid_device_id logi_dj_receivers[] = {
18361848
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18371849
0xc70a),
18381850
.driver_data = recvr_type_bluetooth},
1851+
{ /* Logitech MX5500 HID++ / bluetooth receiver keyboard intf. */
1852+
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1853+
0xc71b),
1854+
.driver_data = recvr_type_bluetooth},
1855+
{ /* Logitech MX5500 HID++ / bluetooth receiver mouse intf. */
1856+
HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1857+
0xc71c),
1858+
.driver_data = recvr_type_bluetooth},
18391859
{}
18401860
};
18411861

drivers/hid/hid-logitech-hidpp.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,6 +3728,9 @@ static const struct hid_device_id hidpp_devices[] = {
37283728
{ /* Keyboard MX5000 (Bluetooth-receiver in HID proxy mode) */
37293729
LDJ_DEVICE(0xb305),
37303730
.driver_data = HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS },
3731+
{ /* Keyboard MX5500 (Bluetooth-receiver in HID proxy mode) */
3732+
LDJ_DEVICE(0xb30b),
3733+
.driver_data = HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS },
37313734

37323735
{ LDJ_DEVICE(HID_ANY_ID) },
37333736

@@ -3740,6 +3743,9 @@ static const struct hid_device_id hidpp_devices[] = {
37403743
{ /* Keyboard MX3200 (Y-RAV80) */
37413744
L27MHZ_DEVICE(0x005c),
37423745
.driver_data = HIDPP_QUIRK_KBD_ZOOM_WHEEL },
3746+
{ /* S510 Media Remote */
3747+
L27MHZ_DEVICE(0x00fe),
3748+
.driver_data = HIDPP_QUIRK_KBD_SCROLL_WHEEL },
37433749

37443750
{ L27MHZ_DEVICE(HID_ANY_ID) },
37453751

@@ -3756,6 +3762,9 @@ static const struct hid_device_id hidpp_devices[] = {
37563762
{ /* MX5000 keyboard over Bluetooth */
37573763
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb305),
37583764
.driver_data = HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS },
3765+
{ /* MX5500 keyboard over Bluetooth */
3766+
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb30b),
3767+
.driver_data = HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS },
37593768
{}
37603769
};
37613770

drivers/hid/hid-multitouch.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,13 @@ static void mt_store_field(struct hid_device *hdev,
637637
if (*target != DEFAULT_TRUE &&
638638
*target != DEFAULT_FALSE &&
639639
*target != DEFAULT_ZERO) {
640+
if (usage->contactid == DEFAULT_ZERO ||
641+
usage->x == DEFAULT_ZERO ||
642+
usage->y == DEFAULT_ZERO) {
643+
hid_dbg(hdev,
644+
"ignoring duplicate usage on incomplete");
645+
return;
646+
}
640647
usage = mt_allocate_usage(hdev, application);
641648
if (!usage)
642649
return;

drivers/hid/hid-rmi.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
/* device flags */
3636
#define RMI_DEVICE BIT(0)
3737
#define RMI_DEVICE_HAS_PHYS_BUTTONS BIT(1)
38+
#define RMI_DEVICE_OUTPUT_SET_REPORT BIT(2)
3839

3940
/*
4041
* retrieve the ctrl registers
@@ -163,9 +164,19 @@ static int rmi_set_mode(struct hid_device *hdev, u8 mode)
163164

164165
static int rmi_write_report(struct hid_device *hdev, u8 *report, int len)
165166
{
167+
struct rmi_data *data = hid_get_drvdata(hdev);
166168
int ret;
167169

168-
ret = hid_hw_output_report(hdev, (void *)report, len);
170+
if (data->device_flags & RMI_DEVICE_OUTPUT_SET_REPORT) {
171+
/*
172+
* Talk to device by using SET_REPORT requests instead.
173+
*/
174+
ret = hid_hw_raw_request(hdev, report[0], report,
175+
len, HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
176+
} else {
177+
ret = hid_hw_output_report(hdev, (void *)report, len);
178+
}
179+
169180
if (ret < 0) {
170181
dev_err(&hdev->dev, "failed to write hid report (%d)\n", ret);
171182
return ret;
@@ -747,6 +758,8 @@ static const struct hid_device_id rmi_id[] = {
747758
.driver_data = RMI_DEVICE_HAS_PHYS_BUTTONS },
748759
{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER) },
749760
{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_REZEL) },
761+
{ HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5),
762+
.driver_data = RMI_DEVICE_OUTPUT_SET_REPORT },
750763
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_RMI, HID_ANY_ID, HID_ANY_ID) },
751764
{ }
752765
};

drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = {
354354
},
355355
.driver_data = (void *)&sipodev_desc
356356
},
357+
{
358+
.ident = "iBall Aer3",
359+
.matches = {
360+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "iBall"),
361+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Aer3"),
362+
},
363+
.driver_data = (void *)&sipodev_desc
364+
},
357365
{ } /* Terminate list */
358366
};
359367

0 commit comments

Comments
 (0)