From 4492efffffeb88d87e7aa74765f3c53b3a7dd40f Mon Sep 17 00:00:00 2001 From: Ping Cheng Date: Fri, 19 Mar 2010 22:18:15 -0700 Subject: Input: wacom - share pen info with touch of the same ID Touch enbaled devices share the same product ID with pen. However, we do not want to post touch events while pen is in prox. To do so, we used to keep a local static variable to keep track of if pen is in prox or not. This works fine for Tablet PC devices since there is only one device attached. With the newer touch enabled regular tablets, we can not make this assumption any more, i.e, one system may have more than one identical tablet plugged in. This patch adds an new entry, shared, into the struct wacom_wac so touch data can access pen data to locally. This solution assumes the two tools (touch and pen) of the same ID will be probed one after the other without interruption in between by another Wacom device of the same ID. --- drivers/input/tablet/wacom_wac.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/input/tablet/wacom_wac.h') diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index b50cf04e61a8..4b55fc7ad8ae 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -71,6 +71,10 @@ struct wacom_features { unsigned char unitExpo; }; +struct wacom_shared { + bool stylus_in_proximity; +}; + struct wacom_wac { char name[64]; unsigned char *data; @@ -78,6 +82,7 @@ struct wacom_wac { int id[2]; __u32 serial[2]; struct wacom_features features; + struct wacom_shared *shared; }; #endif -- cgit v1.2.2 From 51269fe86c263ec4fafbafe82970e6d7f6f79102 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 19 Mar 2010 22:18:15 -0700 Subject: Input: wacom - do not allocate wacom_wac separately There is no reason for allocating struct wacom_wac separately from struct wacom since both have the same lifetime rules and are not shared. Also make 'open' field a boolean. Signed-off-by: Dmitry Torokhov --- drivers/input/tablet/wacom_wac.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/input/tablet/wacom_wac.h') diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 4b55fc7ad8ae..f190a2bf148f 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -9,6 +9,8 @@ #ifndef WACOM_WAC_H #define WACOM_WAC_H +#include + /* maximum packet length for USB devices */ #define WACOM_PKGLEN_MAX 32 -- cgit v1.2.2 From 8da23fc113e8bdaf813545ec935a6c60254ac439 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 19 Mar 2010 22:18:15 -0700 Subject: Input: wacom - get rid of input event wrappers Input event interface is pretty stable so let's get rig of wrappers for input_event() and fiends and call them directly. This will simplify and speed up code a bit. Signed-off-by: Dmitry Torokhov --- drivers/input/tablet/wacom_wac.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/input/tablet/wacom_wac.h') diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index f190a2bf148f..69098a2aa690 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -85,6 +85,7 @@ struct wacom_wac { __u32 serial[2]; struct wacom_features features; struct wacom_shared *shared; + struct input_dev *input; }; #endif -- cgit v1.2.2 From ab687b18aa77aeda5472d9ea054bf92c45c49c0c Mon Sep 17 00:00:00 2001 From: Ping Cheng Date: Mon, 5 Apr 2010 23:07:41 -0700 Subject: Input: wacom - streamline 2-finger touch support Clean up 2-finger touch support. This still needs to be converted to proper multi-touch protocol. Signed-off-by: Ping Cheng Signed-off-by: Dmitry Torokhov --- drivers/input/tablet/wacom_wac.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/input/tablet/wacom_wac.h') diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 69098a2aa690..063f1af3204f 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -80,9 +80,10 @@ struct wacom_shared { struct wacom_wac { char name[64]; unsigned char *data; - int tool[2]; - int id[2]; + int tool[3]; + int id[3]; __u32 serial[2]; + int last_finger; struct wacom_features features; struct wacom_shared *shared; struct input_dev *input; -- cgit v1.2.2