Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working driver #4

Open
mwyborski opened this issue Oct 9, 2016 · 12 comments
Open

Working driver #4

mwyborski opened this issue Oct 9, 2016 · 12 comments

Comments

@mwyborski
Copy link

mwyborski commented Oct 9, 2016

I incorporated the Magic Trackpad into the bcm5974 (MacBook Tochpad) driver:
https://github.com/robotrovsky/Linux-Magic-Trackpad-2-Driver

It makes the switch to activate the multitouch fingers but is still not stable.

@pacuna
Copy link

pacuna commented Oct 10, 2016

hi @robotrovsky, do you have any instructions to install the driver? Thanks!

@mwyborski
Copy link
Author

mwyborski commented Oct 11, 2016

You have to compile the kernel modules. Right now the driver only works over USB.

On Arch Linux:
See https://wiki.archlinux.org/index.php/Kernels/Arch_Build_System. The clean way would be to create a patch from the changes in
https://github.com/robotrovsky/linux/commit/7b50169c3a8948e67a67eb530b91117a7f5d9d5b and add that patch to the prepare routine. A quick unclean way would be as follows:

 $ cd ~/
 $ mkdir build
 $ cd build/
 $ ABSROOT=. abs core/linux
 $ cd core/linux

Edit

PKGBUILD

and look for the pkgbase parameter. Change this to your custom package name, e.g.:

pkgbase=linux-custom

Then:

$ updpkgsums
$ makepkg -s --skippgpcheck

When the makepkg has downloaded the kernel applied the patches and begins to compile just hit "Ctrl C" to stop the creation of the package and the compilation.

Now apply the changes to your source:

$ cd src/linux-{version}/

Insert the hid-id in

drivers/hid/hid-ids.h
drivers/hid/hid-apple.c
drivers/hid/hid-core.c

Replace the bcm5974-driver source with the modified one
drivers/input/mouse/bcm5974.c

Then:

$ make modules
$ make modules_install

Now you have recompiled all kernel modules and installed them to/lib/modules/{kernel-version}-custom/

Just copy the folder /lib/modules/{kernel-version}-custom/kernel/drivers over to your ARCH Kernel /lib/modules/{kernel-version}-ARCH/kernel/drivers

After a reboot your Magic Trackpad 2 should work. You can check, that it now uses the bcm5974 driver with usb-devices

I hope this helps.

@dcousens
Copy link

@robotrovsky would you be able to make that patch file?

@zbraniecki
Copy link

are you planning to upstream your work to mainline kernel?

@coxley
Copy link

coxley commented Oct 27, 2016

@robotrovsky What's the blocker for activating the driver for a bluetooth HID?

@mwyborski
Copy link
Author

Sorry. I haven't had time to work on this. There are two drivers in the kernel. One for the Touchpad of the MacBook Pro and another one for MagicMouse and MagicTrackpad I. The latter i didn't saw when starting on the driver. It has Bluetooth and is more simple in its structure. The "secret" lies in the mode switch, to switch to finger reporting and the structure of the finger reports (9 Byte). So maybe the best would be to dump the current driver and implement it alongside to the MagicTrackpad I. But as i have a MacBook with Touchpad it was easier for me to compare the outcome of the driver. Another reason to go for the MacBook Tochpad driver would have been, that both MacBook Touchpad and the Tackpad 2 support ForceTouch. So implementing the two devices in different drivers, would make it necessary to implement ForceTouch as well in two drivers, but then again it doesn't have Bluetooth.

All in all, it should not be too difficult. But i don't know when i will find the time for this. If someone wants to give it a shot, i would be glad to help.

@robbi5
Copy link

robbi5 commented Dec 22, 2016

@robotrovsky: thank you very much for your kernel patches. 👍
I've created an dkms package with them that is known to work with kernel 4.4.0-57-generic on Ubuntu 16.04 LTS: https://github.com/robbi5/magictrackpad2-dkms

@mwyborski
Copy link
Author

@robbi5 That are awesome news!! Thank you for taking this a step further.

@coxley
Copy link

coxley commented Jan 3, 2017

@robbi5 Time for something in the AUR now eh? ;)

@robbi5
Copy link

robbi5 commented Jan 3, 2017

@coxley Yep, but I have not used Arch Linux yet ;)

@ponyfleisch
Copy link

Hi all.

If anyone wants to give my bluetooth enabled driver a try, find details here: robbi5/magictrackpad2-dkms#1 (comment)

@jwp23
Copy link

jwp23 commented Feb 25, 2018

In case anyone else runs into this, two finger scrolling on trackpad 2 worked with bluetooth as of kernel 4.13. Starting with kernel 4.14 it stopped working. The kernels were the versions used on Manjaro, Fedora, and I think Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants