diff options
author | Ping Cheng <pinglinux@gmail.com> | 2012-06-12 11:14:12 +0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-06-12 11:39:51 +0400 |
commit | ea2e60244573a9204c8cee9b4fb181106784c617 (patch) | |
tree | a33b1950a62d095d9806f74da7a87ba2e7a564b7 /drivers/input/tablet | |
parent | 03ecd229a5d05a5c62e7262d66ec6cd57d5eca6c (diff) | |
download | linux-ea2e60244573a9204c8cee9b4fb181106784c617.tar.xz |
Input: wacom - rearrange type enum
So we can simplify a few type related if statements
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>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 10 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 6 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 6 |
3 files changed, 8 insertions, 14 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index b3a8bd3514b2..79b5cfbc1bc4 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -440,8 +440,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; @@ -460,7 +459,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 { @@ -510,10 +509,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; } diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 004bc1bb1544..c40dcb7036b3 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -1317,10 +1317,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 */ diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 78fbd3f42009..87080435116c 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -62,8 +62,6 @@ enum { PTU, PL, DTU, - BAMBOO_PT, - WIRELESS, INTUOS, INTUOS3S, INTUOS3, @@ -79,7 +77,9 @@ enum { CINTIQ, WACOM_BEE, WACOM_MO, - TABLETPC, + WIRELESS, + BAMBOO_PT, + TABLETPC, /* add new TPC below */ TABLETPC2FG, MTSCREEN, MAX_TYPE |