aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-multitouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r--drivers/hid/hid-multitouch.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 0d3113969c43..59742f49295c 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -68,6 +68,9 @@ MODULE_LICENSE("GPL");
68#define MT_QUIRK_HOVERING (1 << 11) 68#define MT_QUIRK_HOVERING (1 << 11)
69#define MT_QUIRK_CONTACT_CNT_ACCURATE (1 << 12) 69#define MT_QUIRK_CONTACT_CNT_ACCURATE (1 << 12)
70 70
71#define MT_INPUTMODE_TOUCHSCREEN 0x02
72#define MT_INPUTMODE_TOUCHPAD 0x03
73
71struct mt_slot { 74struct mt_slot {
72 __s32 x, y, cx, cy, p, w, h; 75 __s32 x, y, cx, cy, p, w, h;
73 __s32 contactid; /* the device ContactID assigned to this slot */ 76 __s32 contactid; /* the device ContactID assigned to this slot */
@@ -105,6 +108,7 @@ struct mt_device {
105 __s16 inputmode_index; /* InputMode HID feature index in the report */ 108 __s16 inputmode_index; /* InputMode HID feature index in the report */
106 __s16 maxcontact_report_id; /* Maximum Contact Number HID feature, 109 __s16 maxcontact_report_id; /* Maximum Contact Number HID feature,
107 -1 if non-existent */ 110 -1 if non-existent */
111 __u8 inputmode_value; /* InputMode HID feature value */
108 __u8 num_received; /* how many contacts we received */ 112 __u8 num_received; /* how many contacts we received */
109 __u8 num_expected; /* expected last contact index */ 113 __u8 num_expected; /* expected last contact index */
110 __u8 maxcontacts; 114 __u8 maxcontacts;
@@ -363,8 +367,10 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
363 * Model touchscreens providing buttons as touchpads. 367 * Model touchscreens providing buttons as touchpads.
364 */ 368 */
365 if (field->application == HID_DG_TOUCHPAD || 369 if (field->application == HID_DG_TOUCHPAD ||
366 (usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) 370 (usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
367 td->mt_flags |= INPUT_MT_POINTER; 371 td->mt_flags |= INPUT_MT_POINTER;
372 td->inputmode_value = MT_INPUTMODE_TOUCHPAD;
373 }
368 374
369 if (usage->usage_index) 375 if (usage->usage_index)
370 prev_usage = &field->usage[usage->usage_index - 1]; 376 prev_usage = &field->usage[usage->usage_index - 1];
@@ -810,7 +816,7 @@ static void mt_set_input_mode(struct hid_device *hdev)
810 re = &(hdev->report_enum[HID_FEATURE_REPORT]); 816 re = &(hdev->report_enum[HID_FEATURE_REPORT]);
811 r = re->report_id_hash[td->inputmode]; 817 r = re->report_id_hash[td->inputmode];
812 if (r) { 818 if (r) {
813 r->field[0]->value[td->inputmode_index] = 0x02; 819 r->field[0]->value[td->inputmode_index] = td->inputmode_value;
814 hid_hw_request(hdev, r, HID_REQ_SET_REPORT); 820 hid_hw_request(hdev, r, HID_REQ_SET_REPORT);
815 } 821 }
816} 822}
@@ -978,6 +984,7 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
978 td->mtclass = *mtclass; 984 td->mtclass = *mtclass;
979 td->inputmode = -1; 985 td->inputmode = -1;
980 td->maxcontact_report_id = -1; 986 td->maxcontact_report_id = -1;
987 td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN;
981 td->cc_index = -1; 988 td->cc_index = -1;
982 td->mt_report_id = -1; 989 td->mt_report_id = -1;
983 hid_set_drvdata(hdev, td); 990 hid_set_drvdata(hdev, td);