# [HOWTO] Having a ALPS touchpad working under X & kernel

## X-Ryl669

If you're here, is that you already know that ALPS touchpad are not well detected, nor used by current linux version. Either they will be detected as ImPS/2 or synaptics (for lucky ones), but then, not all will work under X. Worse, those with "wheel button" are chaotic.

  I've found a patch from Dmitry Torokhov, which applys to 2.6.4 kernel, but still contains some few bugs (as not detecting my touchpad  :Wink:  )

  So, here is a guide to patch a 2.6.7-rc2 kernel (for example last love-sources).

Step 1: Downloading the patch

Type (linux should points to your 2.6.7-rc2 kernel):  

 :Arrow:  cd /usr/src/linux

 :Arrow:  wget http://gufie.free.fr/ALPS/alps.tar.bz2

Step 2 : Decompressing the archive and patching the kernel 

Then type:

 :Arrow:  tar -jxvf alps.tar.bz2

 :Arrow:  cat alps_2.6.7-rc2.patch | patch -p 1

 Step 3 : Rebuild your kernel 

Choose your preferred method.

 Step 4 : Reboot and check your touchpad is detected 

So, reboot, and once your new kernel is loaded, type:

 :Arrow:  cat /var/log/message | grep ALPS

If everything worked correctly your touchpad is detected, and you should have something like this :

```
Jun  3 16:40:10 Elephant input: AlpsPS/2 ALPS TouchPad on isa0060/serio4 
```

IF NOT, then (like my first try), please type this command and give me back the output:

 :Arrow:  cat /var/log/message | grep alps

 Step 5 : Then emerge last synaptics driver 

 :Arrow:  ACCEPT_KEYWORDS="~x86" emerge synaptics

(must be >= 0.13.1 version)

 Step 6 : Modify your XF86Config-4 or XF86Config depending of your config 

Here is an extract of mine :

Load synaptics module on X startup (add to your exisiting module section)

```

Section "Module"

     Load "synaptics"

EndSection

```

Change your core pointer section 

```

# **********************************************************************

# Core Pointer's InputDevice section

# **********************************************************************

# Identifier and driver

Section "InputDevice"

  Driver        "synaptics"

  Identifier    "TouchPad"

  Option        "Device"        "/dev/input/event1"

  Option        "Protocol"      "event"

  Option        "LeftEdge"             "60"

  Option        "RightEdge"            "830"

  Option        "TopEdge"              "70"

  Option        "BottomEdge"           "650"

  Option        "FingerLow"            "25"

  Option        "FingerHigh"           "30"

  Option        "MaxTapTime"           "180"

  Option        "MaxTapMove"           "110"

  Option    "EmulateMidButtonTime" "75"

  Option        "VertScrollDelta"      "50"

  Option        "HorizScrollDelta"     "50"

  Option        "MinSpeed"             "0.2"

  Option        "MaxSpeed"             "0.5"

  Option        "AccelFactor"          "0.01"

  Option    "EdgeMotionSpeed"      "40"

  Option    "UpDownScrolling"      "1"

  Option    "TouchpadOff"          "0"

  Option        "SHMConfig"            "on"

#  Option       "Repeater"      "/dev/ps2mouse"

EndSection

```

 Make sure your declared the new input in the server layout section 

```

Section "ServerLayout"

# The Identifier line must be present

    Identifier  "Server Layout"

# Each Screen line specifies a Screen section name, and optionally

# the relative position of other screens.  The four names after

# primary screen name are the screens to the top, bottom, left and right

# of the primary screen.

    Screen "Screen0"

# Each InputDevice line specifies an InputDevice section name and

# optionally some options to specify the way the device is to be

# used.  Those options include "CorePointer", "CoreKeyboard" and

# "SendCoreEvents".

    InputDevice "Keyboard1" "CoreKeyboard"

    InputDevice "TouchPad" "CorePointer"

EndSection

```

This should gives you a working ALPS touchpad. Enjoy

 Know bugs and work around : 

   Because ALPS touchpad hides behind synaptic identification, it is quite hard to detect all of them, so maybe your touchpad is not correctly detected (please post its identification here).

    (step4) dmesg didn't gives you any ALPS or alps message ?

   Be sure you've enable evdev in kernel, and psmouse (under Device Driver, Input Device, switch on Event interface and PS2 mouse)

    (step4) dmesg only gives you alps message like : alps.c : E6 report ?

   This was my bug, so, please post your E6 report here, so I can modify the alps.c file.

  If you feel aventurous, simply modify the alps.c file in /usr/src/linux/drivers/input/mouse, at the line 132 from

```

if (param[0] != 0x00 || param[1] != 0x00 || (param[2] != 0x0a && param[2] != 0x64))

```

to (given E6 report : AA BB CC)

```

if (param[0] != 0xAA || param[1] != 0xBB || (param[2] != 0x0a && param[2] != 0xCC))

```

   Rebuild, then post a message here so that I will modify the file too to maintain this patch.

   You should now have E7 report (but still no AlpsTouchPad detected), do the same thing with the line 150. Voila, your ALPS touchpad is now detected !

----------

## servo888

Hey,

I'm not getting ALP's touch pad in dmesg; just "mice: PS/2 mouse device common for all mice"

I've patched the 2.6.6 kernel with alps.patch; enabled all the approperate kernel options, compiled, installed, and rebooted, and still don't get anything.

```

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 event0

B: EV=120003

B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe

B: LED=7

```

```

cat /proc/bus/input/handlers

N: Number=0 Name=kbd

N: Number=1 Name=mousedev Minor=32

N: Number=2 Name=evdev Minor=64

N: Number=3 Name=tsdev Minor=128

```

any ideas?

----------

## federico

I could not use your patch set successfully on gentoo dev kernel 2.6.5-r1 so I used the normal patch that you can find in the synaptics driver dir (called alps.patch)

Patched my kernel, activated event and ps/2 but after compiling and rebooting I have two problem.

The first is that my logs ignore an alps existence, no alps are detected, the second is that my touchpad under the shell or under X is not usable, or better... I can move it but I have no control on it (it continiously come back to the previous point)

Fede

----------

## X-Ryl669

federico: 

My patch is against 2.6.7_rc2 so, it will not work against older kernel versions.

I had a patch against 2.6.5 (in fact I've modified the source tree) but I removed it last week.

If you apply the alps.patch from the synaptic driver, (this patch is bugged), you will have to :

   1) Open /usr/src/linux/drivers/input/mouse/psmouse-base.c in your favorite editor

        look for alps_detect, you will be to this line :

```

/*

 * Try ALPS TouchPad

 */

       if (max_proto > PSMOUSE_PS2 && alps_detect(psmouse)) {

               if (set_properties) {

                       psmouse->vendor = "ALPS";

                       psmouse->name = "TouchPad";

               }

               if (max_proto > PSMOUSE_IMEX)

                       if (alps_detect(psmouse) == 0)

                               return PSMOUSE_ALPS;

```

and change to 

```

/*

 * Try ALPS TouchPad

 */

       if (max_proto > PSMOUSE_PS2 && alps_detect(psmouse)) {

               if (set_properties) {

                       psmouse->vendor = "ALPS";

                       psmouse->name = "TouchPad";

               }

               if (max_proto > PSMOUSE_IMEX)

                       if (alps_init(psmouse) == 0)

                               return PSMOUSE_ALPS;

```

 (the second alps_detect is a bug)

Now you should have your E6 and E7 report in your dmesg... (then follow this how to)

 In the new 2.6.7-rc3 kernel code, alps should be detected 

----------

## X-Ryl669

servo888 : 

   Did you use my patch, or the patch from synaptic driver ?

(If it is the synaptic alps.patch, follow my previous answer too)

   Else, you will be entering the kernel debugging world, aka, inserting printk in stategic places in psmouse-base.c to see why your touchpad doesn't detect correctly.

But please, answer my question before I get deeper in details.

----------

## federico

First, thanks for reply  :Smile: 

I can't modify the patch as you say because it seems like I have not those lines, it's strange..

Look :

```

altair src # cp alps.patch linux

altair src # cd linux

altair linux # patch -p1 < alps.patch 

patching file drivers/input/mouse/Makefile

patching file drivers/input/mouse/alps.c

patching file drivers/input/mouse/alps.h

patching file drivers/input/mouse/psmouse-base.c

patching file drivers/input/mouse/psmouse.h

altair linux # grep -i alps drivers/input/mouse/psmouse-base.c

#include "alps.h"

       !ALPS_process_byte(psmouse, regs))

      ALPS_initialize(psmouse);

altair linux # 

```

Any idea?

----------

## X-Ryl669

I haven't downloaded the latest synaptic driver, so maybe the patch is not the same as I was thinking about. So, try with mine (link above). 

If my patch doesn't apply, I will try to download the one from the synaptic driver and apply it. Let me know about with one you downloaded (URL please, and version).

I hope it will help

----------

## federico

I will search for another kernel because your patch doen't apply to my 2.6.5 gentoo...

I used the alps.patch from the latest synaptic, 0.13.2 ones

----------

## X-Ryl669

The patch from the latest synaptic driver is not good (as it doesn't detect ALPS devices correctly). Could you output the result of your patch reject files when applying my patch ?

Or else, try the latest kernel, it should work.

----------

## federico

Got my mouse working with synaptics features for the first time!

I used your patch on love-sources!

Cool!

Now I have to understand how to configure it but I will do some experiment   :Wink: 

I hope this patch will be included in the next kernels !

----------

## X-Drum

hello!

i have an acer Aspire 1623Lim i tried your patch (great thing!) with many kernels (love sources-2.6.7-r3 ,2.6.7-vanilla, etc) but the result it's the same:

no alps detected and no alps messages in dmesg....

i have both ps/2 mouse support and event interdace support in my kernel config...

Maybe this touchpad is synaptics (Winsux XP's driver reports only this )

what i can do???

ah...another strange question: why 2.4.x series kernels (e.g gentoo livecd 2004.1 or last Knoppix) are able to configure my touchpad?   :Shocked: 

----------

## Gorth

I'm trying with gentoo-dev-sources 2.6.7-r5 and having no luck.  Troubles getting the patched you linked to apply cleanly, and the alps.patch with synaptics 13.3 was not detecting it either.

/dev/input/event0 shows up, and when I cat it, it responds as the touchpad.

I did have it working in 2.6.4 with synaptics 12.4 and that was fine.

I started working at the upgrade to try the latest swsusp2 patches, so those are in this kernel too.

XFree seems to see the device, but it loses sync.  Any thoughts?

----------

## X-Drum

ok,solved!

i use the last love sources (love-sources-2.6.7-r3) without the patch and now it works,

but i build psmouse outside the kernel image (module)....

if i build the driver inside the kernel image the synaptics doesn't work

----------

## X-Ryl669

It's now included in 2.6.7 kernel releases.

So... Upgrade.

----------

## count_zero

Does anybody know if this will work with the Dell Inspiron 8200 alps touchpad?  I've tried the synaptics driver in the past resulting in not being able to move the cursor in X, though the buttons still worked.  Something about the touchpad not going into absolute mode.  Anyone have any success with this model?

----------

## Gorth

Nope.  There are two different parts.  I've got an alps pad.  The kernel still needs the alps.patch from the synaptics drivers (So says Dmitry).  I'm still wandering around with a freshly broken touchpad it appears...

----------

