Skip to content

Commit

Permalink
Input: wacom - rearrange type enum
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ping Cheng authored and Dmitry Torokhov committed Jun 12, 2012
1 parent 03ecd22 commit ea2e602
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
10 changes: 3 additions & 7 deletions drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/tablet/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/tablet/wacom_wac.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ enum {
PTU,
PL,
DTU,
BAMBOO_PT,
WIRELESS,
INTUOS,
INTUOS3S,
INTUOS3,
Expand All @@ -79,7 +77,9 @@ enum {
CINTIQ,
WACOM_BEE,
WACOM_MO,
TABLETPC,
WIRELESS,
BAMBOO_PT,
TABLETPC, /* add new TPC below */
TABLETPC2FG,
MTSCREEN,
MAX_TYPE
Expand Down

0 comments on commit ea2e602

Please sign in to comment.