From: Ping Cheng <pingli...@gmail.com>

Historically we dealt with touch_max equals to 2 differently from
other MT devices. Now we use input_mt_*() to process all MT events,
as long as touch_max is greater than 1. So, there is no need to
take (touch_max == 2) as a special case any more.

Signed-off-by: Ping Cheng <pi...@wacom.com>
Reviewed-by: Jason Gerecke <killert...@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torok...@gmail.com>
---
 3.17/wacom_wac.c | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
index 1ac6719..803318f 100644
--- a/3.17/wacom_wac.c
+++ b/3.17/wacom_wac.c
@@ -1325,9 +1325,9 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, 
unsigned char *data)
                         * a=(pi*r^2)/C.
                         */
                        int a = data[5];
-                       int x_res  = input_abs_get_res(input, ABS_X);
-                       int y_res  = input_abs_get_res(input, ABS_Y);
-                       width  = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
+                       int x_res = input_abs_get_res(input, ABS_MT_POSITION_X);
+                       int y_res = input_abs_get_res(input, ABS_MT_POSITION_Y);
+                       width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
                        height = width * y_res / x_res;
                }
 
@@ -1715,7 +1715,7 @@ static void wacom_abs_set_axis(struct input_dev 
*input_dev,
                input_abs_set_res(input_dev, ABS_X, features->x_resolution);
                input_abs_set_res(input_dev, ABS_Y, features->y_resolution);
        } else {
-               if (features->touch_max <= 2) {
+               if (features->touch_max == 1) {
                        input_set_abs_params(input_dev, ABS_X, 0,
                                features->x_max, features->x_fuzz, 0);
                        input_set_abs_params(input_dev, ABS_Y, 0,
@@ -1886,14 +1886,8 @@ int wacom_setup_input_capabilities(struct input_dev 
*input_dev,
        case MTTPC:
        case MTTPC_B:
        case TABLETPC2FG:
-               if (features->device_type == BTN_TOOL_FINGER) {
-                       unsigned int flags = INPUT_MT_DIRECT;
-
-                       if (wacom_wac->features.type == TABLETPC2FG)
-                               flags = 0;
-
-                       input_mt_init_slots(input_dev, features->touch_max, 
flags);
-               }
+               if (features->device_type == BTN_TOOL_FINGER && 
features->touch_max > 1)
+                       input_mt_init_slots(input_dev, features->touch_max, 
INPUT_MT_DIRECT);
                /* fall through */
 
        case TABLETPC:
@@ -1944,10 +1938,6 @@ int wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                if (features->device_type == BTN_TOOL_FINGER) {
 
                        if (features->touch_max) {
-                               /* touch interface */
-                               unsigned int flags = INPUT_MT_POINTER;
-
-                               __set_bit(INPUT_PROP_POINTER, 
input_dev->propbit);
                                if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
                                        input_set_abs_params(input_dev,
                                                     ABS_MT_TOUCH_MAJOR,
@@ -1955,12 +1945,8 @@ int wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                                        input_set_abs_params(input_dev,
                                                     ABS_MT_TOUCH_MINOR,
                                                     0, features->y_max, 0, 0);
-                               } else {
-                                       __set_bit(BTN_TOOL_FINGER, 
input_dev->keybit);
-                                       __set_bit(BTN_TOOL_DOUBLETAP, 
input_dev->keybit);
-                                       flags = 0;
                                }
-                               input_mt_init_slots(input_dev, 
features->touch_max, flags);
+                               input_mt_init_slots(input_dev, 
features->touch_max, INPUT_MT_POINTER);
                        } else {
                                /* buttons/keys only interface */
                                __clear_bit(ABS_X, input_dev->absbit);
-- 
2.1.3


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to