linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/4] input : wacom - Update Graphire and old Bamboo tablet buttons
@ 2011-06-25  0:16 Ping Cheng
  2011-07-01  5:27 ` Henrik Rydberg
  0 siblings, 1 reply; 3+ messages in thread
From: Ping Cheng @ 2011-06-25  0:16 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, Ping Cheng, Ping Cheng

With the removal of BTN_TOOL_FINGER for tablet buttons and
expresskeys, serial number is needed to distingush if the
events were from a regular tool (stylus, eraser, or mouse)
or the attribures (buttons, strips, or wheels) on the tablet
since there are overlapped events between the tools and the
tablet attributes.

Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_wac.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 7ce1294..03ebcc8 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -265,6 +265,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
 			wacom->id[0] = 0;
 		input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
 		input_report_key(input, wacom->tool[0], prox);
+		input_event(input, EV_MSC, MSC_SERIAL, 1);
 		input_sync(input); /* sync last event */
 	}
 
@@ -274,8 +275,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
 		prox = data[7] & 0xf8;
 		if (prox || wacom->id[1]) {
 			wacom->id[1] = PAD_DEVICE_ID;
-			input_report_key(input, BTN_0, (data[7] & 0x40));
-			input_report_key(input, BTN_4, (data[7] & 0x80));
+			input_report_key(input, BTN_BACK, (data[7] & 0x40));
+			input_report_key(input, BTN_FORWARD, (data[7] & 0x80));
 			rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
 			input_report_rel(input, REL_WHEEL, rw);
 			if (!prox)
@@ -290,17 +291,17 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
 		prox = (data[7] & 0xf8) || data[8];
 		if (prox || wacom->id[1]) {
 			wacom->id[1] = PAD_DEVICE_ID;
-			input_report_key(input, BTN_0, (data[7] & 0x08));
-			input_report_key(input, BTN_1, (data[7] & 0x20));
-			input_report_key(input, BTN_4, (data[7] & 0x10));
-			input_report_key(input, BTN_5, (data[7] & 0x40));
+			input_report_key(input, BTN_BACK, (data[7] & 0x08));
+			input_report_key(input, BTN_LEFT, (data[7] & 0x20));
+			input_report_key(input, BTN_FORWARD, (data[7] & 0x10));
+			input_report_key(input, BTN_RIGHT, (data[7] & 0x40));
 			input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f));
 			if (!prox)
 				wacom->id[1] = 0;
 			input_report_abs(input, ABS_MISC, wacom->id[1]);
 			input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
+			retval = 1;
 		}
-		retval = 1;
 		break;
 	}
 exit:
@@ -1075,17 +1076,14 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
 
 	switch (wacom_wac->features.type) {
 	case WACOM_MO:
-		__set_bit(BTN_1, input_dev->keybit);
-		__set_bit(BTN_5, input_dev->keybit);
-
 		input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
 		/* fall through */
 
 	case WACOM_G4:
 		input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
 
-		__set_bit(BTN_0, input_dev->keybit);
-		__set_bit(BTN_4, input_dev->keybit);
+		__set_bit(BTN_BACK, input_dev->keybit);
+		__set_bit(BTN_FORWARD, input_dev->keybit);
 		/* fall through */
 
 	case GRAPHIRE:
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/4] input : wacom - Update Graphire and old Bamboo tablet buttons
  2011-06-25  0:16 [PATCH 4/4] input : wacom - Update Graphire and old Bamboo tablet buttons Ping Cheng
@ 2011-07-01  5:27 ` Henrik Rydberg
  0 siblings, 0 replies; 3+ messages in thread
From: Henrik Rydberg @ 2011-07-01  5:27 UTC (permalink / raw)
  To: Ping Cheng; +Cc: linux-input, dmitry.torokhov, Ping Cheng

On Fri, Jun 24, 2011 at 05:16:02PM -0700, Ping Cheng wrote:
> With the removal of BTN_TOOL_FINGER for tablet buttons and
> expresskeys, serial number is needed to distingush if the
> events were from a regular tool (stylus, eraser, or mouse)
> or the attribures (buttons, strips, or wheels) on the tablet
> since there are overlapped events between the tools and the
> tablet attributes.
> 
> Signed-off-by: Ping Cheng <pingc@wacom.com>
> ---

This patch seems to do three things; 1) the change described in the
text, 2) changing button events, and 3) fix a problem with return
value in the WACOM_MO case. Perhaps a more suitable patch split can be
arranged?

>  drivers/input/tablet/wacom_wac.c |   22 ++++++++++------------
>  1 files changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
> index 7ce1294..03ebcc8 100644
> --- a/drivers/input/tablet/wacom_wac.c
> +++ b/drivers/input/tablet/wacom_wac.c
> @@ -265,6 +265,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
>  			wacom->id[0] = 0;
>  		input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
>  		input_report_key(input, wacom->tool[0], prox);
> +		input_event(input, EV_MSC, MSC_SERIAL, 1);
>  		input_sync(input); /* sync last event */
>  	}
>  
> @@ -274,8 +275,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
>  		prox = data[7] & 0xf8;
>  		if (prox || wacom->id[1]) {
>  			wacom->id[1] = PAD_DEVICE_ID;
> -			input_report_key(input, BTN_0, (data[7] & 0x40));
> -			input_report_key(input, BTN_4, (data[7] & 0x80));
> +			input_report_key(input, BTN_BACK, (data[7] & 0x40));
> +			input_report_key(input, BTN_FORWARD, (data[7] & 0x80));
>  			rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
>  			input_report_rel(input, REL_WHEEL, rw);
>  			if (!prox)
> @@ -290,17 +291,17 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
>  		prox = (data[7] & 0xf8) || data[8];
>  		if (prox || wacom->id[1]) {
>  			wacom->id[1] = PAD_DEVICE_ID;
> -			input_report_key(input, BTN_0, (data[7] & 0x08));
> -			input_report_key(input, BTN_1, (data[7] & 0x20));
> -			input_report_key(input, BTN_4, (data[7] & 0x10));
> -			input_report_key(input, BTN_5, (data[7] & 0x40));
> +			input_report_key(input, BTN_BACK, (data[7] & 0x08));
> +			input_report_key(input, BTN_LEFT, (data[7] & 0x20));
> +			input_report_key(input, BTN_FORWARD, (data[7] & 0x10));
> +			input_report_key(input, BTN_RIGHT, (data[7] & 0x40));
>  			input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f));
>  			if (!prox)
>  				wacom->id[1] = 0;
>  			input_report_abs(input, ABS_MISC, wacom->id[1]);
>  			input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
> +			retval = 1;
>  		}
> -		retval = 1;
>  		break;
>  	}
>  exit:
> @@ -1075,17 +1076,14 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
>  
>  	switch (wacom_wac->features.type) {
>  	case WACOM_MO:
> -		__set_bit(BTN_1, input_dev->keybit);
> -		__set_bit(BTN_5, input_dev->keybit);
> -
>  		input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
>  		/* fall through */
>  
>  	case WACOM_G4:
>  		input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
>  
> -		__set_bit(BTN_0, input_dev->keybit);
> -		__set_bit(BTN_4, input_dev->keybit);
> +		__set_bit(BTN_BACK, input_dev->keybit);
> +		__set_bit(BTN_FORWARD, input_dev->keybit);
>  		/* fall through */
>  
>  	case GRAPHIRE:
> -- 

Thanks,
Henrik

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 4/4] input : wacom - Update Graphire and old Bamboo tablet buttons
@ 2011-07-01 16:00 Ping Cheng
  0 siblings, 0 replies; 3+ messages in thread
From: Ping Cheng @ 2011-07-01 16:00 UTC (permalink / raw)
  To: rydberg; +Cc: dmitry.torokhov, linux-input

On Thu, Jun 30, 2011 at 10:27 PM, Henrik Rydberg <rydberg@euromail.se> wrote:

    >> On Fri, Jun 24, 2011 at 05:16:02PM -0700, Ping Cheng wrote:
    >> With the removal of BTN_TOOL_FINGER for tablet buttons and
    >> expresskeys, serial number is needed to distingush if the
    >> events were from a regular tool (stylus, eraser, or mouse)
    >> or the attribures (buttons, strips, or wheels) on the tablet
    >> since there are overlapped events between the tools and the
    >> tablet attributes.
    >>
    >> Signed-off-by: Ping Cheng <pingc@wacom.com>
    >> ---
    >
    > This patch seems to do three things; 1) the change described in the
    > text, 2) changing button events, and 3) fix a problem with return
    > value in the WACOM_MO case. Perhaps a more suitable patch split can be
    > arranged?

Sure. Will do. Thank you for reviewing the patchset.

Ping

    >>  drivers/input/tablet/wacom_wac.c |   22 ++++++++++------------
    >>  1 files changed, 10 insertions(+), 12 deletions(-)
    >>
    >> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
    >> index 7ce1294..03ebcc8 100644
    >> --- a/drivers/input/tablet/wacom_wac.c
    >> +++ b/drivers/input/tablet/wacom_wac.c
    >> @@ -265,6 +265,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
    >>                       wacom->id[0] = 0;
    >>               input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
    >>               input_report_key(input, wacom->tool[0], prox);
    >> +             input_event(input, EV_MSC, MSC_SERIAL, 1);
    >>               input_sync(input); /* sync last event */
    >>       }
    >>
    >> @@ -274,8 +275,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
    >>               prox = data[7] & 0xf8;
    >>               if (prox || wacom->id[1]) {
    >>                       wacom->id[1] = PAD_DEVICE_ID;
    >> -                     input_report_key(input, BTN_0, (data[7] & 0x40));
    >> -                     input_report_key(input, BTN_4, (data[7] & 0x80));
    >> +                     input_report_key(input, BTN_BACK, (data[7] & 0x40));
    >> +                     input_report_key(input, BTN_FORWARD, (data[7] & 0x80));
    >>                       rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
    >>                       input_report_rel(input, REL_WHEEL, rw);
    >>                       if (!prox)
    >> @@ -290,17 +291,17 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
    >>               prox = (data[7] & 0xf8) || data[8];
    >>               if (prox || wacom->id[1]) {
    >>                       wacom->id[1] = PAD_DEVICE_ID;
    >> -                     input_report_key(input, BTN_0, (data[7] & 0x08));
    >> -                     input_report_key(input, BTN_1, (data[7] & 0x20));
    >> -                     input_report_key(input, BTN_4, (data[7] & 0x10));
    >> -                     input_report_key(input, BTN_5, (data[7] & 0x40));
    >> +                     input_report_key(input, BTN_BACK, (data[7] & 0x08));
    >> +                     input_report_key(input, BTN_LEFT, (data[7] & 0x20));
    >> +                     input_report_key(input, BTN_FORWARD, (data[7] & 0x10));
    >> +                     input_report_key(input, BTN_RIGHT, (data[7] & 0x40));
    >>                       input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f));
    >>                       if (!prox)
    >>                               wacom->id[1] = 0;
    >>                       input_report_abs(input, ABS_MISC, wacom->id[1]);
    >>                       input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
    >> +                     retval = 1;
    >>               }
    >> -             retval = 1;
    >>               break;
    >>       }
    >>  exit:
    >> @@ -1075,17 +1076,14 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
    >>
    >>       switch (wacom_wac->features.type) {
    >>       case WACOM_MO:
    >> -             __set_bit(BTN_1, input_dev->keybit);
    >> -             __set_bit(BTN_5, input_dev->keybit);
    >> -
    >>               input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
    >>               /* fall through */
    >>
    >>       case WACOM_G4:
    >>               input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
    >>
    >> -             __set_bit(BTN_0, input_dev->keybit);
    >> -             __set_bit(BTN_4, input_dev->keybit);
    >> +             __set_bit(BTN_BACK, input_dev->keybit);
    >> +             __set_bit(BTN_FORWARD, input_dev->keybit);
    >>               /* fall through */
    >>
    >>       case GRAPHIRE:
    >> --
    >
    > Thanks,
    > Henrik 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-01 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-25  0:16 [PATCH 4/4] input : wacom - Update Graphire and old Bamboo tablet buttons Ping Cheng
2011-07-01  5:27 ` Henrik Rydberg
  -- strict thread matches above, loose matches on Subject: below --
2011-07-01 16:00 Ping Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).