The backport of the touch_arbitration parameter (a88d7da) doesn't quite follow the style used by upstream, making it more difficult than necessary to import upstream patches into input-wacom. This commit syncs the code to more closely follow upstream.
Signed-off-by: Jason Gerecke <jason.gere...@wacom.com> --- 2.6.38/wacom_wac.c | 7 ++++--- 3.17/wacom_wac.c | 10 ++++++---- 3.7/wacom_wac.c | 7 ++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c index d451033..f13de45 100644 --- a/2.6.38/wacom_wac.c +++ b/2.6.38/wacom_wac.c @@ -840,7 +840,7 @@ static inline bool report_touch_events(struct wacom_wac *wacom) { return (touch_arbitration ? !wacom->shared->stylus_in_proximity : 1); } - + static inline bool delay_pen_events(struct wacom_wac *wacom) { return (wacom->shared->touch_down && touch_arbitration); @@ -1085,7 +1085,7 @@ static int wacom_wac_finger_count_touches(struct wacom_wac *wacom) if (touch_max == 1) return test_bit(BTN_TOUCH, input->key) && - report_touch_events(wacom); + report_touch_events(wacom); for (i = 0; i < input->mtsize; i++) { struct input_mt_slot *ps = &input->mt[i]; @@ -1364,7 +1364,8 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) for (i = 0; i < 2; i++) { int offset = (data[1] & 0x80) ? (8 * i) : (9 * i); - bool touch = (data[offset + 3] & 0x80) && report_touch_events(wacom); + bool touch = report_touch_events(wacom) + && (data[offset + 3] & 0x80); input_mt_slot(input, i); input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c index f262cc1..260dd22 100644 --- a/3.17/wacom_wac.c +++ b/3.17/wacom_wac.c @@ -897,7 +897,7 @@ static inline bool report_touch_events(struct wacom_wac *wacom) { return (touch_arbitration ? !wacom->shared->stylus_in_proximity : 1); } - + static inline bool delay_pen_events(struct wacom_wac *wacom) { return (wacom->shared->touch_down && touch_arbitration); @@ -1176,7 +1176,7 @@ static int wacom_wac_finger_count_touches(struct wacom_wac *wacom) if (touch_max == 1) return test_bit(BTN_TOUCH, input->key) && - report_touch_events(wacom); + report_touch_events(wacom); for (i = 0; i < input->mt->num_slots; i++) { struct input_mt_slot *ps = &input->mt->slots[i]; @@ -1849,7 +1849,8 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) for (i = 0; i < 2; i++) { int offset = (data[1] & 0x80) ? (8 * i) : (9 * i); - bool touch = (data[offset + 3] & 0x80) && report_touch_events(wacom); + bool touch = report_touch_events(wacom) + && (data[offset + 3] & 0x80); input_mt_slot(input, i); input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); @@ -2092,7 +2093,8 @@ static int wacom_bamboo_pad_touch_event(struct wacom_wac *wacom, prefix = data[0]; for (id = 0; id < wacom->features.touch_max; id++) { - valid = !!(prefix & BIT(id)) && report_touch_events(wacom); + valid = !!(prefix & BIT(id)) && + report_touch_events(wacom); input_mt_slot(input, id); input_mt_report_slot_state(input, MT_TOOL_FINGER, valid); diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c index c8f973a..986477e 100644 --- a/3.7/wacom_wac.c +++ b/3.7/wacom_wac.c @@ -840,7 +840,7 @@ static inline bool report_touch_events(struct wacom_wac *wacom) { return (touch_arbitration ? !wacom->shared->stylus_in_proximity : 1); } - + static inline bool delay_pen_events(struct wacom_wac *wacom) { return (wacom->shared->touch_down && touch_arbitration); @@ -1066,7 +1066,7 @@ static int wacom_wac_finger_count_touches(struct wacom_wac *wacom) if (touch_max == 1) return test_bit(BTN_TOUCH, input->key) && - report_touch_events(wacom); + report_touch_events(wacom); for (i = 0; i < input->mt->num_slots; i++) { struct input_mt_slot *ps = &input->mt->slots[i]; @@ -1341,7 +1341,8 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) for (i = 0; i < 2; i++) { int offset = (data[1] & 0x80) ? (8 * i) : (9 * i); - bool touch = (data[offset + 3] & 0x80) && report_touch_events(wacom); + bool touch = report_touch_events(wacom) + && (data[offset + 3] & 0x80); input_mt_slot(input, i); input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); -- 2.10.2 ------------------------------------------------------------------------------ _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel