Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248515
b: refs/heads/master
c: 2955cae
h: refs/heads/master
i:
  248513: 0c0f788
  248511: 8d94411
v: v3
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Apr 22, 2011
1 parent a983a3a commit a3af2a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f786bba4499cf3de20da345ce090457ebcef03b0
refs/heads/master: 2955caed8b9865c1f04fcde6bd7103d5d5ec9415
23 changes: 11 additions & 12 deletions trunk/drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
/* touchscreen emulation */
set_abs(hi->input, ABS_X, field, cls->sn_move);
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_GD_Y:
if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP)
Expand All @@ -221,6 +222,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
/* touchscreen emulation */
set_abs(hi->input, ABS_Y, field, cls->sn_move);
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
}
return 0;
Expand All @@ -229,25 +231,30 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
switch (usage->hid) {
case HID_DG_INRANGE:
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_DG_CONFIDENCE:
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_DG_TIPSWITCH:
hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
input_set_capability(hi->input, EV_KEY, BTN_TOUCH);
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_DG_CONTACTID:
input_mt_init_slots(hi->input, td->maxcontacts);
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_DG_WIDTH:
hid_map_usage(hi, usage, bit, max,
EV_ABS, ABS_MT_TOUCH_MAJOR);
set_abs(hi->input, ABS_MT_TOUCH_MAJOR, field,
cls->sn_width);
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_DG_HEIGHT:
hid_map_usage(hi, usage, bit, max,
Expand All @@ -257,6 +264,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
input_set_abs_params(hi->input,
ABS_MT_ORIENTATION, 0, 1, 0, 0);
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_DG_TIPPRESSURE:
if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP)
Expand All @@ -269,13 +277,15 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
set_abs(hi->input, ABS_PRESSURE, field,
cls->sn_pressure);
td->last_slot_field = usage->hid;
td->last_field_index = field->index;
return 1;
case HID_DG_CONTACTCOUNT:
td->last_field_index = field->report->maxfield - 1;
td->last_field_index = field->index;
return 1;
case HID_DG_CONTACTMAX:
/* we don't set td->last_slot_field as contactcount and
* contact max are global to the report */
td->last_field_index = field->index;
return -1;
}
/* let hid-input decide for the others */
Expand Down Expand Up @@ -424,23 +434,12 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
break;

default:
if (td->last_field_index
&& field->index == td->last_field_index)
/* we reach here when the last field in the
* report is not related to multitouch.
* This is not good. As a temporary solution,
* we trigger our mt event completion and
* ignore the field.
*/
break;
/* fallback to the generic hidinput handling */
return 0;
}

if (usage->hid == td->last_slot_field) {
mt_complete_slot(td);
if (!td->last_field_index)
mt_emit_event(td, field->hidinput->input);
}

if (field->index == td->last_field_index
Expand Down

0 comments on commit a3af2a3

Please sign in to comment.