linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid
@ 2015-01-22 23:53 Jason Gerecke
  2015-01-23  0:56 ` Benjamin Tissoires
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gerecke @ 2015-01-22 23:53 UTC (permalink / raw)
  To: linux-input
  Cc: Ping Cheng, Benjamin Tissoires, Jiri Kosina, Dmitry Torokhov,
	Jason Gerecke

It appears that the Cintiq Companion Hybrid does not send an ABS_MISC
event to userspace when any of its ExpressKeys are pressed. This is not
strictly necessary now that the pad exists on its own device, but
should be fixed for consistency's sake.

Traditionally both the stylus and pad shared the same device node, and
xf86-input-wacom would use ABS_MISC for disambiguation. Not sending this 
causes the Hybrid to behave incorrectly with xf86-input-wacom beginning with 
its 8f44f3 commit.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
Question: I'd like to write a version of this patch which targets stable 
releases where the stylus and pad share the device node. How would I go 
about submitting one, since CCing this patch to stable won't quite do the 
trick (the patches would have to be against our old home under 
drivers/input/tablet...)

 drivers/hid/wacom_wac.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index a4ba8ca..f886149 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -783,6 +783,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 			input_report_key(input, BTN_7, (data[4] & 0x40));  /* Left   */
 			input_report_key(input, BTN_8, (data[4] & 0x80));  /* Down   */
 			input_report_key(input, BTN_0, (data[3] & 0x01));  /* Center */
+
+			if (data[4] | (data[3] & 0x01)) {
+				input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
+			} else {
+				input_report_abs(input, ABS_MISC, 0);
+			}
 		} else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
 			int i;
 
-- 
2.2.1


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

* Re: [PATCH] HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid
  2015-01-22 23:53 [PATCH] HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid Jason Gerecke
@ 2015-01-23  0:56 ` Benjamin Tissoires
  2015-01-23 14:07   ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Tissoires @ 2015-01-23  0:56 UTC (permalink / raw)
  To: Jason Gerecke; +Cc: linux-input, Ping Cheng, Jiri Kosina, Dmitry Torokhov

On Thu, Jan 22, 2015 at 6:53 PM, Jason Gerecke <killertofu@gmail.com> wrote:
> It appears that the Cintiq Companion Hybrid does not send an ABS_MISC
> event to userspace when any of its ExpressKeys are pressed. This is not
> strictly necessary now that the pad exists on its own device, but
> should be fixed for consistency's sake.
>
> Traditionally both the stylus and pad shared the same device node, and
> xf86-input-wacom would use ABS_MISC for disambiguation. Not sending this
> causes the Hybrid to behave incorrectly with xf86-input-wacom beginning with
> its 8f44f3 commit.
>
> Signed-off-by: Jason Gerecke <killertofu@gmail.com>
> ---
> Question: I'd like to write a version of this patch which targets stable
> releases where the stylus and pad share the device node. How would I go
> about submitting one, since CCing this patch to stable won't quite do the
> trick (the patches would have to be against our old home under
> drivers/input/tablet...)

IIRC, once this one hits linus tree, you send an adapted version of
the same patch which refers this one.
Just add the hash of the final patch in Linus tree, and mention in the
subject prefix which stable releases you are targeting.

See for an example http://thread.gmane.org/gmane.linux.kernel.stable/120947

>
>  drivers/hid/wacom_wac.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> index a4ba8ca..f886149 100644
> --- a/drivers/hid/wacom_wac.c
> +++ b/drivers/hid/wacom_wac.c
> @@ -783,6 +783,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
>                         input_report_key(input, BTN_7, (data[4] & 0x40));  /* Left   */
>                         input_report_key(input, BTN_8, (data[4] & 0x80));  /* Down   */
>                         input_report_key(input, BTN_0, (data[3] & 0x01));  /* Center */
> +
> +                       if (data[4] | (data[3] & 0x01)) {
> +                               input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
> +                       } else {
> +                               input_report_abs(input, ABS_MISC, 0);
> +                       }

I am not 100% sure, but in my memories, the ABS_MISC event was sent
before any buttons.
But maybe not.

Anyway, this is Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

>                 } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
>                         int i;
>
> --
> 2.2.1
>

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

* Re: [PATCH] HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid
  2015-01-23  0:56 ` Benjamin Tissoires
@ 2015-01-23 14:07   ` Jiri Kosina
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2015-01-23 14:07 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: Jason Gerecke, linux-input, Ping Cheng, Dmitry Torokhov

On Thu, 22 Jan 2015, Benjamin Tissoires wrote:

> On Thu, Jan 22, 2015 at 6:53 PM, Jason Gerecke <killertofu@gmail.com> wrote:
> > It appears that the Cintiq Companion Hybrid does not send an ABS_MISC
> > event to userspace when any of its ExpressKeys are pressed. This is not
> > strictly necessary now that the pad exists on its own device, but
> > should be fixed for consistency's sake.
> >
> > Traditionally both the stylus and pad shared the same device node, and
> > xf86-input-wacom would use ABS_MISC for disambiguation. Not sending this
> > causes the Hybrid to behave incorrectly with xf86-input-wacom beginning with
> > its 8f44f3 commit.
> >
> > Signed-off-by: Jason Gerecke <killertofu@gmail.com>
> > ---
> > Question: I'd like to write a version of this patch which targets stable
> > releases where the stylus and pad share the device node. How would I go
> > about submitting one, since CCing this patch to stable won't quite do the
> > trick (the patches would have to be against our old home under
> > drivers/input/tablet...)
> 
> IIRC, once this one hits linus tree, you send an adapted version of
> the same patch which refers this one.
> Just add the hash of the final patch in Linus tree, and mention in the
> subject prefix which stable releases you are targeting.

Yup, that's the proper process.

I am therefore not adding Cc: stable explicitly, Jason -- please handle 
this manually once it hits Linus' tree, as it requires manual backport 
anyway.

> See for an example http://thread.gmane.org/gmane.linux.kernel.stable/120947
> 
> >
> >  drivers/hid/wacom_wac.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> > index a4ba8ca..f886149 100644
> > --- a/drivers/hid/wacom_wac.c
> > +++ b/drivers/hid/wacom_wac.c
> > @@ -783,6 +783,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
> >                         input_report_key(input, BTN_7, (data[4] & 0x40));  /* Left   */
> >                         input_report_key(input, BTN_8, (data[4] & 0x80));  /* Down   */
> >                         input_report_key(input, BTN_0, (data[3] & 0x01));  /* Center */
> > +
> > +                       if (data[4] | (data[3] & 0x01)) {
> > +                               input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
> > +                       } else {
> > +                               input_report_abs(input, ABS_MISC, 0);
> > +                       }
> 
> I am not 100% sure, but in my memories, the ABS_MISC event was sent
> before any buttons.
> But maybe not.
> 
> Anyway, this is Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Thanks. Now applied and pushed out.

-- 
Jiri Kosina
SUSE Labs

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

end of thread, other threads:[~2015-01-23 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22 23:53 [PATCH] HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid Jason Gerecke
2015-01-23  0:56 ` Benjamin Tissoires
2015-01-23 14:07   ` Jiri Kosina

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).