Jump to content

Elan Touchpad Driver


80 posts in this topic

Recommended Posts

Latest

There is another work on the same topic in tonymacx86, http://www.tonymacx8...er-mac-osx.html

I will have a try tonight or later.

Note: they released kexts for Lion and Mountain Lion, source code in https://github.com/EMlyDinEsHMG/ElanTouchpad-Driver/

 

Status

Just started, very beginning(yes, I mean not much functions work by now).

For V3, single finger movement and taptoclick should work.

It's a development thread for now, not for final end users!

If you want to help this topic, please join!

 

Target

This thread is focused on Elan touchpad(at least for ASUS laptops), not for others.

 

Code

Code Base: https://github.com/AppleLife/VoodooPS2

(Thanks Slice, THe KiNG, AndyV and all people who contributed to VoodooPS2)

Relative talk: http://www.projectos...?showtopic=1937

 

My repo: https://github.com/liangqi/VoodooPS2/

My change: https://github.com/l...21f16bd0dd3e1a5

Note: this change will allow people to build code on 10.7 + Xcode 4.4 and 10.8 + Xcode 4.4, but I only tested the VoodooPS2ElanTrackpad.kext on 10.8. Need someone to verify whether it works on 10.7 or not.

 

Reference

Elan linux driver:

Documentation:

elantech.txt http://git.kernel.or...ech.txt;hb=HEAD

event-codes.txt http://git.kernel.or...des.txt;hb=HEAD

 

Source code:

elantech.h http://git.kernel.or...ntech.h;hb=HEAD

elantech.c http://git.kernel.or...ntech.c;hb=HEAD

input.h http://git.kernel.or...input.h;hb=HEAD

 

Elan freebsd driver: freebsd.zip, got from akbar102

check attachment now, will update as links when I found

 

By now, I think linux driver is better than freebsd one.

 

Environment

My work env: 10.8.1 + Xcode 4.4.1 / 10.7.4 + Xcode 4.4

My test env: 10.8.1 + Xcode 4.4.1

Laptop: ASUS A43SV/K43SV

 

Finished

please check the commit msg in above link of "My change".

 

Todo

1. at least by now, we found Apple hasn't released any api for multitouch device, you could find this, /System/Library/PrivateFrameworks/MultitouchSupport.framework/

2. then what we could do for now, only provide functions which are in IOHIPointing, you can consider it is a mouse device. I will try 2 fingers taptoclick for right button click, and 2 fingers scroll for h/v scroll

3. we should use the settings in System Preferences/TrackPad, at least the "Tracking Speed"

4. And I think current one is "very" unstable, not sure about the reason....

 

Attachments

1. AppleACPIPS2Nub.kext.zip

2. ApplePS2Controller.kext.zip

3. ApplePS2Controller-10.7build.kext.zip - build on 10.7 + Xcode 4.4(build with f14d012285e1e1218187f16ff21ddc462219294b)

4. ApplePS2Controller-10.8build.kext.zip - build on 10.8 + Xcode 4.4(build with a4f3acc85beb848007dde5ad721f16bd0dd3e1a5, latest)

 

Test Tasks

0. please mention your laptop model, OS X version, Xcode version with your log, if same contents happened multiple times, pls only paste one here, thanks.

1. verify about whether ApplePS2Controller-10.7build.kext.zip and ApplePS2Controller-10.8build.kext.zip work fine or not on 10.8 - Finished by me

2. verify about whether ApplePS2Controller-10.7build.kext.zip and ApplePS2Controller-10.8build.kext.zip work fine or not on 10.7

3. or maybe someone could try to use them on 10.6

4. could you introduce more info about your elan touchpad? for example, how many buttons on it? what are the available options for it on Windows?

 

How I test

(NOTE: you need to have an external usb mouse to work on OS X!)

0. build my code

1. I am using the AppleACPIPS2Nub.kext and ApplePS2Controller.kext(in /S/L/E) from Multi.Beast. 5.0.2, also included in attachement

2. remove the ApplePS2Mouse.kext and ApplePS2Trackpad.kext from /S/L/E/ApplePS2Controller.kext/Contents/Plugins

3. copy the VoodooPS2ElanTrackpad.kext(for Xcode 4.4, it should be sth like ~/Library/Developer/Xcode/DerivedData/VoodooPS2-abcdefg....../Build/Products/Debug/VoodooPS2Controller.kext/Contents/PlugIns) into above position, /S/L/E/ApplePS2Controller.kext/Contents/Plugins

4. run Kext Utility to fix the permission and update the kernel cache.

5. reboot the machine and check system.log in Console, what I got now:

https://gist.github.com/3614140

Note: in the log, left button click, right button click, 1 finger tap to click, 1 finger movement(for v3 hardware). 2 fingers and 3 fingers maybe cause some kernel crash or no response, need to reboot the machine

freebsd.zip

AppleACPIPS2Nub.kext.zip

ApplePS2Controller.kext.zip

ApplePS2Controller-10.7build.kext.zip

ApplePS2Controller-10.8build.kext.zip

Edited by Cavendish Qi
  • Like 4
Link to comment
Share on other sites

Nhart12,

 

I believe one must first:

  1. Install Xcode;
  2. Download the code from the GitHub;
  3. Compile the code;
  4. Install the product;
  5. Report the results.

I for being n00b in Xcode haven't manage to compile it, but I'll get to it soon.

Link to comment
Share on other sites

I am stuck at following code:

 


static int elantech_set_input_params(struct psmouse *psmouse)
{
...

__set_bit(INPUT_PROP_POINTER, dev->propbit);
__set_bit(EV_KEY, dev->evbit);
...

 

about input_dev, please see http://git.kernel.or...input.h;hb=HEAD

 

Found some relative info, reference in top post, input.h and event_codes.txt, I think "setProperty" on osx should be similar things, but not very clear about it yet.

Edited by Cavendish Qi
Link to comment
Share on other sites

Log output Asus Zenbook Prime UX31A..

 

 

Aug 28 16:59:46 Nathans-MacBook-Air kernel[0]: [ApplePS2ElanTrackpad] init

Aug 28 16:59:46 Nathans-MacBook-Air kernel[0]: [ApplePS2ElanTrackpad] probe

Aug 28 16:59:46 Nathans-MacBook-Air kernel[0]: [ApplePS2ElanTrackpad] Elantech magic knock: [ 0x3c, 0x03, 0x00 ]

Aug 28 16:59:46 Nathans-MacBook-Air kernel[0]: [ApplePS2ElanTrackpad] Elantech version query result : [ 0x36, 0x1f, 0x02 ]

Aug 28 16:59:46 Nathans-MacBook-Air kernel[0]: [ApplePS2ElanTrackpad] assuming hardware version 4 (with firmware version 0x361f02)

Aug 28 16:59:46 Nathans-MacBook-Air kernel[0]: [ApplePS2ElanTrackpad] Synaptics capabilities query result 0x00, 0x15, 0x0e.

Aug 28 16:59:46 Nathans-MacBook-Air kernel[0]: [ApplePS2ElanTrackpad] it's ok by now.

Link to comment
Share on other sites

I've changed the references from 10.8 to 10.7, compiled and followed the instruction. (thanks for the help nhart12)

 

After boot the keyboard and mouse were gone. After plugging in a USB keyboard and mouse to open Console found nothing there referring to ApplePS2 or Elan.

 

I'm not a programmer so I don't know if this was because I was using 10.7 or if I messed up anything when configuring for it.

 

Removed everything and put it all back as before, but placed the Elan kext I compiled inside my VoodooPS2 kext plugin folder. Still nothing in the console, but at least I got keyboard and mouse back to original state.

Link to comment
Share on other sites

inside the Alpsmultitouch in your repo in my previous post there is example of this port.

 

thx, I will try to compare them later. Could you remove the code section in your previous post?

 

For alps linux driver:

Documentation: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=Documentation/input/alps.txt;hb=HEAD

Code:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/input/mouse/alps.h;hb=HEAD

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/input/mouse/alps.c;hb=HEAD

Link to comment
Share on other sites

 

4. Is there any latest ASUS laptop(Ultrabook) user? Could you confirm whether this thing is still valid on your laptop?

 

 

I have been testing this on the Zenbook Prime UX31A. seems to output the same as yours does as you can see from above

Link to comment
Share on other sites

2. verify about whether ApplePS2Controller-10.7build.kext.zip and ApplePS2Controller-10.8build.kext.zip work fine or not on 10.7

I will test on 10.7 tonight around 22h Lisbon time and post the results here. Thank you for letting me help! :)

 

2. looks like I should setup linux and build the elan driver to get debug output to verify whether my osx code works same or not

I have Ubuntu 12.04 with Linux kernel 3.2.0-27-generic on the same machine and I know something about compiling my own kernel from when I used Slackware. How can i help?

Link to comment
Share on other sites

I have been testing this on the Zenbook Prime UX31A. seems to output the same as yours does as you can see from above

Would you like edit #7 to add your laptop model and OS X version there? also please remove the repeated logs, thx.

 

I will test on 10.7 tonight around 22h Lisbon time and post the results here. Thank you for letting me help! :)

 

I have Ubuntu 12.04 with Linux kernel 3.2.0-27-generic on the same machine and I know something about compiling my own kernel from when I used Slackware. How can i help?

Please do the step 1 first, if ok. Then try to add some printk in elantech.c , and check whether we got some output values.

 

BTW, I will be out for 2 days from tomorrow, maybe could back to this work on Sunday.

Link to comment
Share on other sites

@Cavendish Qi

about alps touchpad

this alps multitouch kext isnt complete it makes some alps devices to work on intellimouse mode

not on absolute mode

and this driver is old and when developed there was no good driver under lunix was developed

 

now there is good driver under lunix but no one continued developing it

i am not programing this is the bad thing

 

you can find alps driver under alps.c on lunix kernel

 

i hope you help on this also :)

Link to comment
Share on other sites

here same thing:

 

 

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] init

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] probe

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] Elantech magic knock: [ 0x3c, 0x03, 0x00 ]

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] Elantech version query result : [ 0x45, 0x0f, 0x01 ]

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] assuming hardware version 3 (with firmware version 0x450f01)

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] Synaptics capabilities query result 0x78, 0x15, 0x0c.

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] Touchpad range query result 0, 0, 2508, 1320, 0.

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] pktsize result 6.

Aug 30 09:37:34 localhost kernel[0]: [ApplePS2ElanTrackpad] it's ok by now.

 

but the trackpad does no move. kext is loaded.

 

samsung 300e4a-bd1

Link to comment
Share on other sites

@Cavendish Qi

about alps touchpad

..:

you can find alps driver under alps.c on lunix kernel

 

i hope you help on this also :)

Thanks, but this is not about the ALPS pluggin for the PS2 controller.

 

This thread is to develop a plugin for the Elan.

 

And yes we will be looking up Linux driver, which by the way works perfect for me.

 

We would love if you could help us with this.

Link to comment
Share on other sites

 Share

×
×
  • Create New...