Jump to content

Elan Touchpad Driver

Development Driver ASUS Laptop Elan 10.8 10.7

  • Please log in to reply
79 replies to this topic

#1
Cavendish Qi

Cavendish Qi

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
  • Gender:Male
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/E...ouchpad-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

Attached Files


Edited by Cavendish Qi, 23 October 2012 - 12:26 PM.


#2
nhart12

nhart12

    InsanelyMac Protégé

  • Members
  • PipPip
  • 87 posts
how can i help?

#3
bigwiz

bigwiz

    InsanelyMac Protégé

  • Members
  • Pip
  • 22 posts
Nhart12,

I believe one must first:
  • Install Xcode;
  • Download the code from the GitHub;
  • Compile the code;
  • Install the product;
  • Report the results.
I for being n00b in Xcode haven't manage to compile it, but I'll get to it soon.

#4
Cavendish Qi

Cavendish Qi

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
  • Gender:Male

how can i help?

for example,
1. read my code and the linux code, try to find my error.
2. read the linux code, understand more which I haven't tried yet, and explain them here

^_^

#5
nhart12

nhart12

    InsanelyMac Protégé

  • Members
  • PipPip
  • 87 posts
Ya Im working on compiling it in xcode but am still looking where to find the IOKit libraries and the other libraries that are included.. Im familiar with C++ so hopefully i can be sort of helpful

#6
Cavendish Qi

Cavendish Qi

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
  • Gender:Male
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, 03 September 2012 - 10:37 PM.


#7
nhart12

nhart12

    InsanelyMac Protégé

  • Members
  • PipPip
  • 87 posts
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.

#8
Cyrus the Great

Cyrus the Great

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:tehran
thanks cavandish i am not a programmer but try to help with this project.

#9
bigwiz

bigwiz

    InsanelyMac Protégé

  • Members
  • Pip
  • 22 posts
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.

#10
Pillendreher

Pillendreher

    InsanelyMac Protégé

  • Members
  • Pip
  • 29 posts
  • Gender:Male
  • Location:Germany
Will this driver work with every touchpad or just with certain touchpads?

#11
bigwiz

bigwiz

    InsanelyMac Protégé

  • Members
  • Pip
  • 22 posts

Will this driver work with every touchpad or just with certain touchpads?

This is for Elan Tech on the Asus laptops.

I don't believe Cavendish has yet determine how many Elan touchpad models will support.

#12
thevoiceover

thevoiceover

    InsanelyMac Protégé

  • Members
  • PipPip
  • 58 posts
  • Gender:Male
Donations to support your time and effort?

#13
Cavendish Qi

Cavendish Qi

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
  • Gender:Male

Donations to support your time and effort?


Thanks, but I am not that confident whether I could finish this task or not yet. Maybe we could decide it later.

#14
Cyrus the Great

Cyrus the Great

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:tehran
the alps trackpad user port linux driver to osx i think we can use it as road map .

#15
Cavendish Qi

Cavendish Qi

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
  • Gender:Male

the alps trackpad user port linux driver to osx i think we can use it as road map .


Do you know where the code is? I mean the driver for osx

#16
Cyrus the Great

Cyrus the Great

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:tehran

Do you know where the code is? I mean the driver for osx

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

#17
Cavendish Qi

Cavendish Qi

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
  • Gender:Male

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.or...lps.txt;hb=HEAD
Code:
http://git.kernel.or.../alps.h;hb=HEAD
http://git.kernel.or.../alps.c;hb=HEAD

#18
nhart12

nhart12

    InsanelyMac Protégé

  • Members
  • PipPip
  • 87 posts

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

#19
bigwiz

bigwiz

    InsanelyMac Protégé

  • Members
  • Pip
  • 22 posts

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?

#20
Cavendish Qi

Cavendish Qi

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
  • Gender:Male

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.





Also tagged with one or more of these keywords: Development, Driver, ASUS, Laptop, Elan, 10.8, 10.7


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy