diff options
author | Benjamin Tissoires <benjamin.tissoires@enac.fr> | 2011-01-07 17:46:30 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-01-11 15:26:54 -0500 |
commit | a3b5e577d96bfccbc41ebf4df784e3a153072273 (patch) | |
tree | bcf9fa39e19b6ddb120225dcd7e8df19a9384655 /drivers/hid | |
parent | 5519cab477b61326963c8d523520db0342862b63 (diff) |
HID: hid-multitouch: add support for Cypress TrueTouch panels
Added support for Cypress TrueTouch panels, which detect up to 10 fingers
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')
-rw-r--r-- | drivers/hid/Kconfig | 1 | ||||
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
-rw-r--r-- | drivers/hid/hid-multitouch.c | 19 |
4 files changed, 22 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 511554de526e..de31d75e276f 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -293,6 +293,7 @@ config HID_MULTITOUCH | |||
293 | 293 | ||
294 | Say Y here if you have one of the following devices: | 294 | Say Y here if you have one of the following devices: |
295 | - PixCir touchscreen | 295 | - PixCir touchscreen |
296 | - Cypress TrueTouch | ||
296 | 297 | ||
297 | config HID_NTRIG | 298 | config HID_NTRIG |
298 | tristate "N-Trig touch screen" | 299 | tristate "N-Trig touch screen" |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 9292eb148ce4..12d4afafc73b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1298,6 +1298,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1298 | { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) }, | 1298 | { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) }, |
1299 | { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) }, | 1299 | { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) }, |
1300 | { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) }, | 1300 | { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) }, |
1301 | { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_TRUETOUCH) }, | ||
1301 | { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) }, | 1302 | { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) }, |
1302 | { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) }, | 1303 | { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) }, |
1303 | { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) }, | 1304 | { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index bd3cd551b4ee..f5657a8c757d 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -180,6 +180,7 @@ | |||
180 | #define USB_DEVICE_ID_CYPRESS_BARCODE_1 0xde61 | 180 | #define USB_DEVICE_ID_CYPRESS_BARCODE_1 0xde61 |
181 | #define USB_DEVICE_ID_CYPRESS_BARCODE_2 0xde64 | 181 | #define USB_DEVICE_ID_CYPRESS_BARCODE_2 0xde64 |
182 | #define USB_DEVICE_ID_CYPRESS_BARCODE_3 0xbca1 | 182 | #define USB_DEVICE_ID_CYPRESS_BARCODE_3 0xbca1 |
183 | #define USB_DEVICE_ID_CYPRESS_TRUETOUCH 0xc001 | ||
183 | 184 | ||
184 | #define USB_VENDOR_ID_DEALEXTREAME 0x10c5 | 185 | #define USB_VENDOR_ID_DEALEXTREAME 0x10c5 |
185 | #define USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701 0x819a | 186 | #define USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701 0x819a |
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 3b05dfe910bc..7af9f7136bd5 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
@@ -32,6 +32,7 @@ MODULE_LICENSE("GPL"); | |||
32 | /* quirks to control the device */ | 32 | /* quirks to control the device */ |
33 | #define MT_QUIRK_NOT_SEEN_MEANS_UP (1 << 0) | 33 | #define MT_QUIRK_NOT_SEEN_MEANS_UP (1 << 0) |
34 | #define MT_QUIRK_SLOT_IS_CONTACTID (1 << 1) | 34 | #define MT_QUIRK_SLOT_IS_CONTACTID (1 << 1) |
35 | #define MT_QUIRK_CYPRESS (1 << 2) | ||
35 | 36 | ||
36 | struct mt_slot { | 37 | struct mt_slot { |
37 | __s32 x, y, p, w, h; | 38 | __s32 x, y, p, w, h; |
@@ -62,6 +63,7 @@ struct mt_class { | |||
62 | /* classes of device behavior */ | 63 | /* classes of device behavior */ |
63 | #define MT_CLS_DEFAULT 0 | 64 | #define MT_CLS_DEFAULT 0 |
64 | #define MT_CLS_DUAL1 1 | 65 | #define MT_CLS_DUAL1 1 |
66 | #define MT_CLS_CYPRESS 2 | ||
65 | 67 | ||
66 | /* | 68 | /* |
67 | * these device-dependent functions determine what slot corresponds | 69 | * these device-dependent functions determine what slot corresponds |
@@ -73,6 +75,14 @@ static int slot_is_contactid(struct mt_device *td) | |||
73 | return td->curdata.contactid; | 75 | return td->curdata.contactid; |
74 | } | 76 | } |
75 | 77 | ||
78 | static int cypress_compute_slot(struct mt_device *td) | ||
79 | { | ||
80 | if (td->curdata.contactid != 0 || td->num_received == 0) | ||
81 | return td->curdata.contactid; | ||
82 | else | ||
83 | return -1; | ||
84 | } | ||
85 | |||
76 | static int find_slot_from_contactid(struct mt_device *td) | 86 | static int find_slot_from_contactid(struct mt_device *td) |
77 | { | 87 | { |
78 | int i; | 88 | int i; |
@@ -95,6 +105,7 @@ static int find_slot_from_contactid(struct mt_device *td) | |||
95 | struct mt_class mt_classes[] = { | 105 | struct mt_class mt_classes[] = { |
96 | { 0, 0, 0, 10 }, /* MT_CLS_DEFAULT */ | 106 | { 0, 0, 0, 10 }, /* MT_CLS_DEFAULT */ |
97 | { MT_QUIRK_SLOT_IS_CONTACTID, 0, 0, 2 }, /* MT_CLS_DUAL1 */ | 107 | { MT_QUIRK_SLOT_IS_CONTACTID, 0, 0, 2 }, /* MT_CLS_DUAL1 */ |
108 | { MT_QUIRK_CYPRESS | MT_QUIRK_NOT_SEEN_MEANS_UP, 0, 0, 10 }, /* MT_CLS_CYPRESS */ | ||
98 | }; | 109 | }; |
99 | 110 | ||
100 | static void mt_feature_mapping(struct hid_device *hdev, struct hid_input *hi, | 111 | static void mt_feature_mapping(struct hid_device *hdev, struct hid_input *hi, |
@@ -223,6 +234,9 @@ static int mt_compute_slot(struct mt_device *td) | |||
223 | if (cls->quirks & MT_QUIRK_SLOT_IS_CONTACTID) | 234 | if (cls->quirks & MT_QUIRK_SLOT_IS_CONTACTID) |
224 | return slot_is_contactid(td); | 235 | return slot_is_contactid(td); |
225 | 236 | ||
237 | if (cls->quirks & MT_QUIRK_CYPRESS) | ||
238 | return cypress_compute_slot(td); | ||
239 | |||
226 | return find_slot_from_contactid(td); | 240 | return find_slot_from_contactid(td); |
227 | } | 241 | } |
228 | 242 | ||
@@ -422,6 +436,11 @@ static void mt_remove(struct hid_device *hdev) | |||
422 | 436 | ||
423 | static const struct hid_device_id mt_devices[] = { | 437 | static const struct hid_device_id mt_devices[] = { |
424 | 438 | ||
439 | /* Cypress panel */ | ||
440 | { .driver_data = MT_CLS_CYPRESS, | ||
441 | HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, | ||
442 | USB_DEVICE_ID_CYPRESS_TRUETOUCH) }, | ||
443 | |||
425 | /* PixCir-based panels */ | 444 | /* PixCir-based panels */ |
426 | { .driver_data = MT_CLS_DUAL1, | 445 | { .driver_data = MT_CLS_DUAL1, |
427 | HID_USB_DEVICE(USB_VENDOR_ID_HANVON, | 446 | HID_USB_DEVICE(USB_VENDOR_ID_HANVON, |