Skip to content

Commit

Permalink
HID: rmi: do not handle touchscreens through hid-rmi
Browse files Browse the repository at this point in the history
Currently, hid-rmi drives every Synaptics product, but the touchscreens
on the Windows tablets should be handled through hid-multitouch.

Instead of providing a long list of PIDs, rely on the scan_report
capability to detect which should go to hid-multitouch, and which
should not go to hid-rmi.

related bug:
https://bugzilla.kernel.org/show_bug.cgi?id=74241
https://bugzilla.redhat.com/show_bug.cgi?id=1089583

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed May 22, 2014
1 parent 876e7a8 commit ba391e5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,14 @@ static int hid_scan_report(struct hid_device *hid)
(hid->group == HID_GROUP_MULTITOUCH))
hid->group = HID_GROUP_MULTITOUCH_WIN_8;

/*
* Vendor specific handlings
*/
if ((hid->vendor == USB_VENDOR_ID_SYNAPTICS) &&
(hid->group == HID_GROUP_GENERIC))
/* hid-rmi should take care of them, not hid-generic */
hid->group = HID_GROUP_RMI;

vfree(parser);
return 0;
}
Expand Down Expand Up @@ -1882,8 +1890,6 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) },
{ HID_I2C_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
Expand Down
3 changes: 1 addition & 2 deletions drivers/hid/hid-rmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,7 @@ static void rmi_remove(struct hid_device *hdev)
}

static const struct hid_device_id rmi_id[] = {
{ HID_I2C_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) },
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_RMI, HID_ANY_ID, HID_ANY_ID) },
{ }
};
MODULE_DEVICE_TABLE(hid, rmi_id);
Expand Down
8 changes: 8 additions & 0 deletions include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,20 @@ struct hid_item {

/*
* HID device groups
*
* Note: HID_GROUP_ANY is declared in linux/mod_devicetable.h
* and has a value of 0x0000
*/
#define HID_GROUP_GENERIC 0x0001
#define HID_GROUP_MULTITOUCH 0x0002
#define HID_GROUP_SENSOR_HUB 0x0003
#define HID_GROUP_MULTITOUCH_WIN_8 0x0004

/*
* Vendor specific HID device groups
*/
#define HID_GROUP_RMI 0x0100

/*
* This is the global environment of the parser. This information is
* persistent for main-items. The global environment can be saved and
Expand Down

0 comments on commit ba391e5

Please sign in to comment.