Skip to content

Commit

Permalink
HID: wacom: Simplify check for presence of single-finger touch
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jason Gerecke authored and Jiri Kosina committed Apr 23, 2015
1 parent e48151a commit 71b5c47
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 71b5c47

Please sign in to comment.