Re: [Linuxwacom-devel] [PATCH input-wacom 1/2] backport: add support for Cintiq 24HD

2012-03-29 Thread Chris Bagwell
On Thu, Mar 29, 2012 at 10:36 AM, Jason Gerecke  wrote:
> On Thu, Mar 29, 2012 at 6:54 AM, Chris Bagwell  wrote:
>> On Wed, Mar 28, 2012 at 12:31 PM, Ping Cheng  wrote:
>>> On Wed, Mar 28, 2012 at 9:29 AM, Jason Gerecke  wrote:
 Based on upstream commit 803296b678a43005e3bc0aaa1951d211bd76a054

 Signed-off-by: Jason Gerecke 
>>>
>>> Acked-by: Ping Cheng  for the set.
>>>
>>> Ping
>>
>> Are you going to commit patches yourself, Jason?
>>
> Yeah, just haven't gotten around to it yet.
>
>> I had hoped for 2.6.36 that I'd copy latest upstream source into that
>> directory at some point instead of porting the 3 or so missing
>> features... but I'm getting a little worried that we will need a 3.3
>> or 3.4 branch soon.  If I compile the latest upstream version against
>> my 3.2 kernel headers then it results in a non-working driver.  So we
>> may need to port each feature like you've done for 2.6.36 after all.
>>
>> Chris
>
> What's the problem you're having with the 3.2 headers? I just compiled
> input-wacom with my I5 backports and your upstream wireless patches
> (tweaked as necessary) and don't seem to be running into any trouble
> with the resulting driver working with the Arch Linux 3.2.11-1 kernel.

Good to know its working OK for you.  I'm on Fedora using one of their
3.2 kernels.  They are pretty aggressive at patching the kernels and
its not uncommon for internal structures to be closer to future
releases.

When compiling the wacom files from dtor's for-linus branch but
against current kernels header files I get a new warning:

linux/drivers/input/tablet/wacom_sys.c:1166:1: warning: data
definition has no type or storage class [enabled by default]

and the driver loads OK but doesn't do anything.

>
> I've recently been looking at how the versions are diverging, and
> there's a couple things that need to be addressed. Some are trivial,
> while others may need testing. Most of the differences though looks to
> be pretty easy to merge back to 2.6.30, or possibly even 2.6.16 (I'm
> not familiar enough with the legacy linuxwacom code to be sure of that
> statement...). The hard part will be testing to ensure everything
> works properly.

I see I was a little confused in my statement.  I meant to say I plan
to copy latest upstream to 2.6.38; not 2.6.36.  I guess that anything
for 2.6.36 still needs hand porting.

I did start a Bamboo 3rd gen backport to 2.6.36 but its stalled out at
the moment.

Chris

>
> If I can get some time, I'd like to work out what needs to be done to
> get everything in sync again. Backporting I5 took longer than expected
> because of all the small bumps in the merge process
>
> Jason
>
> ---
> Day xee-nee-svsh duu-'ushtlh-ts'it;
> nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
> Huu-chan xuu naa~-gha.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/2] backport: add support for Cintiq 24HD

2012-03-29 Thread Jason Gerecke
On Thu, Mar 29, 2012 at 6:54 AM, Chris Bagwell  wrote:
> On Wed, Mar 28, 2012 at 12:31 PM, Ping Cheng  wrote:
>> On Wed, Mar 28, 2012 at 9:29 AM, Jason Gerecke  wrote:
>>> Based on upstream commit 803296b678a43005e3bc0aaa1951d211bd76a054
>>>
>>> Signed-off-by: Jason Gerecke 
>>
>> Acked-by: Ping Cheng  for the set.
>>
>> Ping
>
> Are you going to commit patches yourself, Jason?
>
Yeah, just haven't gotten around to it yet.

> I had hoped for 2.6.36 that I'd copy latest upstream source into that
> directory at some point instead of porting the 3 or so missing
> features... but I'm getting a little worried that we will need a 3.3
> or 3.4 branch soon.  If I compile the latest upstream version against
> my 3.2 kernel headers then it results in a non-working driver.  So we
> may need to port each feature like you've done for 2.6.36 after all.
>
> Chris

What's the problem you're having with the 3.2 headers? I just compiled
input-wacom with my I5 backports and your upstream wireless patches
(tweaked as necessary) and don't seem to be running into any trouble
with the resulting driver working with the Arch Linux 3.2.11-1 kernel.

I've recently been looking at how the versions are diverging, and
there's a couple things that need to be addressed. Some are trivial,
while others may need testing. Most of the differences though looks to
be pretty easy to merge back to 2.6.30, or possibly even 2.6.16 (I'm
not familiar enough with the legacy linuxwacom code to be sure of that
statement...). The hard part will be testing to ensure everything
works properly.

If I can get some time, I'd like to work out what needs to be done to
get everything in sync again. Backporting I5 took longer than expected
because of all the small bumps in the merge process

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/2] backport: add support for Cintiq 24HD

2012-03-29 Thread Chris Bagwell
On Wed, Mar 28, 2012 at 12:31 PM, Ping Cheng  wrote:
> On Wed, Mar 28, 2012 at 9:29 AM, Jason Gerecke  wrote:
>> Based on upstream commit 803296b678a43005e3bc0aaa1951d211bd76a054
>>
>> Signed-off-by: Jason Gerecke 
>
> Acked-by: Ping Cheng  for the set.
>
> Ping

Are you going to commit patches yourself, Jason?

I had hoped for 2.6.36 that I'd copy latest upstream source into that
directory at some point instead of porting the 3 or so missing
features... but I'm getting a little worried that we will need a 3.3
or 3.4 branch soon.  If I compile the latest upstream version against
my 3.2 kernel headers then it results in a non-working driver.  So we
may need to port each feature like you've done for 2.6.36 after all.

Chris

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/2] backport: add support for Cintiq 24HD

2012-03-28 Thread Ping Cheng
On Wed, Mar 28, 2012 at 9:29 AM, Jason Gerecke  wrote:
> Based on upstream commit 803296b678a43005e3bc0aaa1951d211bd76a054
>
> Signed-off-by: Jason Gerecke 

Acked-by: Ping Cheng  for the set.

Ping

> ---
>  2.6.30/wacom_wac.c |   77 
> +++-
>  2.6.30/wacom_wac.h |    1 +
>  2.6.36/wacom_wac.c |   77 
> +++-
>  2.6.36/wacom_wac.h |    1 +
>  4 files changed, 154 insertions(+), 2 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index bad56d3..46f306f 100755
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -613,7 +613,8 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
>        /* general pen packet */
>        if ((data[1] & 0xb8) == 0xa0) {
>                t = (data[6] << 2) | ((data[7] >> 6) & 3);
> -               if (features->type >= INTUOS4S && features->type <= 
> WACOM_21UX2)
> +               if ((features->type >= INTUOS4S && features->type <= 
> WACOM_21UX2) ||
> +                   features->type == WACOM_24HD)
>                        t = (t << 1) | (data[1] & 1);
>                input_report_abs(input, ABS_PRESSURE, t);
>                input_report_abs(input, ABS_TILT_X,
> @@ -677,6 +678,56 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
>                                input_report_abs(input, ABS_MISC, 
> PAD_DEVICE_ID);
>                        else
>                                input_report_abs(input, ABS_MISC, 0);
> +               } else if (features->type == WACOM_24HD) {
> +                       input_report_key(input, BTN_0, (data[6] & 0x01));
> +                       input_report_key(input, BTN_1, (data[6] & 0x02));
> +                       input_report_key(input, BTN_2, (data[6] & 0x04));
> +                       input_report_key(input, BTN_3, (data[6] & 0x08));
> +                       input_report_key(input, BTN_4, (data[6] & 0x10));
> +                       input_report_key(input, BTN_5, (data[6] & 0x20));
> +                       input_report_key(input, BTN_6, (data[6] & 0x40));
> +                       input_report_key(input, BTN_7, (data[6] & 0x80));
> +                       input_report_key(input, BTN_8, (data[8] & 0x01));
> +                       input_report_key(input, BTN_9, (data[8] & 0x02));
> +                       input_report_key(input, BTN_A, (data[8] & 0x04));
> +                       input_report_key(input, BTN_B, (data[8] & 0x08));
> +                       input_report_key(input, BTN_C, (data[8] & 0x10));
> +                       input_report_key(input, BTN_X, (data[8] & 0x20));
> +                       input_report_key(input, BTN_Y, (data[8] & 0x40));
> +                       input_report_key(input, BTN_Z, (data[8] & 0x80));
> +
> +                       /*
> +                        * Three "buttons" are available on the 24HD which are
> +                        * physically implemented as a touchstrip. Each button
> +                        * is approximately 3 bits wide with a 2 bit spacing.
> +                        * The raw touchstrip bits are stored at:
> +                        *    ((data[3] & 0x1f) << 8) | data[4])
> +                        */
> +                       input_report_key(input, KEY_PROG1, data[4] & 0x07);
> +                       input_report_key(input, KEY_PROG2, data[4] & 0xE0);
> +                       input_report_key(input, KEY_PROG3, data[3] & 0x1C);
> +
> +                       if (data[1] & 0x80) {
> +                               input_report_abs(input, ABS_WHEEL, (data[1] & 
> 0x7f));
> +                       } else {
> +                               /* Out of proximity, clear wheel value. */
> +                               input_report_abs(input, ABS_WHEEL, 0);
> +                       }
> +
> +                       if (data[2] & 0x80) {
> +                               input_report_abs(input, ABS_THROTTLE, 
> (data[2] & 0x7f));
> +                       } else {
> +                               /* Out of proximity, clear wheel value. */
> +                               input_report_abs(input, ABS_THROTTLE, 0);
> +                       }
> +
> +                       if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | 
> data[6] | data[8]) {
> +                               input_report_key(input, wacom->tool[1], 1);
> +                               input_report_abs(input, ABS_MISC, 
> PAD_DEVICE_ID);
> +                       } else {
> +                               input_report_key(input, wacom->tool[1], 0);
> +                               input_report_abs(input, ABS_MISC, 0);
> +                       }
>                } else {
>                        if (features->type == WACOM_21UX2) {
>                                input_report_key(input, BTN_0, (data[5] & 
> 0x01));
> @@ -1054,6 +1105,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
> len)
>        case CINTIQ:
>        case WACOM_BEE:
>        case WACOM_21UX2:
> 

[Linuxwacom-devel] [PATCH input-wacom 1/2] backport: add support for Cintiq 24HD

2012-03-28 Thread Jason Gerecke
Based on upstream commit 803296b678a43005e3bc0aaa1951d211bd76a054

Signed-off-by: Jason Gerecke 
---
 2.6.30/wacom_wac.c |   77 +++-
 2.6.30/wacom_wac.h |1 +
 2.6.36/wacom_wac.c |   77 +++-
 2.6.36/wacom_wac.h |1 +
 4 files changed, 154 insertions(+), 2 deletions(-)

diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
index bad56d3..46f306f 100755
--- a/2.6.30/wacom_wac.c
+++ b/2.6.30/wacom_wac.c
@@ -613,7 +613,8 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
/* general pen packet */
if ((data[1] & 0xb8) == 0xa0) {
t = (data[6] << 2) | ((data[7] >> 6) & 3);
-   if (features->type >= INTUOS4S && features->type <= WACOM_21UX2)
+   if ((features->type >= INTUOS4S && features->type <= 
WACOM_21UX2) ||
+   features->type == WACOM_24HD)
t = (t << 1) | (data[1] & 1);
input_report_abs(input, ABS_PRESSURE, t);
input_report_abs(input, ABS_TILT_X,
@@ -677,6 +678,56 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
input_report_abs(input, ABS_MISC, 
PAD_DEVICE_ID);
else
input_report_abs(input, ABS_MISC, 0);
+   } else if (features->type == WACOM_24HD) {
+   input_report_key(input, BTN_0, (data[6] & 0x01));
+   input_report_key(input, BTN_1, (data[6] & 0x02));
+   input_report_key(input, BTN_2, (data[6] & 0x04));
+   input_report_key(input, BTN_3, (data[6] & 0x08));
+   input_report_key(input, BTN_4, (data[6] & 0x10));
+   input_report_key(input, BTN_5, (data[6] & 0x20));
+   input_report_key(input, BTN_6, (data[6] & 0x40));
+   input_report_key(input, BTN_7, (data[6] & 0x80));
+   input_report_key(input, BTN_8, (data[8] & 0x01));
+   input_report_key(input, BTN_9, (data[8] & 0x02));
+   input_report_key(input, BTN_A, (data[8] & 0x04));
+   input_report_key(input, BTN_B, (data[8] & 0x08));
+   input_report_key(input, BTN_C, (data[8] & 0x10));
+   input_report_key(input, BTN_X, (data[8] & 0x20));
+   input_report_key(input, BTN_Y, (data[8] & 0x40));
+   input_report_key(input, BTN_Z, (data[8] & 0x80));
+
+   /*
+* Three "buttons" are available on the 24HD which are
+* physically implemented as a touchstrip. Each button
+* is approximately 3 bits wide with a 2 bit spacing.
+* The raw touchstrip bits are stored at:
+*((data[3] & 0x1f) << 8) | data[4])
+*/
+   input_report_key(input, KEY_PROG1, data[4] & 0x07);
+   input_report_key(input, KEY_PROG2, data[4] & 0xE0);
+   input_report_key(input, KEY_PROG3, data[3] & 0x1C);
+
+   if (data[1] & 0x80) {
+   input_report_abs(input, ABS_WHEEL, (data[1] & 
0x7f));
+   } else {
+   /* Out of proximity, clear wheel value. */
+   input_report_abs(input, ABS_WHEEL, 0);
+   }
+
+   if (data[2] & 0x80) {
+   input_report_abs(input, ABS_THROTTLE, (data[2] 
& 0x7f));
+   } else {
+   /* Out of proximity, clear wheel value. */
+   input_report_abs(input, ABS_THROTTLE, 0);
+   }
+
+   if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | 
data[6] | data[8]) {
+   input_report_key(input, wacom->tool[1], 1);
+   input_report_abs(input, ABS_MISC, 
PAD_DEVICE_ID);
+   } else {
+   input_report_key(input, wacom->tool[1], 0);
+   input_report_abs(input, ABS_MISC, 0);
+   }
} else {
if (features->type == WACOM_21UX2) {
input_report_key(input, BTN_0, (data[5] & 
0x01));
@@ -1054,6 +1105,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
case CINTIQ:
case WACOM_BEE:
case WACOM_21UX2:
+   case WACOM_24HD:
sync = wacom_intuos_irq(wacom_wac);
break;
 
@@ -1178,6 +1230,26 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
__set_bit(BTN_STYLUS2, input_dev->keybit);
break;
 
+