Input: wacom - use switch statement for wacom_tpc_irq()
authorPing Cheng <pinglinux@gmail.com>
Tue, 31 Jan 2012 08:07:33 +0000 (00:07 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 31 Jan 2012 08:14:17 +0000 (00:14 -0800)
And add two new data formats.

Tested-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/tablet/wacom_wac.c
drivers/input/tablet/wacom_wac.h

index e18f362326828ed12b5985bbf34574a8cc242d3c..9283507b13aff5f76ed7116b0b1bc19b74aea366 100644 (file)
@@ -832,12 +832,24 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
 
        dbg("wacom_tpc_irq: received report #%d", data[0]);
 
-       if (len == WACOM_PKGLEN_TPC1FG || data[0] == WACOM_REPORT_TPC1FG)
-               return wacom_tpc_single_touch(wacom, len);
-       else if (data[0] == WACOM_REPORT_TPC2FG)
-               return wacom_tpc_mt_touch(wacom);
-       else if (data[0] == WACOM_REPORT_PENABLED)
-               return wacom_tpc_pen(wacom);
+       switch (len) {
+       case WACOM_PKGLEN_TPC1FG:
+                return wacom_tpc_single_touch(wacom, len);
+
+       case WACOM_PKGLEN_TPC2FG:
+               return wacom_tpc_mt_touch(wacom);
+
+       default:
+               switch (data[0]) {
+               case WACOM_REPORT_TPC1FG:
+               case WACOM_REPORT_TPCHID:
+               case WACOM_REPORT_TPCST:
+                       return wacom_tpc_single_touch(wacom, len);
+
+               case WACOM_REPORT_PENABLED:
+                       return wacom_tpc_pen(wacom);
+               }
+       }
 
        return 0;
 }
index 050acaefee7d3763f543f70ac5f551f41d5bde30..4f0ba21b01962c4b2556535468c96f7355e17d1c 100644 (file)
@@ -39,6 +39,8 @@
 #define WACOM_REPORT_INTUOSPAD         12
 #define WACOM_REPORT_TPC1FG            6
 #define WACOM_REPORT_TPC2FG            13
+#define WACOM_REPORT_TPCHID            15
+#define WACOM_REPORT_TPCST             16
 
 /* device quirks */
 #define WACOM_QUIRK_MULTI_INPUT                0x0001
This page took 0.02608 seconds and 5 git commands to generate.