On Tuesday 25 July 2006 00:50, Pete Zaitcev wrote:
> Hi, Dmitry:
>

Hi Pete,

> When we pushed a 2.6.17 rebase for Fedora, one of my users complained that
> the wheel on this Wacom reversed the direction. Do you know anything
> about it? The patch has some suspicious parts:
>
> --- linux-2.6.16-1.2122_FC5/drivers/usb/input/wacom.c 2006-03-19 
> 21:53:29.000000000 -0800
> +++ linux-2.6.17-1.2139_FC5/drivers/usb/input/wacom.c 2006-06-17 
> 18:49:35.000000000 -0700
> @@ -374,10 +397,10 @@ static void wacom_graphire_irq(struct ur
>                       case 2: /* Mouse with wheel */
>                               input_report_key(dev, BTN_MIDDLE, data[1] & 
> 0x04);
>                               if (wacom->features->type == WACOM_G4) {
> -                                     rw = data[7] & 0x04 ? -(data[7] & 0x03) 
> : (data[7] & 0x03);
> -                                     input_report_rel(dev, REL_WHEEL, rw);
> +                                     rw = data[7] & 0x04 ? (data[7] & 
> 0x03)-4 : (data[7] & 0x03);
> +                                     input_report_rel(dev, REL_WHEEL, -rw);
>                               } else
> -                                     input_report_rel(dev, REL_WHEEL, 
> (signed char) data[6]);
> +                                     input_report_rel(dev, REL_WHEEL, 
> -(signed char) data[6]);

This change does indeed look suspicious, we used to report wheel without
negation pretty much since dawn of times and I am not sure why it was
changed. I am CCing Ping Cheng - he should know why this change was
necessary.

>                               /* fall through */
>  
>                       case 3: /* Mouse without wheel */
> @@ -406,39 +429,27 @@ static void wacom_graphire_irq(struct ur
>               }
>       }
>  
> -     input_report_key(dev, wacom->tool[0], (data[1] & 0x10) ? id : 0);
> +     if (data[1] & 0x10)
> +             input_report_abs(dev, ABS_MISC, id); /* report tool id */
> +     else
> +             input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
> +     input_report_key(dev, wacom->tool[0], data[1] & 0x10);
>       input_sync(dev);
>  
>       /* send pad data */
>       if (wacom->features->type == WACOM_G4) {
> -             /* fist time sending pad data */
> -             if (wacom->tool[1] != BTN_TOOL_FINGER) {
> -                     wacom->id[1] = 0;
> -                     wacom->serial[1] = (data[7] & 0x38) >> 2;
> -             }
> -             if (data[7] & 0xf8) {
> +             if ((wacom->serial[1] & 0xc0) != (data[7] & 0xf8)) {
> +                     wacom->id[1] = 1;
> +                     wacom->serial[1] = (data[7] & 0xf8);
>                       input_report_key(dev, BTN_0, (data[7] & 0x40));
>                       input_report_key(dev, BTN_4, (data[7] & 0x80));
> -                     if (((data[7] & 0x38) >> 2) == (wacom->serial[1] & 
> 0x0e))
> -                             /* alter REL_WHEEL value so X apps can get it */
> -                             wacom->serial[1] += (wacom->serial[1] & 0x01) ? 
> -1 : 1;
> -                     else
> -                              wacom->serial[1] = (data[7] & 0x38 ) >> 2;
> -
> -                     /* don't alter the value when there is no wheel event */
> -                     if (wacom->serial[1] == 1)
> -                             wacom->serial[1] = 0;
> -                     rw = wacom->serial[1];
> -                     rw = (rw & 0x08) ? -(rw & 0x07) : (rw & 0x07);
> +                     rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
>                       input_report_rel(dev, REL_WHEEL, rw);
> -                     wacom->tool[1] = BTN_TOOL_FINGER;
> -                     wacom->id[1] = data[7] & 0xf8;
> -                     input_report_key(dev, wacom->tool[1], 0xf0);
> +                     input_report_key(dev, BTN_TOOL_FINGER, 0xf0);
>                       input_event(dev, EV_MSC, MSC_SERIAL, 0xf0);
>               } else if (wacom->id[1]) {
>                       wacom->id[1] = 0;
> -                     wacom->serial[1] = 0;
> -                     input_report_key(dev, wacom->tool[1], 0);
> +                     input_report_key(dev, BTN_TOOL_FINGER, 0);
>                       input_event(dev, EV_MSC, MSC_SERIAL, 0xf0);
>               }
>               input_sync(dev);
> 
> We change the userland as well, but the bug submitter narrowed it
> down to the kernel.
> 
> Here's the bug:
>  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196565
> 
> The bug also mentions a regression with Volito, which seems unrelated.
> However, the code contains changes affecting Volito specifically.
> 
> -- Pete
> 

-- 
Dmitry

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to