Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID fix from Jiri Kosina:
"Regression fix for multitouch palm rejection from Allen Hung"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: multitouch: enable palm rejection for Windows Precision Touchpad
Revert "HID: multitouch: enable palm rejection if device implements confidence usage"

+14 -7
+14 -7
drivers/hid/hid-multitouch.c
··· 61 61 #define MT_QUIRK_ALWAYS_VALID (1 << 4) 62 62 #define MT_QUIRK_VALID_IS_INRANGE (1 << 5) 63 63 #define MT_QUIRK_VALID_IS_CONFIDENCE (1 << 6) 64 + #define MT_QUIRK_CONFIDENCE (1 << 7) 64 65 #define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 8) 65 66 #define MT_QUIRK_NO_AREA (1 << 9) 66 67 #define MT_QUIRK_IGNORE_DUPLICATES (1 << 10) ··· 79 78 __s32 contactid; /* the device ContactID assigned to this slot */ 80 79 bool touch_state; /* is the touch valid? */ 81 80 bool inrange_state; /* is the finger in proximity of the sensor? */ 81 + bool confidence_state; /* is the touch made by a finger? */ 82 82 }; 83 83 84 84 struct mt_class { ··· 505 503 return 1; 506 504 case HID_DG_CONFIDENCE: 507 505 if (cls->name == MT_CLS_WIN_8 && 508 - field->application == HID_DG_TOUCHPAD) { 509 - cls->quirks &= ~MT_QUIRK_ALWAYS_VALID; 510 - cls->quirks |= MT_QUIRK_VALID_IS_CONFIDENCE; 511 - } 506 + field->application == HID_DG_TOUCHPAD) 507 + cls->quirks |= MT_QUIRK_CONFIDENCE; 512 508 mt_store_field(usage, td, hi); 513 509 return 1; 514 510 case HID_DG_TIPSWITCH: ··· 619 619 return; 620 620 621 621 if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) { 622 + int active; 622 623 int slotnum = mt_compute_slot(td, input); 623 624 struct mt_slot *s = &td->curdata; 624 625 struct input_mt *mt = input->mt; ··· 634 633 return; 635 634 } 636 635 636 + if (!(td->mtclass.quirks & MT_QUIRK_CONFIDENCE)) 637 + s->confidence_state = 1; 638 + active = (s->touch_state || s->inrange_state) && 639 + s->confidence_state; 640 + 637 641 input_mt_slot(input, slotnum); 638 - input_mt_report_slot_state(input, MT_TOOL_FINGER, 639 - s->touch_state || s->inrange_state); 640 - if (s->touch_state || s->inrange_state) { 642 + input_mt_report_slot_state(input, MT_TOOL_FINGER, active); 643 + if (active) { 641 644 /* this finger is in proximity of the sensor */ 642 645 int wide = (s->w > s->h); 643 646 /* divided by two to match visual scale of touch */ ··· 706 701 td->curdata.touch_state = value; 707 702 break; 708 703 case HID_DG_CONFIDENCE: 704 + if (quirks & MT_QUIRK_CONFIDENCE) 705 + td->curdata.confidence_state = value; 709 706 if (quirks & MT_QUIRK_VALID_IS_CONFIDENCE) 710 707 td->curvalid = value; 711 708 break;