linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: Simplify check for presence of single-finger touch
@ 2015-04-16  0:22 Jason Gerecke
  2015-04-23  8:06 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Gerecke @ 2015-04-16  0:22 UTC (permalink / raw)
  To: Jiri Kosina, Ping Cheng, Benjamin Tissoires
  Cc: linux-input, linux-kernel, Jason Gerecke, 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.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
---
 drivers/hid/wacom_wac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 69c7df7..2292d85 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -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++) {
-- 
2.3.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: wacom: Simplify check for presence of single-finger touch
  2015-04-16  0:22 [PATCH] HID: wacom: Simplify check for presence of single-finger touch Jason Gerecke
@ 2015-04-23  8:06 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2015-04-23  8:06 UTC (permalink / raw)
  To: Jason Gerecke
  Cc: Ping Cheng, Benjamin Tissoires, linux-input, linux-kernel,
	Jason Gerecke

On Wed, 15 Apr 2015, Jason Gerecke wrote:

> 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>

Applied to for-4.2/wacom.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-23  8:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16  0:22 [PATCH] HID: wacom: Simplify check for presence of single-finger touch Jason Gerecke
2015-04-23  8:06 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).