diff options
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r-- | drivers/hid/hid-multitouch.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 40fbb7c52723..da954f3f4da7 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
@@ -1375,7 +1375,8 @@ static bool mt_need_to_apply_feature(struct hid_device *hdev, | |||
1375 | struct hid_usage *usage, | 1375 | struct hid_usage *usage, |
1376 | enum latency_mode latency, | 1376 | enum latency_mode latency, |
1377 | bool surface_switch, | 1377 | bool surface_switch, |
1378 | bool button_switch) | 1378 | bool button_switch, |
1379 | bool *inputmode_found) | ||
1379 | { | 1380 | { |
1380 | struct mt_device *td = hid_get_drvdata(hdev); | 1381 | struct mt_device *td = hid_get_drvdata(hdev); |
1381 | struct mt_class *cls = &td->mtclass; | 1382 | struct mt_class *cls = &td->mtclass; |
@@ -1387,6 +1388,14 @@ static bool mt_need_to_apply_feature(struct hid_device *hdev, | |||
1387 | 1388 | ||
1388 | switch (usage->hid) { | 1389 | switch (usage->hid) { |
1389 | case HID_DG_INPUTMODE: | 1390 | case HID_DG_INPUTMODE: |
1391 | /* | ||
1392 | * Some elan panels wrongly declare 2 input mode features, | ||
1393 | * and silently ignore when we set the value in the second | ||
1394 | * field. Skip the second feature and hope for the best. | ||
1395 | */ | ||
1396 | if (*inputmode_found) | ||
1397 | return false; | ||
1398 | |||
1390 | if (cls->quirks & MT_QUIRK_FORCE_GET_FEATURE) { | 1399 | if (cls->quirks & MT_QUIRK_FORCE_GET_FEATURE) { |
1391 | report_len = hid_report_len(report); | 1400 | report_len = hid_report_len(report); |
1392 | buf = hid_alloc_report_buf(report, GFP_KERNEL); | 1401 | buf = hid_alloc_report_buf(report, GFP_KERNEL); |
@@ -1402,6 +1411,7 @@ static bool mt_need_to_apply_feature(struct hid_device *hdev, | |||
1402 | } | 1411 | } |
1403 | 1412 | ||
1404 | field->value[index] = td->inputmode_value; | 1413 | field->value[index] = td->inputmode_value; |
1414 | *inputmode_found = true; | ||
1405 | return true; | 1415 | return true; |
1406 | 1416 | ||
1407 | case HID_DG_CONTACTMAX: | 1417 | case HID_DG_CONTACTMAX: |
@@ -1439,6 +1449,7 @@ static void mt_set_modes(struct hid_device *hdev, enum latency_mode latency, | |||
1439 | struct hid_usage *usage; | 1449 | struct hid_usage *usage; |
1440 | int i, j; | 1450 | int i, j; |
1441 | bool update_report; | 1451 | bool update_report; |
1452 | bool inputmode_found = false; | ||
1442 | 1453 | ||
1443 | rep_enum = &hdev->report_enum[HID_FEATURE_REPORT]; | 1454 | rep_enum = &hdev->report_enum[HID_FEATURE_REPORT]; |
1444 | list_for_each_entry(rep, &rep_enum->report_list, list) { | 1455 | list_for_each_entry(rep, &rep_enum->report_list, list) { |
@@ -1457,7 +1468,8 @@ static void mt_set_modes(struct hid_device *hdev, enum latency_mode latency, | |||
1457 | usage, | 1468 | usage, |
1458 | latency, | 1469 | latency, |
1459 | surface_switch, | 1470 | surface_switch, |
1460 | button_switch)) | 1471 | button_switch, |
1472 | &inputmode_found)) | ||
1461 | update_report = true; | 1473 | update_report = true; |
1462 | } | 1474 | } |
1463 | } | 1475 | } |
@@ -1685,6 +1697,9 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1685 | */ | 1697 | */ |
1686 | hdev->quirks |= HID_QUIRK_INPUT_PER_APP; | 1698 | hdev->quirks |= HID_QUIRK_INPUT_PER_APP; |
1687 | 1699 | ||
1700 | if (id->group != HID_GROUP_MULTITOUCH_WIN_8) | ||
1701 | hdev->quirks |= HID_QUIRK_MULTI_INPUT; | ||
1702 | |||
1688 | timer_setup(&td->release_timer, mt_expired_timeout, 0); | 1703 | timer_setup(&td->release_timer, mt_expired_timeout, 0); |
1689 | 1704 | ||
1690 | ret = hid_parse(hdev); | 1705 | ret = hid_parse(hdev); |