* [PATCH 1/2] input - wacom : rearrange type enum
@ 2012-05-12 1:24 Ping Cheng
2012-05-17 18:03 ` Chris Bagwell
2012-05-23 16:04 ` Jason Gerecke
0 siblings, 2 replies; 3+ messages in thread
From: Ping Cheng @ 2012-05-12 1:24 UTC (permalink / raw)
To: linux-input; +Cc: Ping Cheng, Ping Cheng
So we can simplify a few type related if statements
Signed-off-by: Ping Cheng <pingc@wacom.com>
---
drivers/input/tablet/wacom_sys.c | 10 +++-------
drivers/input/tablet/wacom_wac.c | 6 ++----
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 b3a8bd3..79b5cfb 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 004bc1b..c40dcb7 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 78fbd3f..8708043 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
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] input - wacom : rearrange type enum
2012-05-12 1:24 [PATCH 1/2] input - wacom : rearrange type enum Ping Cheng
@ 2012-05-17 18:03 ` Chris Bagwell
2012-05-23 16:04 ` Jason Gerecke
1 sibling, 0 replies; 3+ messages in thread
From: Chris Bagwell @ 2012-05-17 18:03 UTC (permalink / raw)
To: Ping Cheng; +Cc: linux-input, Ping Cheng, Dmitry Torokhov
For both patches:
Acked-by: Chris Bagwell <chris@cnpbagwell.com>
On Fri, May 11, 2012 at 8:24 PM, Ping Cheng <pinglinux@gmail.com> wrote:
> So we can simplify a few type related if statements
>
> Signed-off-by: Ping Cheng <pingc@wacom.com>
> ---
> drivers/input/tablet/wacom_sys.c | 10 +++-------
> drivers/input/tablet/wacom_wac.c | 6 ++----
> 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 b3a8bd3..79b5cfb 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 004bc1b..c40dcb7 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 78fbd3f..8708043 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
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] input - wacom : rearrange type enum
2012-05-12 1:24 [PATCH 1/2] input - wacom : rearrange type enum Ping Cheng
2012-05-17 18:03 ` Chris Bagwell
@ 2012-05-23 16:04 ` Jason Gerecke
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gerecke @ 2012-05-23 16:04 UTC (permalink / raw)
To: Ping Cheng, Dmitry Torokhov; +Cc: linux-input, Ping Cheng
On Fri, May 11, 2012 at 6:24 PM, Ping Cheng <pinglinux@gmail.com> wrote:
> So we can simplify a few type related if statements
>
> Signed-off-by: Ping Cheng <pingc@wacom.com>
> ---
> drivers/input/tablet/wacom_sys.c | 10 +++-------
> drivers/input/tablet/wacom_wac.c | 6 ++----
> 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 b3a8bd3..79b5cfb 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 004bc1b..c40dcb7 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 78fbd3f..8708043 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
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
In case this is waiting for a review to come in, for both patches in the set:
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Jason
---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-23 16:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-12 1:24 [PATCH 1/2] input - wacom : rearrange type enum Ping Cheng
2012-05-17 18:03 ` Chris Bagwell
2012-05-23 16:04 ` Jason Gerecke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.