Skip to content

Commit

Permalink
BACKPORT-LS53: ipts: hid-multitouch: revert all the changes
Browse files Browse the repository at this point in the history
This commit will revert all the changes to hid-multitouch.c made by
0005-ipts.patch on 4.19. This change will fix rotation issue on Wayland.
As a drawback, this change will disable single-touch device and `Mouse`
device of IPTS.

Link: jakeday/linux-surface#549
[Setup.sh doesn't work for pen/touch on Surface Pro 2017 LTE (info for fix) · Issue #549 · jakeday/linux-surface]

(BACKPORT-LS53: corresponds to 464d29d)
  • Loading branch information
kitakar5525 committed Jan 16, 2020
1 parent 01223fa commit 1e75bc2
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ struct mt_device {
static void mt_post_parse_default_settings(struct mt_device *td,
struct mt_application *app);
static void mt_post_parse(struct mt_device *td, struct mt_application *app);
static int cc_seen = 0;

/* classes of device behavior */
#define MT_CLS_DEFAULT 0x0001
Expand Down Expand Up @@ -800,11 +799,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
app->scantime_logical_max = field->logical_maximum;
return 1;
case HID_DG_CONTACTCOUNT:
if(cc_seen != 1) {
app->have_contact_count = true;
app->raw_cc = &field->value[usage->usage_index];
cc_seen++;
}
app->have_contact_count = true;
app->raw_cc = &field->value[usage->usage_index];
return 1;
case HID_DG_AZIMUTH:
/*
Expand Down Expand Up @@ -1294,11 +1290,9 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
field->application != HID_DG_TOUCHSCREEN &&
field->application != HID_DG_PEN &&
field->application != HID_DG_TOUCHPAD &&
field->application != HID_GD_MOUSE &&
field->application != HID_GD_KEYBOARD &&
field->application != HID_GD_SYSTEM_CONTROL &&
field->application != HID_CP_CONSUMER_CONTROL &&
field->logical != HID_DG_TOUCHSCREEN &&
field->application != HID_GD_WIRELESS_RADIO_CTLS &&
field->application != HID_GD_SYSTEM_MULTIAXIS &&
!(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
Expand Down Expand Up @@ -1343,14 +1337,6 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct mt_device *td = hid_get_drvdata(hdev);
struct mt_report_data *rdata;

if (field->application == HID_DG_TOUCHSCREEN ||
field->application == HID_DG_TOUCHPAD) {
if (usage->type == EV_KEY || usage->type == EV_ABS)
set_bit(usage->type, hi->input->evbit);

return -1;
}

rdata = mt_find_report_data(td, field->report);
if (rdata && rdata->is_mt_collection) {
/* We own these mappings, tell hid-input to ignore them */
Expand Down Expand Up @@ -1576,13 +1562,12 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
/* already handled by hid core */
break;
case HID_DG_TOUCHSCREEN:
suffix = "Touchscreen";
/* we do not set suffix = "Touchscreen" */
hi->input->name = hdev->name;
break;
case HID_DG_STYLUS:
/* force BTN_STYLUS to allow tablet matching in udev */
__set_bit(BTN_STYLUS, hi->input->keybit);
__set_bit(INPUT_PROP_DIRECT, hi->input->propbit);
break;
case HID_VD_ASUS_CUSTOM_MEDIA_KEYS:
suffix = "Custom Media Keys";
Expand Down Expand Up @@ -1699,7 +1684,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
td->hdev = hdev;
td->mtclass = *mtclass;
td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN;
cc_seen = 0;
hid_set_drvdata(hdev, td);

INIT_LIST_HEAD(&td->applications);
Expand Down

0 comments on commit 1e75bc2

Please sign in to comment.