Skip to contentSkip to conversation

HID: wacom: Simplify check for presence of single-finger touch

PATCH Applied Jason Gerecke 2 participants 2 messages Apr 16, 2015 – Apr 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: wacom: Simplify check for presence of single-finger touch

To determine if a touch is present in the single-touch case, we can simply check if the BTN_TOUCH key is active or not. This will work for both HID_GENERIC and other device types.

---
 drivers/hid/wacom_wac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hid/wacom_wac.c +2 -3
index 69c7df7..2292d85 100644
@@ -1072,9 +1072,8 @@ static int wacom_wac_finger_count_touches(struct wacom_wac *wacom)
 	int count = 0;
 	int i;
 
-	/* non-HID_GENERIC single touch input doesn't call this routine */
-	if ((touch_max == 1) && (wacom->features.type == HID_GENERIC))
-		return wacom->hid_data.tipswitch &&
+	if (touch_max == 1)
+		return test_bit(BTN_TOUCH, input->key) &&
 		       !wacom->shared->stylus_in_proximity;
 
 	for (i = 0; i < input->mt->num_slots; i++) {
Signature · 1 line
2.3.5
Applied
#1 lore raw
Quoted 5 lines · Jason Gerecke

To determine if a touch is present in the single-touch case, we can simply check if the BTN_TOUCH key is active or not. This will work for both HID_GENERIC and other device types.

Applied to for-4.2/wacom.

Signature · 2 lines
Jiri Kosina
SUSE Labs