GithubHelp home page GithubHelp logo

roadrunner2 / macbook12-spi-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cb22/macbook12-spi-driver

246.0 246.0 48.0 470 KB

Input driver for the SPI touchpad / keyboard found in the 12" MacBook (MacBook8,1 + MacBook9,1) and 2016 through 2018 Macbook Pro's (MacBookPro13,* and 14,*); a Touch Bar driver is also available.

License: GNU General Public License v2.0

Makefile 0.32% C 99.68%
keyboard macbook macbook-pro touchbar

macbook12-spi-driver's People

Contributors

cb22 avatar cgutman avatar christophgysin avatar dunedan avatar dwbrite avatar gregkh avatar gustavoarsilva avatar l1k avatar meeuw avatar nikolas avatar roadrunner2 avatar rquast avatar sibradzic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macbook12-spi-driver's Issues

MBP15 fnmode=2

On older macs it was possible to default to F keys and have the media/control keys used when FN is held down. Is it possible to do this in the touchbar?

Previously it was achieved by placing the following in modprobe.d/hid_apple.conf:

options hid_apple fnmode=2

Key release event getting lost if fn key changes touchbar mode

Steps to reproduce:

  • Press and hold fn to switch between F keys and Media keys.
  • press and hold key on the touchbar
  • release fn
  • release touchbar

=> you'll end up with repeated key pressed events and no key release event coming in any more.

(same happens the other way round btw, first press touchbar key, then press fn, release touchbar, release fn)

Support for Retina MacBook Air

Hi, I have a 2019 Retina MacBook Air. Keyboard and trackpad never worked on Linux, so I was excited to try kernel 5.3 as I read about new MacBook drivers being merged.

I tried booting a live distro (Tails 4.0 rc1, kernel 5.3.2) but unfortunately keyboard and trackpad don't work.

I see that this driver does not explicitly support the Air, but maybe newest Airs can use an adapted version of the Pros' driver. I have no technical skill on the matter but I'm available for testing if necessary.

Thank you.

mbp15 branch - Touch bar works but doesn't visually change the fn-mode when FN key is pressed (since kernel 5.6.7)

I'm using the mbp15 branch.
Until kernel 5.6.6, the module works well (except that sometimes it doesn't refresh the touchbar visually when the fn key is pressed or released - I opened another issue for that #44).

Since kernel 5.6.7 (tested 5.6.7, 5.6.8 and 5.6.11), the module compiles well, does enable the touch bar but it never visually changes the touch bar (although the meaning of the keys does change when the FN key is pressed or released)
In this case, from kernels >=5.6.7, an error message is generated in dmesg every time the fn key is pressed or released (after 2 secs):

[ 261.659012] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 2 (-110)

Update: In one boot (in dozens), it simply worked, so this should be something in the initialization. (the only time that it worked, the issue never happened, until I booted again... :-/)

Won't compile on kernel 4.15.0

The hid_report struct has changed so this won't compile on 4.15.0.

DKMS make.log for applespi-0.1 for kernel 4.15.0-36-generic (x86_64)
Mon Oct 8 07:19:46 CDT 2018
make -C /lib/modules/4.15.0-36-generic/build M=/var/lib/dkms/applespi/0.1/build modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-36-generic'
CC [M] /var/lib/dkms/applespi/0.1/build/applespi.o
CC [M] /var/lib/dkms/applespi/0.1/build/appletb.o
/var/lib/dkms/applespi/0.1/build/appletb.c: In function ‘appletb_find_hid_field’:
/var/lib/dkms/applespi/0.1/build/appletb.c:980:14: error: ‘struct hid_report’ has no member named ‘application’
if (report->application != application)
^~
scripts/Makefile.build:339: recipe for target '/var/lib/dkms/applespi/0.1/build/appletb.o' failed
make[2]: *** [/var/lib/dkms/applespi/0.1/build/appletb.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:1551: recipe for target 'module/var/lib/dkms/applespi/0.1/build' failed
make[1]: *** [module/var/lib/dkms/applespi/0.1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-36-generic'
Makefile:12: recipe for target 'all' failed
make: *** [all] Error 2

Problem on 13,3 (15") with Ubuntu 18.04.4

Hello,

I am a very big noob who doesn't understand most of the guide.
However, I did the following steps but can't make this touchbar work.

  1. checked my kernel with command uname-a and got 5.3.0-42-generic
  2. therefore jumped to load the two spi_pxa2xx_platform and spi_pxa2xx_pci with the command modprobe
  3. sudo -i + password to become root
  4. copied and pasted code:
echo -e "\n# applespi\napplespi\nspi_pxa2xx_platform\nintel_lpss_pci" >> /etc/initramfs-tools/modules

apt install dkms
git clone https://github.com/roadrunner2/macbook12-spi-driver.git /usr/src/applespi-0.1
dkms install -m applespi -v 0.1
  1. sudo reboot

Nothing has changed, how do I complete the steps and have a touchbar working? I am sorry, but I have not found any help on checking the initramfs/initrd for modules, also what if they're not there?

Best regards, Neri

Touchbar does not awaken after resume

After suspending and resuming, the touchbar stays off and inactive; however, at the USB level everything looks fine (the responses to the various commands all indicate success). My best guess right now is that some additional command/initialization is needed at suspend and/or resume time.

MacOS uses a much more elaborate protocol to handle the touchbar, whereas this driver is based off of the simpler one used by the Windows driver. So if somebody could run Windows and capture the usb traffic during suspend and resume that would be great.

hid_field_extract() called with n (64) > 32!

Since the split of the drivers I regularly see messages like the following one in the logs:

[ 2391.090155] apple-ibridge-hid 0003:05AC:8600.0002: hid_field_extract() called with n (64) > 32! (swapper/0)

I suppose that's not intentional?

evemu-record stops showing any input when a palm is released slowly from the touchpad

This problem was first discovered when I was trying to make libinput capable of rejecting palm touches based on touch-sizes (see this branch and this thread ).

When I release my palm very slowly from the touchpad, often times the machine fails to respond to the next finger input. evemu-record reveals that when a palm is released slowly, it sometimes stops registering anything in the middle of the slow release. If ABS_MT_TOUCH_MAJOR is above the touch-size threshold the instance evemu-record is stuck, the cursor will fail to move on the next finger input even though evemu-record will register the said input. The cursor will only start moving again on the next touch.

Received corrupted packet (crc mismatch)

I'm running Fedora 31 on a macbook9,1 with kernel 5.4.7
The applespi was included in kernel 5.3.x, which worked great.
But...since I upgraded to kernel 5.4.x, I'm been experiencing these crc mismatch pretty frequently.
ie

[52054.190342] applespi spi-APP000D:00: Received corrupted packet (crc mismatch)

When this error occurs, I'm no longer able to adjust the keyboard backlight level at all, the lighting level is stuck at whatever level it was at when the error occurred. Also, the green led for the Caps lock key no longer functions.
However, the keyboard and trackpad continue to function. So, this error seems to just affect the keyboard lighting functions.
When this error occurs, I'm not able to reload the applespi module, which is strange.
When I try modprobe -r applespi, it just hangs. If I try rmmod applespi, I receive this error message rmmod: ERROR: Module applespi is in use

I never experienced this issue before. I never had any issues with kernel 5.3 (when the module was included in the kernel). Or before that, when I was compiling the module via dkms.

**one other item of note on my system is that I'm using LUKS to encrypt my root/home/swap partition. Therefore, I've added these module to my initramfs image
applespi spi_pxa2xx_platform intel_lpss_pci

Is anyone else experiencing this issue w/ kernel 5.4?

Touchbar doesn't start after Suspend

Branch: "mbp15"

MBP 2019 15" - Model A1990

$ uname -a Linux joax-ubuntu 5.6.9 #8 SMP Thu May 14 16:02:50 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux

When starting Ubuntu, including this driver, the Touchbar works as intended. But when Ubuntu suspends, the Touchbar is lost.

Reproduce:

  1. Close the laptop lid
  2. Wait 1 minute
  3. Open laptop lid

When opening, the Touchbar is not active. The following log is on /var/log/syslog:

May 17 20:43:14 joax-ubuntu kernel: [ 6415.967830] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar display to 4 (-113)
May 17 20:43:14 joax-ubuntu kernel: [ 6415.967831] apple-ib-touchbar 0003:05AC:8302.0007: tb: Touchbar suspended.

Procedure for upgrading/switching from original driver?

Hi, thanks for working on this great addition to mac support! I was wondering what the procedure would be for switching from the original driver with no touch bar support over to your fork. Just clone and install following the same procedure? Do I need to make sure the old version is completely purged? Running kernel 4.15.

compile on linux-5.1.10 -- iio_triggered_buffer unknown symbol

DKMS make.log for applespi-0.1-1pclos2019 for kernel 5.1.10-pclos1 (x86_64)
Sun 16 Jun 2019 03:30:35 PM UTC
make -C /lib/modules/5.1.10-pclos1/build M=/var/lib/dkms/applespi/0.1-1pclos2019/build clean
make[1]: Entering directory '/usr/src/kernel-devel-5.1.10-pclos1'
CLEAN /var/lib/dkms/applespi/0.1-1pclos2019/build/Module.symvers
make[1]: Leaving directory '/usr/src/kernel-devel-5.1.10-pclos1'
make -C /lib/modules/5.1.10-pclos1/build M=/var/lib/dkms/applespi/0.1-1pclos2019/build modules
make[1]: Entering directory '/usr/src/kernel-devel-5.1.10-pclos1'
CC [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/applespi.o
CC [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ibridge.o
CC [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-tb.o
CC [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-als.o
Building modules, stage 2.
MODPOST 4 modules
WARNING: "iio_triggered_buffer_setup" [/var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-als.ko] undefined!
WARNING: "iio_triggered_buffer_cleanup" [/var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-als.ko] undefined!

CC /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-als.mod.o
LD [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-als.ko
CC /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-tb.mod.o
LD [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ib-tb.ko
CC /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ibridge.mod.o
LD [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/apple-ibridge.ko
CC /var/lib/dkms/applespi/0.1-1pclos2019/build/applespi.mod.o
LD [M] /var/lib/dkms/applespi/0.1-1pclos2019/build/applespi.ko
make[1]: Leaving directory '/usr/src/kernel-devel-5.1.10-pclos1'
mkdir -p /lib/modules/5.1.10-pclos1/kernel/3rdparty/applespi
xz -f /lib/modules/5.1.10-pclos1/kernel/3rdparty/applespi/*.ko
/sbin/depmod -a 5.1.10-pclos1

fn doesn't change mode when waking up touchbar

When the Touch Bar is switched off (after the idle timeout), pressing fn will wake it up again, although it won't switch into the different state, it would when pressing fn while it is switched on. Releasing and pressing fn again does get it into the desired state.
I believe pressing fn should always have the same effect on the keys shown on the Touch Bar, whether it's switched on or off.

I confirmed this behavior with the unsplit driver, as well as with the split drivers.

Manjaro Stable update 3-14-2020 breaks touchbar

some reason, when I updated, this isn't working anymore. I uninstalled and reinstalled using both git and AUR, but neither gets it to load. I was on 5.4, but neither 4.19 or 5.5 work either. Neither does rebuilding with DKMS.

EDIT:

[trey@citron ~]$ lsmod | grep apple
apple_ib_als           20480  0
industrialio_triggered_buffer    16384  1 apple_ib_als
industrialio           94208  3 industrialio_triggered_buffer,kfifo_buf,apple_ib_als
apple_ib_tb            28672  0
applesmc               24576  0
apple_ibridge          28672  2 apple_ib_als,apple_ib_tb
hid                   147456  3 usbhid,apple_ib_als,apple_ibridge
apple_gmux             20480  0
apple_bl               20480  1 apple_gmux
applespi               40960  0
crc16                  16384  3 bluetooth,ext4,applespi
[trey@citron ~]$ sudo dmesg | grep applespi
[sudo] password for trey: 
[    2.778261] applespi spi-APP000D:00: Received corrupted packet (crc mismatch)
[    2.779337] applespi spi-APP000D:00: modeswitch done.

Thanks!

Touchbar doesn't work on MBP13,3 15''

I installed Ubuntu 18.04 with kernel 4.15.0-43-generic on MBP13,3 15'' (with touchbar)
Basic keyboard input works after installing this driver. However the touchbar and Fn key don't work, the touchbar shows nothing, and the backlit keyboard doesn't light up, just as if the computer is shutdown.
And I find that sometimes mouse clicks automatically when typing, I really don't know why ..?
Thank you very much!

Below is some info about my issue:

$ dmesg |grep apple
[    2.094621] applespi: loading out-of-tree module taints kernel.
[    2.094635] applespi: module verification failed: signature and/or required key missing - tainting kernel
[    2.301905] apple-ibridge: registered driver 'apple-ib-touchbar'
[    2.306140] apple-ibridge: registered driver 'apple-ib-als'
[    2.443752] applespi: spi-device probe done: spi-APP000D:00
[    2.446653] applespi: modeswitch done.
[    8.450944] apple_gmux: Found gmux version 4.0.29 [indexed]
[    8.906353] applesmc: key=858 fan=2 temp=46 index=45 acc=0 lux=0 kbd=0
[    8.906439] applesmc applesmc.768: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
$ lsinitramfs /boot/initrd.img-4.15.0-43-generic | grep -iE "apple"
lib/modules/4.15.0-43-generic/kernel/drivers/hid/hid-apple.ko
lib/modules/4.15.0-43-generic/kernel/drivers/hid/hid-appleir.ko
lib/modules/4.15.0-43-generic/updates/dkms/apple-ibridge.ko
lib/modules/4.15.0-43-generic/updates/dkms/apple-ib-als.ko
lib/modules/4.15.0-43-generic/updates/dkms/applespi.ko
lib/modules/4.15.0-43-generic/updates/dkms/apple-ib-tb.ko
$ cat /etc/initramfs-tools/modules 
# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax:  module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod

# drivers for keyboard+touchpad
applespi
apple-ib-tb
intel_lpss_pci
spi_pxa2xx_platform
apple_ibridge
apple_ib_als

Cannot get keyboard to work on MacBook 14,3

I'm currently on Linux 4.16.0-rc2, trying to get my onboard keyboard and touchpad working. Currently I can boot, launch to X and connect to the network (using a USB ethernet adapter).

Using the roadrunner2/macbook12-spi-driver fork, if I modprobe the applespi and appletb modules, I do get a working touch bar. I see the escape and media keys. However, I don't get a working builtin keybord or touchpad. I have to continue to use the external ones.

If I rmmod and modprobe the appletb module, I see the following in my kernel logs:

[[ 3323.821411] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0001/input/input18
[ 3323.873099] apple-touchbar 0003:05AC:8600.0001: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ 3323.873104] apple-touchbar 0003:05AC:8600.0001: module probe done.
[ 3323.873365] apple-touchbar 0003:05AC:8600.0002: hiddev96,hidraw1: USB HID v1.01 Device [Apple Inc. iBridge] on usb-0000:00:14.0-3/input3
[ 3323.873369] apple-touchbar 0003:05AC:8600.0002: module probe done.
[ 3323.873398] appletb: Touchbar usb device added; dev=0003:05AC:8600.0001
[ 3323.971878] appletb: Failed to set touchbar display to 1 (-32)](url)

I get absolutely nothing for the applespi module. I've tried this and the cb22 version this was forked from.

I don't currently have these modules in my initrd. I'm using better-initramfs for my initramfs (my primary partition is luks encrypted and has LVMs and I've found this initrd works best), but it doesn't seem to support modprobe/module support .. although I can probably hack at it and add them. Could loading applespi earlier in the boot process fix this issue?

Here are my current modules:

lsmod
Module                  Size  Used by
appletb                20480  0
applespi               24576  0
amdgpu               2527232  2
brcmfmac              212992  0
brcmutil               16384  1 brcmfmac
mfd_core               16384  1 amdgpu
chash                  16384  1 amdgpu
gpu_sched              20480  1 amdgpu
ttm                    81920  1 amdgpu

And here is my /proc/config.gz:

config.gz

Problem with a Touch Bar on macbook pro 13,3

Hi! I would like to use ubuntu 19.10 on my macbook pro 13,3.

At first, I have tried a Live CD and everything except a sound works good. Also I have successfuly installed and run modules for touchbar while running the Live CD. But when I tried to reproduce these steps with installed ubuntu, I have not success.

sergey@sergey-MacBookPro:~$ uname -a
Linux sergey-MacBookPro 5.3.0-26-generic #28-Ubuntu SMP Wed Dec 18 05:37:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I have done the following commands:

echo -e "\n# applespi\napplespi\nspi_pxa2xx_platform\nintel_lpss_pci" >> /etc/initramfs-tools/modules

apt install dkms
git clone https://github.com/roadrunner2/macbook12-spi-driver.git /usr/src/applespi-0.1
dkms install -m applespi -v 0.1
update-initramfs -u -k all
reboot
sergey@sergey-MacBookPro:~$ lsmod | grep apple
apple_ib_als           20480  0
industrialio_triggered_buffer    16384  1 apple_ib_als
industrialio           77824  3 industrialio_triggered_buffer,kfifo_buf,apple_ib_als
apple_ib_tb            24576  0
apple_ibridge          24576  2 apple_ib_als,apple_ib_tb
hid                   131072  2 apple_ib_als,apple_ibridge
applesmc               20480  0
input_polldev          20480  1 applesmc
apple_gmux             24576  0
apple_bl               20480  1 apple_gmux
applespi               40960  0
video                  49152  1 apple_gmux

It looks like the module is loaded successfuly but the touchbar does not work.

One more wired thing. When I changed parameters for the module in my initramfs-tools/modules:

apple_ib_tb idle_timeout=-1 dim_timeout=-1 fnmode=1
applespi
spi_pxa2xx_platform
intel_lpss_pci

And then updated it and rebooted I have parameters unchanged:

Module: apple_ib_tb
Parameter: dim_timeout --> -2
Parameter: fnmode --> 1
Parameter: idle_timeout --> 300

@roadrunner2 Can you help me please?

"spi_pxa2xx_platform"

First, thank you and everyone else a lot for your work on this driver!

I installed the driver on my MBP13,3 runnig Kali (4.9.0). While the Touchbar works perfectly fine, neither the keyboard or the touchpad work. I nailed it down to the missing "spi_pxa2xx_platform" module, but I am lost on how to add it since this part is never mentioned anywhere on the web. I am aware that this is probably a newby question but I sincerely can not solve this on my own and would be very glad if someone could give me the right tip!

Fn Key "get stuck" sometimes

This is an excellent piece of software. Congratulations and thank you!

Sometimes, when I press Fn and release it, the touch bar keeps showing the modified keys in touch bar.

OBS: I'm using the mbp15 branch on a MacbookPro15,2 from 2019

DKMS package error

I am quite unsure of this error, but I keep getting it on a fresh installation of Ubuntu 16.04 on a Macbook pro 14,2.

dkms install -m applespi -v 0.1

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=4.15.0-45-generic....(bad exit status: 2)
ERROR (dkms apport): binary package for applespi: 0.1 not found
Error! Bad return status for module build on kernel: 4.15.0-45-generic (x86_64)
Consult /var/lib/dkms/applespi/0.1/build/make.log for more information.

The log file mentioned is as attached. make-log.txt
Will really appreciate your help!

Can't build mpb15 branch on 5.4.8

The main branch works fine but if I try to compile the mbp15 branch I get the following error:

==> dkms install macbook12-spi-driver/0+git.303 -k 5.4.8-1-mbp
Error!  Build of applespi.ko failed for: 5.4.8-1-mbp (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/macbook12-spi-driver/0+git.303/build/ for more information.

The log file it mentions doesn't show anything obviously wrong:

DKMS make.log for macbook12-spi-driver-0+git.303 for kernel 5.4.8-1-mbp (x86_64)
Wed  8 Jan 11:04:34 GMT 2020
make -C /usr/lib/modules/5.4.8-1-mbp/build M=/var/lib/dkms/macbook12-spi-driver/0+git.303/build modules
make[1]: Entering directory '/usr/lib/modules/5.4.8-1-mbp/build'
  CC [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ibridge.o
  CC [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ib-tb.o
  CC [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ib-als.o
  Building modules, stage 2.
  MODPOST 3 modules
  CC [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ib-als.mod.o
  CC [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ib-tb.mod.o
  CC [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ibridge.mod.o
  LD [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ib-als.ko
  LD [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ib-tb.ko
  LD [M]  /var/lib/dkms/macbook12-spi-driver/0+git.303/build/apple-ibridge.ko
make[1]: Leaving directory '/usr/lib/modules/5.4.8-1-mbp/build'


Not working on 12-inch MacBook Early 2015

I recently tried to use this driver to get support for the built-in keyboard and touchpad on my 12-inch MacBook Early 2015. I have tried both the version available in the Arch User Repository (installed with yay), as well as cb22's version (installed manually). Neither have been successful at getting the keyboard and touchpad to respond.

I'm pretty new to Linux, so there is a fair chance that I did something wrong.

I don't know if this is helpful, but xinput list does display both the keyboard and the touchpad.

Thank you.

[Feature Request] delete key on the touchbar?

Is there any way you could add a Windows-like delete key to go with the existing "backspace" delete key? Everything else about my keyboard setup with your touchbar is perfect, all I would like is a delete key.

That also may not be how this works, which is fine. I just wanted to ask.

intel-lpss-pci kernel bug

Hi, I hope you can help me; the macbook12-spi-driver seems to be working fine but when I load intel-lpss-pci modprobe get stuck (even without the macbook12-spi-drivers loaded).

I have blacklisted the module because it really slows down booting so I can load it manually.

Do you know what I can do? I'm using refind without spoof_osx_version. I'm using a macbook pro 13,3 (2016).

I'll attach the output from a debug kernel of dmesg.

mbp15 No keyboard/touchpad on 5.4.11

I'm using aunali's kernel from here: https://packages.aunali1.com/archlinux/mbp/x86_64/

Since I upgraded, I've had no keyboard or touchpad.

I've installed the spi driver from the mbp15 branch which was working fine. I rebuilt it even though it shouldn't be necessary.

Although it was working on 5.4.8 I can't downgrade* to test to see if it's something else. The BCE driver is working as I have wifi and audio so I'm assuming the issue is the spi driver. Is there any way I can debug this? What steps can I take to work out what's not working?

There's nothing in dmesg to indicate an issue but if i run lsmod | grep apple this is all I get:

apple_gmux             20480  0
apple_bl               20480  1 apple_gmux
apple_bce              98304  1
snd_pcm               135168  5 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,apple_bce,snd_hda_core
snd                   106496  11 snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,apple_bce,snd_pcm

hid_apple is missing, as is apple_ibridge. Modprobing those modules makes no difference so I'm guessing it's something else that's missing?

*Long story: as I don't have the packages (unfortunately aunali's server always times out through pacman so the don't get cached).The only other version I have available is 5.3.5 and I can't build the BCE driver if I boot that kernel because GCC says "incompatible gcc/plugin versions"

Driver doesn't compile for 5.9.0+ - iio_priv_to_dev() helper migration

The helper is decommissioned from iio so this driver (apple-ib-als.c in particular) needs a different strategy to access the private components of the device. I am trying to re code to this new world, I will post a PR soon unless you have one already in the making.

make[1]: Entering directory '/mnt/bb8956c1-8d7f-4076-a76b-4d4443586eea/repos/linux-git'
  CC [M]  /usr/src/apple-ibridge-0.2/apple-ib-als.o
/usr/src/apple-ibridge-0.2/apple-ib-als.c: In function ‘appleals_config_iio’:
/usr/src/apple-ibridge-0.2/apple-ib-als.c:469:28: error: implicit declaration of function ‘iio_priv_to_dev’ [-Werror=implicit-function-declaration]
  469 |  struct iio_dev *iio_dev = iio_priv_to_dev(als_dev);
      |                            ^~~~~~~~~~~~~~~
/usr/src/apple-ibridge-0.2/apple-ib-als.c:469:28: warning: initialization of ‘struct iio_dev *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:283: /usr/src/apple-ibridge-0.2/apple-ib-als.o] Error 1
make[1]: *** [Makefile:1788: /usr/src/apple-ibridge-0.2] Error 2
make[1]: Leaving directory '/mnt/bb8956c1-8d7f-4076-a76b-4d4443586eea/repos/linux-git'
make: *** [Makefile:13: all] Error 2

function key swapped with left shift

I'm not sure how this happened, but my function key has become swapped with my left shift key. This was quite annoying when I booted and didn't realise, and my decryption password has a capital letter in it, so I thought I was locked out.

I have messed with a few files in /etc/modprobe.d/ when trying to swap function keys, but I have everything in apple related files commented out right now, and it's still happening:

$ cat /etc/modprobe.d/*apple*
# options applespi fnremap=2
# options applespi swap_fn_leftctrl=1
# options applespi swap_opt_cmd=1
# options appletb fnmode=2
# options hid_apple fnmode=2

I'm not even entirely sure that I'm using this driver - I'm using a macbook pro 14,1 (without the touchbar).

I think this change happened when I upgraded my kernel to the amd64 version from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.18.12/

Keyboard shortscuts don't work with Touch Bar keys

Following the rollover problems with the keyboard, there is also an issue with key combinations involving the functions keys on the Touch Bar. I'm facing this issue since the beginning of appletb.
Combinations involving Ctrl + Alt + <a Touch Bar function key> key simply don't work.

E.g. with fnmode = 2:
Alt + F1 = works
Alt + Meta + F1 = works
Ctrl + F1 = works
Ctrl + Meta + F1 = works
Ctrl + Alt + F1 = doesn't work
Ctrl + Alt + Esc = works
Ctrl + Alt + Fn + Esc = works
Ctrl + Alt + Fn + Mute audio = works
Ctrl + Alt + Meta + Esc = works
Ctrl + Alt + Meta + F1 = doesn't work

Using evtest I looked into the events emitted by the Touch Bar. I noticed that all key presses emit an event of type EV_KEY, but the function keys also emit an MSC_SCAN event of type EV_MSC before. I'm not sure if that's relevant, but that's the only obvious difference I noticed so far.

Manjaro Deepin MacBook 12, 2017

Trying to build a custom iso using Manjaro Deepin and its offical manjaro-tools. From there I'm installing your AUR package. But it seems the driver does not load at boot. At least keyboard and trackpad are unresponsive. Any chance you can point me into the right direction?

For details see:
https://forum.manjaro.org/t/macbook-12-2017-how-to-create-iso-with-aur-driver/80824/5

And here's what I did, step by step:
https://github.com/marbetschar/Manjaro-Linux-on-MacBook-12

Palm detection could be improved

Two finger scroll happens if the fingers are many inches apart and with such a wide touchpad it is very easy to have your palm trigger scrolling. I'd suggest ignoring any scrolling request that are more than two inches apart.

The flip side is which input is the one to use then for the mouse pointer? I'd suggest it's the one with more acceleration. The palm is likely to be fairly fixed when it does accidentally activate the touchpad.

I'm using the main Linux kernel - maybe you've already improved the palm detection here?

ibridge not working on latest linux-libre kernel (Parabola)

I have tried using the latest linux-libre and linux-libre-lts kernels on Parabola on a Macbook Pro 14,3. I assume it is a kernel update that caused this, but I'm not sure. I am pretty sure this is not a duplicate of #42 since the whole ibridge is not working (touchbar does not display anything and the camera is not detected) despite the modules being loaded, the touchbar does not flicker, and the echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/bind part of the workaround for Arch returns an error saying tee: /sys/bus/usb/drivers/usb/bind: No such device. Keyboard and touchpad work just fine. I will test this on Arch or Manjaro (which use regular linux) and see if the same thing happens with the latest kernel and lts kernel. I find this odd since just yesterday my touchbar was working fine.

Linux distro with kernel 5.3.9

The keyboard and touchpad (Macbook pro mid 2017) still wont work with a linux distro that uses a linux kernel 5.3.9. Are there extra steps?

Runaway kworker (maybe related to these drivers)?

Firstly, thanks so much for putting these resources together! It's awesome to be able to run Linux on these machines at all.

I followed the guidance in this gist to set up everything in Fedora 28 on a MacBookPro14,3, and it is largely working beautifully. My touchbar works, as does the trackpad and keyboard.

However, my machine runs very hot. When I looked into why, I discovered that one CPU is always running at about 80%, and top reports that the culprit is kworker/6:3. It seemed reasonable to me to ask whether this might be a bug in one of the applespi or appletb drivers, as I don't think that this happened before I installed them.

Some possibly helpful diagnostic information:

$ dmesg | grep apple
[    0.285641] apple-properties: device path parse error -19 at 0x14:
[    0.285645] apple-properties: 00000000: a6 01 00 00 04 00 00 00 02 01 0c 00 d0 41 03 0a  .............A..
[    0.285647] apple-properties: 00000010: 00 00 00 00 01 01 06 00 00 02 7f ff 04 00 1e 00  ................
[    0.285650] apple-properties: 00000020: 00 00 73 00 61 00 76 00 65 00 64 00 2d 00 63 00  ..s.a.v.e.d.-.c.
[    0.285652] apple-properties: 00000030: 6f 00 6e 00 66 00 69 00 67 00 00 00 e2 00 00 00  o.n.f.i.g.......
[    0.285654] apple-properties: 00000040: 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  G...............
[    0.285656] apple-properties: 00000050: 00 00 03 00 06 00 1b 59 00 6c 05 00 00 00 00 00  .......Y.l......
[    0.285658] apple-properties: 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285660] apple-properties: 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285663] apple-properties: 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285665] apple-properties: 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285667] apple-properties: 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285669] apple-properties: 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285672] apple-properties: 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285674] apple-properties: 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285676] apple-properties: 000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285678] apple-properties: 000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285681] apple-properties: 00000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    0.285683] apple-properties: 00000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2c 00  ..............,.
[    0.285685] apple-properties: 00000120: 00 00 41 00 41 00 50 00 4c 00 2c 00 69 00 67 00  ..A.A.P.L.,.i.g.
[    0.285687] apple-properties: 00000130: 2d 00 70 00 6c 00 61 00 74 00 66 00 6f 00 72 00  -.p.l.a.t.f.o.r.
[    0.285690] apple-properties: 00000140: 6d 00 2d 00 69 00 64 00 00 00 08 00 00 00 06 00  m.-.i.d.........
[    0.285692] apple-properties: 00000150: 1b 59 20 00 00 00 41 00 41 00 50 00 4c 00 2c 00  .Y ...A.A.P.L.,.
[    0.285694] apple-properties: 00000160: 47 00 66 00 78 00 59 00 54 00 69 00 6c 00 65 00  G.f.x.Y.T.i.l.e.
[    0.285696] apple-properties: 00000170: 00 00 08 00 00 00 01 00 00 00 24 00 00 00 67 00  ..........$...g.
[    0.285699] apple-properties: 00000180: 72 00 61 00 70 00 68 00 69 00 63 00 2d 00 6f 00  r.a.p.h.i.c.-.o.
[    0.285701] apple-properties: 00000190: 70 00 74 00 69 00 6f 00 6e 00 73 00 00 00 08 00  p.t.i.o.n.s.....
[    0.285703] apple-properties: 000001a0: 00 00 0c 00 00 00                                ......
[    1.646903] applespi: loading out-of-tree module taints kernel.
[    1.646925] applespi: module verification failed: signature and/or required key missing - tainting kernel
[    1.767629] applespi: info 40 d0 00 00 00 00 78 00 20 10 02 00 00 02 6e 00 05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03
[    1.767632] applespi: info 15 00 25 01 85 02 95 03 75 01 81 02 95 01 75 05 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02
[    1.767634] applespi: info 81 06 95 04 75 08 81 01 c0 c0 05 0d 09 05 a1 01 06 00 ff 09 0c 15 00 26 ff 00 75 08 95 10 85 3f
[    1.767635] applespi: info 81 22 c0 06 00 ff 09 0c a1 01 06 00 ff 09 0c 15 00 26 ff 00 85 44 75 08 96 d7 06 81 00 c0 c0 fb
[    1.767637] applespi: info 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.767638] applespi: info 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.767640] applespi: info 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    1.767641] applespi: info 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 89 dc
[    1.769165] applespi: spi-device probe done: spi-APP000D:00
[    1.770894] applespi: modeswitch done.
[    1.885284] Modules linked in: amdkfd amd_iommu_v2 amdgpu(+) spi_pxa2xx_platform chash i2c_algo_bit gpu_sched drm_kms_helper ttm crct10dif_pclmul drm crc32_pclmul crc32c_intel nvme ghash_clmulni_intel nvme_core intel_lpss_pci intel_lpss applespi(OE) ax88179_178a(+) usbnet mii
[    2.597563] apple-touchbar 0003:05AC:8600.0004: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[    2.597570] appletb: Connected to keyboard input device
[    2.597573] appletb: Connected to touchpad input device
[    2.597585] apple-touchbar 0003:05AC:8600.0004: module probe done.
[    2.598866] apple-touchbar 0003:05AC:8600.0005: hiddev96,hidraw1: USB HID v1.01 Device [Apple Inc. iBridge] on usb-0000:00:14.0-3/input3
[    2.598872] appletb: Connected to keyboard input device
[    2.598875] appletb: Connected to touchpad input device
[    2.598884] apple-touchbar 0003:05AC:8600.0005: module probe done.
[    2.598939] appletb: Touchbar usb device added; dev=0003:05AC:8600.0004
[    2.700439] appletb: Failed to set touchbar display to 1 (-32)
[   11.755950] apple_gmux: Found gmux version 4.0.29 [indexed]
[   12.122269] applesmc: key=862 fan=2 temp=46 index=45 acc=0 lux=0 kbd=0
[   12.122348] applesmc applesmc.768: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[  299.277441] appletb: Failed to set touchbar display to 1 (-32)
[  594.190798] appletb: Failed to set touchbar display to 1 (-32)
[  811.278534] appletb: Failed to set touchbar display to 1 (-32)
[ 1069.328527] appletb: Failed to set touchbar display to 1 (-32)
[ 1294.606986] appletb: Failed to set touchbar display to 1 (-32)
[ 1536.267561] appletb: Failed to set touchbar display to 1 (-32)
[ 1769.747588] appletb: Failed to set touchbar display to 1 (-32)
[ 2035.988666] appletb: Failed to set touchbar display to 1 (-32)
[ 2330.860917] appletb: Failed to set touchbar display to 1 (-32)
[ 2625.815189] appletb: Failed to set touchbar display to 1 (-32)
[ 2875.651802] appletb: Failed to set touchbar display to 1 (-32)

The CPU is getting hot enough to cause throttling:

[ 3375.818766] CPU7: Core temperature above threshold, cpu clock throttled (total events = 911)
[ 3375.818767] CPU3: Core temperature above threshold, cpu clock throttled (total events = 911)
[ 3375.818768] CPU5: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.818770] CPU3: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.818774] CPU7: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.818803] CPU4: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.818804] CPU0: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.818806] CPU6: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.818807] CPU2: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.818807] CPU1: Package temperature above threshold, cpu clock throttled (total events = 1620)
[ 3375.871785] CPU7: Core temperature/speed normal
[ 3375.871785] CPU3: Core temperature/speed normal
[ 3375.871787] CPU6: Package temperature/speed normal
[ 3375.871787] CPU2: Package temperature/speed normal
[ 3375.871788] CPU5: Package temperature/speed normal
[ 3375.871789] CPU1: Package temperature/speed normal
[ 3375.871790] CPU3: Package temperature/speed normal
[ 3375.871790] CPU7: Package temperature/speed normal
[ 3375.871818] CPU4: Package temperature/speed normal
[ 3375.871819] CPU0: Package temperature/speed normal

I unloaded and reloaded the applespi module and the runaway kworker went away (for the time being). I don't have enough empirical data to say that it actually has anything to do with the drivers in this repo, but I thought that I should report it in case others encounter similar behavior.

applespi sporadically times out on boot: "spi-APP000D:00: Timed out waiting for device info"

applespi sporadically times out on boot, at around 2 times out of 10 times:

applespi spi-APP000D:00: Timed out waiting for device info
applespi: probe of spi-APP000D:00 failed with error -110

whilst touch bar stays active, I have to press power button for 5 seconds to reboot.

Any ideas?

Not working on MBP15,2 13"

Hello,
I had try to install this driver but it not work. At the beginnning i thinked it's my installation but i have tried this https://foolcontrol.org/?p=2952 and it not work too. If you want something for search the bug tell me. And thank you very munch for all work on this drivers :)

suggestion / question

it is possible to include the corresponding .c, .h and kernelconf and make files from linux / driver / iio ... (... iio_triggered_buffer ...) for apple-ib-as in the source, so that these together with apple-ib-as compiled, regardless of the user's kernel-config?

Compile error in 5.9.0-1 too few arguments to function ‘iio_device_alloc’

I get the following error log. Is this a naming conflict?

/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:463:29: warning: passing argument 1 of ‘iio_device_alloc’ makes pointer from integer without a cast [-Wint-conversion]
  463 |  iio_dev = iio_device_alloc(sizeof(als_dev));
      |                             ^~~~~~~~~~~~~~~
      |                             |
      |                             long unsigned int
In file included from /usr/src/linux-headers-5.9.0-1-common/include/linux/iio/buffer.h:10,
                 from /var/lib/dkms/applespi/0.1/build/apple-ib-als.c:32:
/usr/src/linux-headers-5.9.0-1-common/include/linux/iio/iio.h:684:49: note: expected ‘struct device *’ but argument is of type ‘long unsigned int’
  684 | struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv);
      |                                  ~~~~~~~~~~~~~~~^~~~~~
/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:463:12: error: too few arguments to function ‘iio_device_alloc’
  463 |  iio_dev = iio_device_alloc(sizeof(als_dev));
      |            ^~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-5.9.0-1-common/include/linux/iio/buffer.h:10,
                 from /var/lib/dkms/applespi/0.1/build/apple-ib-als.c:32:
/usr/src/linux-headers-5.9.0-1-common/include/linux/iio/iio.h:684:17: note: declared here
  684 | struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv);
      |                 ^~~~~~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-5.9.0-1-common/scripts/Makefile.build:288: /var/lib/dkms/applespi/0.1/build/apple-ib-als.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:1796: /var/lib/dkms/applespi/0.1/build] Error 2
make[1]: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.9.0-1-amd64'
make: *** [Makefile:16: all] Error 2

[Question] Advanced touchbar support?

I'm curious about what's the current status and what would need to be done to have advanced functionality of the Touchbar so it can be used for example as an (extra) gnome-panel or similar. I'm thinking about what support would need to be added to have something like https://vas3k.com/blog/touchbar/ available on Linux.

Disclaimer: not a current user of a Touchbar Mac, but was offered at work some time ago and got interested on using it with Linux.

Caps Lock LED (and keyboard brightness) stuck after a while (MacBook Pro 14,1)

For some reason I can't find any info on this bug, but whatever distro/DE/WM I'm using, for some reason, when booting my computer it's actually working, but after some moment (can be a few minutes or a few hours) the caps lock LED/keyboard brightness do not want to change their setting. For example, about the caps lock LED, even setting echo 0 | sudo tee /sys/class/leds/input5::capslock/brightness or echo 1 (on both input5/input13) does not work: the values are set but the LED will remain turned on no matter what.

MacBook Pro 14,1, using Manjaro here (but as I said I've had this problem in Fedora too so it's not distro-dependant), i3wm (but this happens in KDE/GNOME too so not WM/DE dependant)

Disable Touchpad While Typing: No synaptics properties on device

Just installed fresh version of Debian 10 on MBP 14,3. I have to say you have all done fantastic work on this. Four lines to get keyboard, touchpad and touchbar working! This is great.

Has there ever been support for synaptics on the touchpad? I thought in the previous version I had installed (one file) that I had turned off the touchpad while typing, but that option is not available anymore (xfce).

When I try to manually do it with the daemon:

$syndaemon -k -i 1 -d

I get pain.

No synaptics properties on device 'Apple SPI Touchpad'.

Has anyone looked in to this? Has it already been done and then dropped? I'm not so good with C but I could try and haul it back if it is laying around.

repo info

these lines:
git clone https://github.com/cb22/macbook12-spi-driver.git /usr/src/applespi-0.1
and
git clone https://github.com/cb22/macbook12-spi-driver.git /usr/src/applespi-0.1
reference the forked repo and not yours, so when installing on a touchbar mac the appletb driver isn't included after running dkms install -m applespi -v 0.1

changing "cb22" to "roadrunner2" worked.

Many thanks for your hard work!

Touchbar stay on all the time.

Hi,
I noticed the touchbar stays on all the time now. I'm running kernel: 4.17.6-200.fc28.x86_64
Below is the dmesg |grep appletb
[root@snguyenfed power]# dmesg |grep appletb
[ 1.536839] appletb: Touchbar usb device added; dev=0003:05AC:8600.0001
[ 1.537194] appletb: Connected to keyboard input device
[ 1.537195] appletb: Connected to keyboard input device
[ 1.537271] appletb: Connected to touchpad input device
[ 1.537272] appletb: Connected to touchpad input device
[ 1.636050] appletb: Failed to set touchbar display to 1 (-32)
[ 1.658260] Modules linked in: amdkfd amd_iommu_v2 amdgpu(+) spi_pxa2xx_platform chash i2c_algo_bit gpu_sched drm_kms_helper ttm crct10dif_pclmul crc32_pclmul crc32c_intel nvme drm intel_lpss_pci nvme_core intel_lpss ghash_clmulni_intel appletb(OE) applespi(OE)
[ 300.092614] appletb: Failed to set touchbar display to 1 (-32)
[ 594.975370] appletb: Failed to set touchbar display to 1 (-32)
[ 840.753906] appletb: Failed to set touchbar display to 1 (-32)

Touchpad does not work for MacbookPro 14,3 with Ubuntu 20.04

I have tried Ubuntu 19.10 on the MacbookPro-14,3 model. Most of it worked out of the box, including the Touchpad and WiFi. Bluetooth and sound didn't work.

With Ubuntu 20.04 release, first I tried to upgrade, which failed with some errors. Then I tried reinstalling with 20.04. After installation, the Touchpad, Bluetooth, and sound didn't work. And the machine will freeze from time to time. The keyboard and WiFi worked without problems.

I checked the kernel drivers. 'applespi', 'spi_pxa2xx_platform', and 'intel_lpss_pci' were already loaded. With Ubuntu 19.10, with 'xinput --list', I could see the Touchpad listed, but for Ubuntu 20.04 the Touchpad was not listed.

Currently, I switched back to 19.10. Is there anything I can try further to get the machine working with Ubuntu 20.04? Or to provide any detailed logs?

Can't compile on 5.4.1

root@linux:/usr/src/applespi-0.1# sudo dkms install applespi/0.1

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j8 KERNELRELEASE=5.4.1-050401-generic...(bad exit status: 2)
ERROR (dkms apport): binary package for applespi: 0.1 not found
Error! Bad return status for module build on kernel: 5.4.1-050401-generic (x86_64)
Consult /var/lib/dkms/applespi/0.1/build/make.log for more information.

From the makelog:

...
./include/asm-generic/bug.h:155:3: note: in expansion of macro ‘WARN’
   WARN(1, format);    \
   ^~~~
/var/lib/dkms/applespi/0.1/build/applespi.c:557:3: note: in expansion of macro ‘WARN_ONCE’
   WARN_ONCE(1, "Unknown msg type %d", type);
   ^~~~~~~~~
scripts/Makefile.build:265: recipe for target '/var/lib/dkms/applespi/0.1/build/applespi.o' failed
make[2]: *** [/var/lib/dkms/applespi/0.1/build/applespi.o] Error 1
Makefile:1652: recipe for target '/var/lib/dkms/applespi/0.1/build' failed
make[1]: *** [/var/lib/dkms/applespi/0.1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.1-050401-generic'
Makefile:16: recipe for target 'all' failed
make: *** [all] Error 2

Makefile shows a lot, mostly all similar to the top 2 lines there. Let me know if a full log is needed/useful. I really just need touchbar so if there's an easier way then that'll be nice.

Race condition for shown state in TouchBar

As already mentioned in Dunedan/mbp-2016-linux#5 (comment) I noticed a race condition in appletb, causing it to show the wrong keys in the TouchBar. I just want to ensure this issue is still on the radar.

As it happens during regular use it's quite enjoying, because the TouchBar suddenly shows the wrong state. E.g. with fnmode = 2 pressing fn should get me from function keys displayed to special keys displayed. Once that bug occurs the special keys stay displayed on the TouchBar even if no key is pressed anymore. Only pressing fn a few times brings it back in such a case. That correlates with the TouchBar sometimes being unresponsive in such cases.

Aside from happening during regular usage it's also possible to force this issue by frequent key presses (e.g. fn and left ctrl together). Forcing the issue can be a bit tricky, but I'm able to reliably reproduce it.

My best guess is that it's somehow a race condition between the state the TouchBar currently is in and the state it should be in causing one command to change the state not being submitted to the TouchBar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.