Bug 5151

Summary: Driver Mouse - Toshiba touchpad after kernel 2.6.11
Product: Drivers Reporter: Patrick (emptiness)
Component: Input DevicesAssignee: Dmitry Torokhov (dmitry.torokhov)
Status: CLOSED CODE_FIX    
Severity: high CC: dmitry.torokhov, vojtech
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.13 Subsystem:
Regression: --- Bisected commit-id:
Attachments: Laptop picture
Fix wheel reporting

Description Patrick 2005-08-29 18:32:55 UTC
Most recent kernel where this bug did not occur: 2.6.11
Distribution: Debian 3.1
Hardware Environment: Toshiba satellite 2410
Software Environment: KDE
Problem Description:

Since the kernel 2.6.12, i have a problem with my touchpad. In Kde, the menus
disappear. In thunderbird, if i go to my last message and that i use my
touchpad, it returns at the beginning.

But when i put these lines in comments, all is correct. But not the scroll.
(Option         "ZAxisMapping"          "4 5")

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "ImPS/2"
        #Option         "ZAxisMapping"          "4 5"
EndSection
Section "InputDevice"
        Identifier      "Generic Mouse"
        Driver          "mouse"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        #Option         "ZAxisMapping"          "4 5"
EndSection

In 2.6.11, it's ok.

Thanks,

Patrick
Comment 1 Vojtech Pavlik 2005-08-30 00:09:47 UTC
The xf86config/xorg.conf excerpt you added is clearly incorrect. You're not
supposed to use /dev/psaux and /dev/input/mice at the same time - they'll
supply you the _same_ data. This will result in every event happening twice,
causing doubleclicks and other mayhem.

Delete one of the sections OR change the driver to the 'synaptics' GPL driver.
It's possible Debian doesn't ship it, as it is not a part of X, but you can
find it on Google easily.
Comment 2 Patrick 2005-08-30 06:44:37 UTC
I use xserver-xfree86... XF86Config-4

With the kernel 2.6.11 and my two sections, all its ok. I only installed the
kernel 2.6.13.

I removed one of the section (Generic mouse) but nothing changes.

I will change my drivers........
Comment 3 Vojtech Pavlik 2005-08-30 06:52:31 UTC
I didn't notice you mentioning that commenting out ZAxisMapping helps.
There might be a problem in the kernel decoding the mouse data after all.

What does

      cat /proc/bus/input/devices

say?

Did you try running 'evtest'?
Comment 4 Patrick 2005-08-30 08:16:38 UTC
cat /proc/bus/input/devices

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
H: Handlers=kbd
B: EV=120013
B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7

I: Bus=0011 Vendor=0002 Product=0008 Version=0000
N: Name="PS/2 Mouse"
P: Phys=isa0060/serio1/input1
H: Handlers=mouse0
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=3

I: Bus=0011 Vendor=0002 Product=0008 Version=6324
N: Name="AlpsPS/2 ALPS GlidePoint"
P: Phys=isa0060/serio1/input0
H: Handlers=mouse1
B: EV=f
B: KEY=420 0 70000 0 0 0 0 0 0 0 0
B: REL=103
B: ABS=1000003

Did you try running 'evtest'?

No, i do not know it.

I installed it with the package: DVB-UTILS
http://packages.debian.org/testing/misc/dvb-utils

I tested:

evtest /dev/psaux
evtest: can't get version: Inappropriate ioctl for device
Comment 5 Vojtech Pavlik 2005-08-30 08:35:15 UTC
To use evtest, do:

modprobe evdev

evtest /dev/input/event0
evtest /dev/input/event1
evtest /dev/input/event2

And verify the mouse scrollwheel works correctly and that the touchpad does,
too.
Comment 6 Patrick 2005-08-30 09:36:33 UTC
ok

when i wheel:

if i wheel up, 

scroll up
Event: time 1125418857.010330, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.010342, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125418857.025923, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.025934, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125418857.294821, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.294831, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125418857.341836, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.341844, type 0 (Reset), code 0 (Reset), value 0

but if i wheel down,

scroll up
Event: time 1125419141.603488, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419141.603498, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419141.871168, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419141.871180, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419142.170949, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419142.170960, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.148597, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419143.148610, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.369900, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125419143.369908, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.385187, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125419143.385199, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.566468, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419143.566478, type 0 (Reset), code 0 (Reset), value 0



When i use the touchpad:

Scroll up
Event: time 1125419451.486772, type 1 (Key), code 330 (Touch), value 1
Event: time 1125419451.486775, type 3 (Absolute), code 0 (X), value 615
Event: time 1125419451.486775, type 3 (Absolute), code 1 (Y), value 489
Event: time 1125419451.486776, type 3 (Absolute), code 24 (Pressure), value 62
Event: time 1125419451.486777, type 1 (Key), code 325 (ToolFinger), value 1
Event: time 1125419451.486778, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.486787, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.502784, type 3 (Absolute), code 0 (X), value 611
Event: time 1125419451.502787, type 3 (Absolute), code 24 (Pressure), value 79
Event: time 1125419451.502788, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.502798, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.518456, type 3 (Absolute), code 0 (X), value 605
Event: time 1125419451.518458, type 3 (Absolute), code 1 (Y), value 488
Event: time 1125419451.518459, type 3 (Absolute), code 24 (Pressure), value 74
Event: time 1125419451.518460, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.518467, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.534090, type 3 (Absolute), code 0 (X), value 599
Event: time 1125419451.534092, type 3 (Absolute), code 1 (Y), value 487
Event: time 1125419451.534093, type 3 (Absolute), code 24 (Pressure), value 78
Event: time 1125419451.534094, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.534104, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.550109, type 3 (Absolute), code 0 (X), value 594
Event: time 1125419451.550112, type 3 (Absolute), code 24 (Pressure), value 79
Event: time 1125419451.550113, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.550121, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.565825, type 3 (Absolute), code 0 (X), value 591
Event: time 1125419451.565827, type 3 (Absolute), code 1 (Y), value 483
Event: time 1125419451.565827, type 3 (Absolute), code 24 (Pressure), value 76
Event: time 1125419451.565828, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.565834, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.581441, type 3 (Absolute), code 0 (X), value 588
Event: time 1125419451.581444, type 3 (Absolute), code 24 (Pressure), value 80
Event: time 1125419451.581445, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.581454, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.597114, type 3 (Absolute), code 0 (X), value 586
Event: time 1125419451.597116, type 3 (Absolute), code 1 (Y), value 482
Event: time 1125419451.597116, type 3 (Absolute), code 24 (Pressure), value 74
Event: time 1125419451.597118, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.597123, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.613134, type 3 (Absolute), code 0 (X), value 584
Event: time 1125419451.613136, type 3 (Absolute), code 1 (Y), value 479
Event: time 1125419451.613136, type 3 (Absolute), code 24 (Pressure), value 75
Event: time 1125419451.613137, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.613147, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.629070, type 3 (Absolute), code 0 (X), value 582
Event: time 1125419451.629072, type 3 (Absolute), code 1 (Y), value 478
Event: time 1125419451.629073, type 3 (Absolute), code 24 (Pressure), value 79
Event: time 1125419451.629074, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.629083, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.644557, type 3 (Absolute), code 0 (X), value 580
Event: time 1125419451.644559, type 3 (Absolute), code 1 (Y), value 476
Event: time 1125419451.644560, type 3 (Absolute), code 24 (Pressure), value 78
Event: time 1125419451.644561, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.644571, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.660283, type 3 (Absolute), code 0 (X), value 579
Event: time 1125419451.660285, type 3 (Absolute), code 1 (Y), value 475
Event: time 1125419451.660286, type 3 (Absolute), code 24 (Pressure), value 77
Event: time 1125419451.660287, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.660297, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.676756, type 3 (Absolute), code 0 (X), value 578
Event: time 1125419451.676758, type 3 (Absolute), code 1 (Y), value 473
Event: time 1125419451.676759, type 3 (Absolute), code 24 (Pressure), value 78
Event: time 1125419451.676760, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.676770, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.692000, type 3 (Absolute), code 0 (X), value 577
Event: time 1125419451.692002, type 3 (Absolute), code 1 (Y), value 472
Event: time 1125419451.692003, type 3 (Absolute), code 24 (Pressure), value 74
Event: time 1125419451.692004, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.692014, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.707700, type 3 (Absolute), code 1 (Y), value 471
Event: time 1125419451.707702, type 3 (Absolute), code 24 (Pressure), value 69
Event: time 1125419451.707703, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.707712, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419451.802243, type 1 (Key), code 330 (Touch), value 0
Event: time 1125419451.802246, type 3 (Absolute), code 24 (Pressure), value 0
Event: time 1125419451.802247, type 1 (Key), code 325 (ToolFinger), value 0
Event: time 1125419451.802248, type 2 (Relative), code 8 (Wheel), value 8
Event: time 1125419451.802255, type 0 (Reset), code 0 (Reset), value 0

it scroll up all the time
Comment 7 Vojtech Pavlik 2005-08-30 09:52:06 UTC
Great, so that's the cause of the problem. The touchpad emits scroll data,
even when it's not supposed to.

The problem is that a Toshiba satellite 2400 had the same touchpad (at least
reporting the same version) built-in, but that included a scrollwheel. Your
doesn't.

Please edit linux/drivers/input/mouse/alps.c and remove ALPS_WHEEL from line
46, replacing it with 0. It should help.

Dmitry, we'll have to go for a DMI-based probing in the ALPS driver probably,
after all.
Comment 8 Dmitry Torokhov 2005-08-30 11:08:09 UTC
I am not sure if it is practical - there are nmyriads of boxes using ALPS 
topuchpads and it seems there are unlimited number of its permutations :(

I wonder if we check the first data packet after we detect "wheeled" touchpad 
and see that it reports wheel dtata we should just reset that flag... Not the 
best solution but I think it would work quite reliably in this case. We can 
even try polling the touchpad so we wont get real motion data packet but most 
likely "zero" one.
 
Comment 9 Patrick 2005-08-30 11:13:32 UTC

Please edit linux/drivers/input/mouse/alps.c and remove ALPS_WHEEL from line
46, replacing it with 0. It should help.


Its ok but my scrollwheel not function.
Comment 10 Vojtech Pavlik 2005-08-30 11:24:48 UTC
What scrollwheel? On your external mouse? Did you put the ZAxisMapping back
in?
Comment 11 Dmitry Torokhov 2005-08-30 11:27:03 UTC
Do you have a scrollwheen on your touchpad too?
Comment 12 Patrick 2005-08-30 11:34:38 UTC
On my touchpad, i have a scrollwheel and my ZAxisMapping is ok.

Comment #6:
when i wheel:

if i wheel up, 

scroll up
Event: time 1125418857.010330, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.010342, type 0 (Reset), code 0 (Reset), value 0
Comment 13 Patrick 2005-08-30 11:44:15 UTC
Created attachment 5818 [details]
Laptop picture
Comment 14 Dmitry Torokhov 2005-08-30 11:54:12 UTC
Created attachment 5819 [details]
Fix wheel reporting

Could you please try this patch?
Comment 15 Patrick 2005-08-30 13:00:31 UTC
I have a error

  CC [M]  drivers/input/mouse/alps.o
drivers/input/mouse/alps.c: In function 'alps_process_packet':
drivers/input/mouse/alps.c:173: error: syntax error before 'input_report_rel'
make[3]: *** [drivers/input/mouse/alps.o] Erreur 1
make[2]: *** [drivers/input/mouse] Erreur 2
make[1]: *** [drivers/input] Erreur 2
make: *** [drivers] Erreur 2


????
Index: linux-2.6.12/drivers/input/mouse/alps.c
===================================================================
--- linux-2.6.12.orig/drivers/input/mouse/alps.c
+++ linux-2.6.12/drivers/input/mouse/alps.c

I have the 2.6.13
Comment 16 Patrick 2005-08-30 13:38:03 UTC
i have to add ")", "{" and "}".
My kernel compiled.

When i use scrollwheel with evtest:

Event: time 1125434266.456405, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125434266.456417, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434266.503818, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125434266.503829, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434267.859858, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434267.859865, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434267.892071, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434267.892083, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434268.127608, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434268.127615, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434268.143207, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434268.143218, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434269.073482, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125434269.073494, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434269.168323, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125434269.168334, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434269.437467, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125434269.437477, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434269.452047, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125434269.452057, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434269.960327, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434269.960340, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434269.980464, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434269.980475, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434270.224082, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434270.224092, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125434270.239740, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125434270.239750, type 0 (Reset), code 0 (Reset), value 0

It scroll up only.
Comment 17 Dmitry Torokhov 2005-08-30 13:58:50 UTC
Just to make sure, you code looks like this, right?

        if ((priv->i->flags & ALPS_WHEEL) && (packet[0] & 0x70))
                input_report_rel(dev, REL_WHEEL, ((packet[0] >> 4) & 0x07) | 
((packet[2] >> 2) & 0x08));

What does evtest show when you use touchpad's scroll wheel on an unpatched 
kernel?
Comment 18 Patrick 2005-08-30 14:32:59 UTC
ok

me i have to add: {}

        if ((priv->i->flags & ALPS_WHEEL) && (packet[0] & 0x70)){
                input_report_rel(dev, REL_WHEEL, ((packet[0] >> 4) & 0x07) | 
((packet[2] >> 2) & 0x08));
}

Unpatched kernel:

if i wheel up, 

scroll up
Event: time 1125418857.010330, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.010342, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125418857.025923, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.025934, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125418857.294821, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.294831, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125418857.341836, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125418857.341844, type 0 (Reset), code 0 (Reset), value 0

but if i wheel down,

scroll up
Event: time 1125419141.603488, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419141.603498, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419141.871168, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419141.871180, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419142.170949, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419142.170960, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.148597, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419143.148610, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.369900, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125419143.369908, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.385187, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125419143.385199, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125419143.566468, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125419143.566478, type 0 (Reset), code 0 (Reset), value 0
Comment 19 Dmitry Torokhov 2005-08-30 14:50:24 UTC
Does it work any better if you change input_report_rel like this:

        input_report_rel(dev, REL_WHEEL,
              ((packet[2] >> 2) & 0x08) - ((packet[0] >> 4) & 0x07));
Comment 20 Patrick 2005-08-30 17:40:22 UTC
Scroll up only or some time scroll down only

When i scroll up:

Input driver version is 1.0.0
Input device ID: bus 0x11 vendor 0x2 product 0x8 version 0x6324
Input device name: "AlpsPS/2 ALPS GlidePoint"
Supported events:
  Event type 0 (Reset)
    Event code 0 (Reset)
    Event code 1 (Key)
    Event code 2 (Relative)
    Event code 3 (Absolute)
  Event type 1 (Key)
    Event code 272 (LeftBtn)
    Event code 273 (RightBtn)
    Event code 274 (MiddleBtn)
    Event code 325 (ToolFinger)
    Event code 330 (Touch)
  Event type 2 (Relative)
    Event code 0 (X)
    Event code 1 (Y)
    Event code 8 (Wheel)
  Event type 3 (Absolute)
    Event code 0 (X)
      Value    701
      Min        0
      Max     1023
    Event code 1 (Y)
      Value    395
      Min        0
      Max      767
    Event code 24 (Pressure)
      Value      0
      Min        0
      Max      127
Testing ... (interrupt to exit)
Event: time 1125448548.395004, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.395017, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.410747, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.410760, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.521180, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.521190, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.552612, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.552621, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.647228, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.647239, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.678749, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.678757, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.789098, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.789109, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.836224, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.836232, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448548.963201, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448548.963211, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448549.025447, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448549.025458, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.380550, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.380562, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.398119, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.398131, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.475438, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.475447, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.523269, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.523282, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.632917, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.632925, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.680441, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.680452, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.822578, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.822590, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448550.869658, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125448550.869666, type 0 (Reset), code 0 (Reset), value 0


When i scroll down:

Input driver version is 1.0.0
Input device ID: bus 0x11 vendor 0x2 product 0x8 version 0x6324
Input device name: "AlpsPS/2 ALPS GlidePoint"
Supported events:
  Event type 0 (Reset)
    Event code 0 (Reset)
    Event code 1 (Key)
    Event code 2 (Relative)
    Event code 3 (Absolute)
  Event type 1 (Key)
    Event code 272 (LeftBtn)
    Event code 273 (RightBtn)
    Event code 274 (MiddleBtn)
    Event code 325 (ToolFinger)
    Event code 330 (Touch)
  Event type 2 (Relative)
    Event code 0 (X)
    Event code 1 (Y)
    Event code 8 (Wheel)
  Event type 3 (Absolute)
    Event code 0 (X)
      Value    610
      Min        0
      Max     1023
    Event code 1 (Y)
      Value    402
      Min        0
      Max      767
    Event code 24 (Pressure)
      Value      0
      Min        0
      Max      127
Testing ... (interrupt to exit)
Event: time 1125448651.128498, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125448651.128510, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448651.145880, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125448651.145901, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448651.317806, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125448651.317817, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448651.333520, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125448651.333538, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448652.169298, type 2 (Relative), code 8 (Wheel), value 6
Event: time 1125448652.169310, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448652.437195, type 2 (Relative), code 8 (Wheel), value 6
Event: time 1125448652.437207, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448652.595313, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125448652.595321, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125448652.673605, type 2 (Relative), code 8 (Wheel), value 7
Event: time 1125448652.673616, type 0 (Reset), code 0 (Reset), value 0
Comment 21 Vojtech Pavlik 2005-08-30 17:52:06 UTC
The real fix should likely be

input_report_rel(dev, REL_WHEEL,
              ((packet[2] >> 4) & 0x04) - ((packet[0] >> 4) & 0x03));
Comment 22 Vojtech Pavlik 2005-08-30 17:54:44 UTC
Oops, I meant

input_report_rel(dev, REL_WHEEL,
              ((packet[2] >> 4) & 0x04) - ((packet[0] >> 4) & 0x03));
Comment 23 Vojtech Pavlik 2005-08-30 17:55:45 UTC
Damn a typo again. This is it.

input_report_rel(dev, REL_WHEEL,
              ((packet[0] >> 4) & 0x04) - ((packet[0] >> 4) & 0x03));
Comment 24 Patrick 2005-08-30 18:40:51 UTC
Its ok!!!

A <b>big big</b> thanks to you, Dmitry and Vojtech.

The changes:

        if ((priv->i->flags & ALPS_WHEEL) && (packet[0] & 0x70)){
                input_report_rel(dev, REL_WHEEL, ((packet[0] >> 4) & 0x04) -
((packet[0] >> 4) & 0x03));
        }
        if (priv->i->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) {


*** Linux forever ***
Patrick
Comment 25 Dmitry Torokhov 2005-08-30 20:08:54 UTC
Does it still work if you drop "&& (packet[0] & 0x70)" part of condition? It 
does not look right given Vojtech's suggestion. 
Comment 26 Vojtech Pavlik 2005-08-30 23:31:53 UTC
And please also verify that when moving very fast up it doesn't start scrolling
down or vice versa. We've changed the scrollwheel data from 4 to 3 bits, and
thus it theoretically could overflow, if it's 4 bits in reality.
Comment 27 Patrick 2005-08-31 06:04:16 UTC
When i scroll up very fast, it scroll down.

When i scroll down very fast, it scroll up.
Comment 28 Vojtech Pavlik 2005-08-31 06:19:55 UTC
Then it's really 4-bit and we need to find out the 4th bit.
Comment 29 Vojtech Pavlik 2005-08-31 06:23:25 UTC
I'm a fool. The right (4-bit) entry should obviously be

input_report_rel(dev, REL_WHEEL,
    ((packet[0] >> 4) & 0x07) - ((packet[2] << 1) & 0x08));
Comment 30 Patrick 2005-08-31 06:30:17 UTC
ok Vojtech, i check...

Dmitry, if I drop "&& (packet[0] & 0x70)", Its ok!!!!
Comment 31 Vojtech Pavlik 2005-08-31 06:37:56 UTC
Alright, please use that fix for now, the next kernel shall have it, too.
Comment 32 Vojtech Pavlik 2005-08-31 06:38:14 UTC
-> Resolved
Comment 33 Patrick 2005-08-31 06:52:56 UTC
When i scroll up, it scroll down
When i scroll down, it scroll up.

its to reverse.
Comment 34 Vojtech Pavlik 2005-08-31 07:00:35 UTC
I guess I have my bad day.

This should work then:

input_report_rel(dev, REL_WHEEL,
    ((packet[2] << 1) & 0x08)) - ((packet[0] >> 4) & 0x07);
Comment 35 Vojtech Pavlik 2005-08-31 07:04:05 UTC
And one more fix:

input_report_rel(dev, REL_WHEEL,
    ((packet[2] << 1) & 0x08) - ((packet[0] >> 4) & 0x07));
Comment 36 Patrick 2005-08-31 09:06:13 UTC
Scroll up = Ok
Scroll down = Ok

Scroll down fast = Ok
Scroll up fast = A small scroll down
Comment 37 Vojtech Pavlik 2005-08-31 09:09:48 UTC
Can you log the fast scroll down with evtest? Thanks.
Comment 38 Vojtech Pavlik 2005-08-31 09:10:12 UTC
Err, fast scroll up, resulting in small scroll down.
Comment 39 Patrick 2005-08-31 10:11:23 UTC
Event: time 1125508289.648875, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508289.648885, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.664537, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508289.664547, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.680252, type 2 (Relative), code 8 (Wheel), value 3
Event: time 1125508289.680256, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.695974, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508289.695983, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.711961, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508289.711967, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.917166, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508289.917175, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.932647, type 2 (Relative), code 8 (Wheel), value 3
Event: time 1125508289.932658, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.948261, type 2 (Relative), code 8 (Wheel), value 4
Event: time 1125508289.948269, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.963922, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508289.963930, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508289.979882, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508289.979893, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.153530, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508290.153540, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.170032, type 2 (Relative), code 8 (Wheel), value 3
Event: time 1125508290.170044, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.184908, type 2 (Relative), code 8 (Wheel), value 3
Event: time 1125508290.184916, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.200567, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508290.200576, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.216552, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508290.216564, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.232272, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508290.232283, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.279671, type 2 (Relative), code 8 (Wheel), value -1
Event: time 1125508290.279682, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.405426, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508290.405436, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.421974, type 2 (Relative), code 8 (Wheel), value 4
Event: time 1125508290.421985, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.437305, type 2 (Relative), code 8 (Wheel), value 3
Event: time 1125508290.437313, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.453360, type 2 (Relative), code 8 (Wheel), value 3
Event: time 1125508290.453372, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.469430, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508290.469441, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.484562, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508290.484572, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508290.516464, type 2 (Relative), code 8 (Wheel), value -1
Event: time 1125508290.516472, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.793301, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508291.793312, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.809132, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508291.809142, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.824754, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508291.824757, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.840369, type 2 (Relative), code 8 (Wheel), value 2
Event: time 1125508291.840381, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.856399, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508291.856406, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.872213, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508291.872223, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.887904, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508291.887915, type 0 (Reset), code 0 (Reset), value 0
Event: time 1125508291.920365, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1125508291.920373, type 0 (Reset), code 0 (Reset), value 0
Comment 40 Dmitry Torokhov 2005-12-21 07:34:19 UTC
Patrick,

2.6.14 was released with the fix. Could you please confirm that the stock 
kernel works for you and if so close the bug?

Thanks!
Comment 41 Patrick 2005-12-21 14:37:30 UTC
yes,
it's ok!!!

Thanks