summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-multitouch.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-03-27 14:02:27 +0100
committerJiri Kosina <jkosina@suse.cz>2013-03-27 14:02:27 +0100
commitb3fecf8cab6441527ab057c99d7e6a6d7f6713e5 (patch)
treed327499840a25fbd1f81e49d5cb6769bdad382f5 /drivers/hid/hid-multitouch.c
parent5b62efd8250d6a751c31d1972e96bfccd19c4679 (diff)
parent83a44ac8bf4a8e6cbbf0c00ff281a482778f708a (diff)
Merge branch 'for-3.10/hid-driver-transport-cleanups' into for-3.10/mt-hybrid-finger-pen
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r--drivers/hid/hid-multitouch.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 3f6849ddd29c..1f544a48507d 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -2,8 +2,9 @@
* HID driver for multitouch panels
*
* Copyright (c) 2010-2012 Stephane Chatty <chatty@enac.fr>
- * Copyright (c) 2010-2012 Benjamin Tissoires <benjamin.tissoires@gmail.com>
+ * Copyright (c) 2010-2013 Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Copyright (c) 2010-2012 Ecole Nationale de l'Aviation Civile, France
+ * Copyright (c) 2012-2013 Red Hat, Inc
*
* This code is partly based on hid-egalax.c:
*
@@ -26,13 +27,23 @@
* any later version.
*/
+/*
+ * This driver is regularly tested thanks to the tool hid-test[1].
+ * This tool relies on hid-replay[2] and a database of hid devices[3].
+ * Please run these regression tests before patching this module so that
+ * your patch won't break existing known devices.
+ *
+ * [1] https://github.com/bentiss/hid-test
+ * [2] https://github.com/bentiss/hid-replay
+ * [3] https://github.com/bentiss/hid-devices
+ */
+
#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/input/mt.h>
-#include "usbhid/usbhid.h"
MODULE_AUTHOR("Stephane Chatty <chatty@enac.fr>");
@@ -723,7 +734,7 @@ static void mt_set_input_mode(struct hid_device *hdev)
r = re->report_id_hash[td->inputmode];
if (r) {
r->field[0]->value[td->inputmode_index] = 0x02;
- usbhid_submit_report(hdev, r, USB_DIR_OUT);
+ hid_hw_request(hdev, r, HID_REQ_SET_REPORT);
}
}
@@ -748,7 +759,7 @@ static void mt_set_maxcontacts(struct hid_device *hdev)
max = min(fieldmax, max);
if (r->field[0]->value[0] != max) {
r->field[0]->value[0] = max;
- usbhid_submit_report(hdev, r, USB_DIR_OUT);
+ hid_hw_request(hdev, r, HID_REQ_SET_REPORT);
}
}
}
@@ -885,26 +896,11 @@ static int mt_reset_resume(struct hid_device *hdev)
static int mt_resume(struct hid_device *hdev)
{
- struct usb_interface *intf;
- struct usb_host_interface *interface;
- struct usb_device *dev;
-
- if (hdev->bus != BUS_USB)
- return 0;
-
- intf = to_usb_interface(hdev->dev.parent);
- interface = intf->cur_altsetting;
- dev = hid_to_usb_dev(hdev);
-
/* Some Elan legacy devices require SET_IDLE to be set on resume.
* It should be safe to send it to other devices too.
* Tested on 3M, Stantum, Cypress, Zytronic, eGalax, and Elan panels. */
- usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
- HID_REQ_SET_IDLE,
- USB_TYPE_CLASS | USB_RECIP_INTERFACE,
- 0, interface->desc.bInterfaceNumber,
- NULL, 0, USB_CTRL_SET_TIMEOUT);
+ hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE);
return 0;
}