Input: wacom - rearrange type enum
authorPing Cheng <pinglinux@gmail.com>
Tue, 12 Jun 2012 07:14:12 +0000 (00:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:39:46 +0000 (10:39 -0700)
commit ea2e60244573a9204c8cee9b4fb181106784c617 upstream.

So we can simplify a few type related if statements

Also fixes https://bugzilla.kernel.org/show_bug.cgi?id=46821

Signed-off-by: Ping Cheng <pingc@wacom.com>
Acked-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/tablet/wacom_sys.c
drivers/input/tablet/wacom_wac.c
drivers/input/tablet/wacom_wac.h

index 8b31473a81fe9bd6056dd95363405f0e7610c4ee..824abc74541dfd7b5ff8ecd992c784117cf8569f 100644 (file)
@@ -445,8 +445,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
        /* ask to report Wacom data */
        if (features->device_type == BTN_TOOL_FINGER) {
                /* if it is an MT Tablet PC touch */
-               if (features->type == TABLETPC2FG ||
-                   features->type == MTSCREEN) {
+               if (features->type > TABLETPC) {
                        do {
                                rep_data[0] = 3;
                                rep_data[1] = 4;
@@ -465,7 +464,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
                        } while ((error < 0 || rep_data[1] != 4) &&
                                 limit++ < WAC_MSG_RETRIES);
                }
-       } else if (features->type != TABLETPC &&
+       } else if (features->type <= BAMBOO_PT &&
                   features->type != WIRELESS &&
                   features->device_type == BTN_TOOL_PEN) {
                do {
@@ -515,10 +514,7 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
        }
 
        /* only devices that support touch need to retrieve the info */
-       if (features->type != TABLETPC &&
-           features->type != TABLETPC2FG &&
-           features->type != BAMBOO_PT &&
-           features->type != MTSCREEN) {
+       if (features->type < BAMBOO_PT) {
                goto out;
        }
 
index a616733dd5fe3696ba2ab5a1a4f868bd52b90e73..05e8cb329cf399b49ca5dd15facc6a95eccbd995 100644 (file)
@@ -1324,10 +1324,8 @@ void wacom_setup_device_quirks(struct wacom_features *features)
        }
 
        /* these device have multiple inputs */
-       if (features->type == TABLETPC || features->type == TABLETPC2FG ||
-           features->type == BAMBOO_PT || features->type == WIRELESS ||
-           (features->type >= INTUOS5S && features->type <= INTUOS5L) ||
-           features->type == MTSCREEN)
+       if (features->type >= WIRELESS ||
+           (features->type >= INTUOS5S && features->type <= INTUOS5L))
                features->quirks |= WACOM_QUIRK_MULTI_INPUT;
 
        /* quirk for bamboo touch with 2 low res touches */
index 0fb769bfde8d65a77aa6c68c051b5b6f617d07ea..9ae91186155877769d39f00c71185358e7baf4d7 100644 (file)
@@ -62,8 +62,6 @@ enum {
        PTU,
        PL,
        DTU,
-       BAMBOO_PT,
-       WIRELESS,
        INTUOS,
        INTUOS3S,
        INTUOS3,
@@ -80,7 +78,9 @@ enum {
        CINTIQ,
        WACOM_BEE,
        WACOM_MO,
-       TABLETPC,
+       WIRELESS,
+       BAMBOO_PT,
+       TABLETPC,   /* add new TPC below */
        TABLETPC2FG,
        MTSCREEN,
        MAX_TYPE