summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-multitouch.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@enac.fr>2011-01-07 23:47:27 +0100
committerJiri Kosina <jkosina@suse.cz>2011-01-11 21:26:55 +0100
commit5572da08a784621f2ab4fdc8dc65471261871795 (patch)
tree667ad15cf97f22e9ebeb97884ae114156883bf2a /drivers/hid/hid-multitouch.c
parenta3b5e577d96bfccbc41ebf4df784e3a153072273 (diff)
HID: hid-mulitouch: add support for the 'Sensing Win7-TwoFinger'
Added support for the 'Sensing Win7-TwoFinger' panel by GeneralTouch found on some tablets. Because of conflicting VID/PID, this conflicts with previous support for some single-touch panels by GeneralTouch Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Signed-off-by: Stéphane Chatty <chatty@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r--drivers/hid/hid-multitouch.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 7af9f7136bd..3442ed56e96 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -33,6 +33,7 @@ MODULE_LICENSE("GPL");
#define MT_QUIRK_NOT_SEEN_MEANS_UP (1 << 0)
#define MT_QUIRK_SLOT_IS_CONTACTID (1 << 1)
#define MT_QUIRK_CYPRESS (1 << 2)
+#define MT_QUIRK_SLOT_IS_CONTACTNUMBER (1 << 3)
struct mt_slot {
__s32 x, y, p, w, h;
@@ -63,7 +64,8 @@ struct mt_class {
/* classes of device behavior */
#define MT_CLS_DEFAULT 0
#define MT_CLS_DUAL1 1
-#define MT_CLS_CYPRESS 2
+#define MT_CLS_DUAL2 2
+#define MT_CLS_CYPRESS 3
/*
* these device-dependent functions determine what slot corresponds
@@ -75,6 +77,11 @@ static int slot_is_contactid(struct mt_device *td)
return td->curdata.contactid;
}
+static int slot_is_contactnumber(struct mt_device *td)
+{
+ return td->num_received;
+}
+
static int cypress_compute_slot(struct mt_device *td)
{
if (td->curdata.contactid != 0 || td->num_received == 0)
@@ -105,6 +112,7 @@ static int find_slot_from_contactid(struct mt_device *td)
struct mt_class mt_classes[] = {
{ 0, 0, 0, 10 }, /* MT_CLS_DEFAULT */
{ MT_QUIRK_SLOT_IS_CONTACTID, 0, 0, 2 }, /* MT_CLS_DUAL1 */
+ { MT_QUIRK_SLOT_IS_CONTACTNUMBER, 0, 0, 10 }, /* MT_CLS_DUAL2 */
{ MT_QUIRK_CYPRESS | MT_QUIRK_NOT_SEEN_MEANS_UP, 0, 0, 10 }, /* MT_CLS_CYPRESS */
};
@@ -237,6 +245,9 @@ static int mt_compute_slot(struct mt_device *td)
if (cls->quirks & MT_QUIRK_CYPRESS)
return cypress_compute_slot(td);
+ if (cls->quirks & MT_QUIRK_SLOT_IS_CONTACTNUMBER)
+ return slot_is_contactnumber(td);
+
return find_slot_from_contactid(td);
}
@@ -441,6 +452,11 @@ static const struct hid_device_id mt_devices[] = {
HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS,
USB_DEVICE_ID_CYPRESS_TRUETOUCH) },
+ /* GeneralTouch panel */
+ { .driver_data = MT_CLS_DUAL2,
+ HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
+ USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) },
+
/* PixCir-based panels */
{ .driver_data = MT_CLS_DUAL1,
HID_USB_DEVICE(USB_VENDOR_ID_HANVON,