Driver not working on kernel 6.10.6-200.fc40.x86_64
DKMS make.log for applespi-0.1 for kernel 6.10.6-200.fc40.x86_64 (x86_64) Wed Aug 28 02:38:45 AM EDT 2024 make -C /lib/modules/6.10.6-200.fc40.x86_64/build M=/var/lib/dkms/applespi/0.1/build modules make[1]: Entering directory '/usr/src/kernels/6.10.6-200.fc40.x86_64' CC [M] /var/lib/dkms/applespi/0.1/build/apple-ibridge.o CC [M] /var/lib/dkms/applespi/0.1/build/apple-ib-tb.o CC [M] /var/lib/dkms/applespi/0.1/build/apple-ib-als.o /var/lib/dkms/applespi/0.1/build/apple-ib-tb.c: In function ‘appletb_fill_report_info’: /var/lib/dkms/applespi/0.1/build/apple-ib-tb.c:949:9: warning: enumeration value ‘HID_REPORT_TYPES’ not handled in switch [-Wswitch] 949 | switch (field->report->type) { | ^~~~~~ /var/lib/dkms/applespi/0.1/build/apple-ibridge.c:192:6: warning: no previous prototype for ‘appleib_detach_and_free_hid_driver’ [-Wmissing-prototypes] 192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/lib/dkms/applespi/0.1/build/apple-ibridge.c:901:10: error: ‘struct acpi_driver’ has no member named ‘owner’ 901 | .owner = THIS_MODULE, | ^~~~~ In file included from ./arch/x86/include/asm/mem_encrypt.h:15, from ./include/linux/mem_encrypt.h:17, from ./arch/x86/include/asm/processor-flags.h:6, from ./arch/x86/include/asm/irqflags.h:5, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from ./include/linux/resource_ext.h:11, from ./include/linux/acpi.h:13, from /var/lib/dkms/applespi/0.1/build/apple-ibridge.c:45: ./include/linux/init.h:180:21: error: initialization of ‘const struct acpi_device_id *’ from incompatible pointer type ‘struct module *’ [-Wincompatible-pointer-types] 180 | #define THIS_MODULE (&__this_module) | ^ /var/lib/dkms/applespi/0.1/build/apple-ibridge.c:901:27: note: in expansion of macro ‘THIS_MODULE’ 901 | .owner = THIS_MODULE, | ^~~~~~~~~~~ ./include/linux/init.h:180:21: note: (near initialization for ‘appleib_driver.ids’) 180 | #define THIS_MODULE (&__this_module) | ^ /var/lib/dkms/applespi/0.1/build/apple-ibridge.c:901:27: note: in expansion of macro ‘THIS_MODULE’ 901 | .owner = THIS_MODULE, | ^~~~~~~~~~~ make[3]: *** [scripts/Makefile.build:244: /var/lib/dkms/applespi/0.1/build/apple-ibridge.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/usr/src/kernels/6.10.6-200.fc40.x86_64/Makefile:1946: /var/lib/dkms/applespi/0.1/build] Error 2 make[1]: *** [Makefile:252: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/kernels/6.10.6-200.fc40.x86_64' make: *** [Makefile:22: all] Error 2
Here is the log file. Please help :(
Thanks!
Edit:
I tried almas, ecos-hj and BrianValente branches but neither of their fixes worked for me.
i have same problem this driver is not working on kernel 6 version
i downloaded and used the almas version for linux kernel 6.1.0-25 and was able to get it to compile after changing 2 lines of code that errored
i solved apple-ib-tb.c:949 by adding default: break; on line 956-957 after case HID_FEATURE_REPORT: report_info->report_type = 3; break; on 954-955
i was only given one other error apple-ibridge.c:905 which i fixed by changing void in static void appleib_remove(struct acpi_device *acpi) on 846 to int and return; on 852 to return 1;
after compilation and reboot, i needed to run sudo echo '1-3' > /sys/bus/usb/drivers/usb/unbind && sudo echo '1-3' > /sys/bus/usb/drivers/usb/bind to get the touchbar to work as recommended here https://github.com/roadrunner2/macbook12-spi-driver/issues/42#issuecomment-602160740
Is this repository being regularly merged to linux kernel?
Hey, I got the driver running on my Ubuntu 24.04 install on a mbp13,2 on kernel 6.8 for a while, with the patches from this issue aswell as the macbook-quirks.service from issue #42. Recently I upgraded to kernel 6.11 and I cant get the driver to work anymore. I fixed some more compile errors, but even after that the touchbar wont turn on anymore. Will upload my fixes and dmesg logs later, maybe someone can help 🍻
Thank you for your efforts. I'm trying to bring a MacBook 8,1 back to life. That model had a very bad reputation due to over heating. Surprisedly, one can get a marvelous user experience with that machine and ubuntu. It works really fast and fluid and no overheating at all. Sadly, suspension mode, keyboard+touchpad, bluetooth and audio (only jack output is working) are preventing me from making a daily use of that machine.
Please check my fork https://github.com/jussike/macbook12-spi-driver/commits/touchbar-driver-hid-driver/
It can be compiled against newer kernel, 6.8 at least. You'll not need to compile applespi at all because it's already merged to mainline. It's removed on my fork.
Please check my fork https://github.com/jussike/macbook12-spi-driver/commits/touchbar-driver-hid-driver/
It can be compiled against newer kernel, 6.8 at least. You'll not need to compile applespi at all because it's already merged to mainline. It's removed on my fork.
fails to compile on arch, kernel 6.13.7, mbp 14,3. please advice
DKMS (dkms-3.1.6) make.log for applespi/0.1 for kernel 6.13.7-arch1-1 (x86_64)
Wed Mar 19 03:06:07 CET 2025
Cleaning build area
# command: make clean
make -C /lib/modules/6.13.7-arch1-1/build M=/var/lib/dkms/applespi/0.1/build clean
make[1]: Entering directory '/usr/lib/modules/6.13.7-arch1-1/build'
make[2]: Entering directory '/var/lib/dkms/applespi/0.1/build'
make[2]: Leaving directory '/var/lib/dkms/applespi/0.1/build'
make[1]: Leaving directory '/usr/lib/modules/6.13.7-arch1-1/build'
# exit code: 0
# elapsed time: 00:00:00
----------------------------------------------------------------
Building module(s)
# command: make -j8 KERNELRELEASE=6.13.7-arch1-1
make -C /lib/modules/6.13.7-arch1-1/build M=/var/lib/dkms/applespi/0.1/build modules
make[1]: Entering directory '/usr/lib/modules/6.13.7-arch1-1/build'
make[2]: Entering directory '/var/lib/dkms/applespi/0.1/build'
CC [M] apple-ibridge.o
CC [M] apple-ib-tb.o
CC [M] apple-ib-als.o
apple-ib-als.c:679:19: error: initialization of ‘void (*)(struct platform_device *)’ from incompatible pointer type ‘int (*)(struct platform_device *)’ [-Wincompatible-pointer-types]
679 | .remove = appleals_platform_remove,
| ^~~~~~~~~~~~~~~~~~~~~~~~
apple-ib-als.c:679:19: note: (near initialization for ‘appleals_platform_driver.remove’)
apple-ib-tb.c:1295:19: error: initialization of ‘void (*)(struct platform_device *)’ from incompatible pointer type ‘int (*)(struct platform_device *)’ [-Wincompatible-pointer-types]
1295 | .remove = appletb_platform_remove,
| ^~~~~~~~~~~~~~~~~~~~~~~
apple-ib-tb.c:1295:19: note: (near initialization for ‘appletb_platform_driver.remove’)
make[4]: *** [/usr/lib/modules/6.13.7-arch1-1/build/scripts/Makefile.build:196: apple-ib-als.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [/usr/lib/modules/6.13.7-arch1-1/build/scripts/Makefile.build:196: apple-ib-tb.o] Error 1
apple-ibridge.c:752:25: error: initialization of ‘const __u8 * (*)(struct hid_device *, __u8 *, unsigned int *)’ {aka ‘const unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)’} from incompatible pointer type ‘__u8 * (*)(struct hid_device *, __u8 *, unsigned int *)’ {aka ‘unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)’} [-Wincompatible-pointer-types]
752 | .report_fixup = appleib_report_fixup,
| ^~~~~~~~~~~~~~~~~~~~
apple-ibridge.c:752:25: note: (near initialization for ‘appleib_hid_driver.report_fixup’)
apple-ibridge.c:901:10: error: ‘struct acpi_driver’ has no member named ‘owner’
901 | .owner = THIS_MODULE,
| ^~~~~
In file included from /usr/lib/modules/6.13.7-arch1-1/build/arch/x86/include/asm/mem_encrypt.h:15,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/mem_encrypt.h:17,
from /usr/lib/modules/6.13.7-arch1-1/build/arch/x86/include/asm/processor-flags.h:6,
from /usr/lib/modules/6.13.7-arch1-1/build/arch/x86/include/asm/irqflags.h:5,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/irqflags.h:18,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/spinlock.h:59,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/mmzone.h:8,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/gfp.h:7,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/slab.h:16,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/resource_ext.h:11,
from /usr/lib/modules/6.13.7-arch1-1/build/include/linux/acpi.h:13,
from apple-ibridge.c:45:
/usr/lib/modules/6.13.7-arch1-1/build/include/linux/init.h:180:21: error: initialization of ‘const struct acpi_device_id *’ from incompatible pointer type ‘struct module *’ [-Wincompatible-pointer-types]
180 | #define THIS_MODULE (&__this_module)
| ^
apple-ibridge.c:901:27: note: in expansion of macro ‘THIS_MODULE’
901 | .owner = THIS_MODULE,
| ^~~~~~~~~~~
/usr/lib/modules/6.13.7-arch1-1/build/include/linux/init.h:180:21: note: (near initialization for ‘appleib_driver.ids’)
180 | #define THIS_MODULE (&__this_module)
| ^
apple-ibridge.c:901:27: note: in expansion of macro ‘THIS_MODULE’
901 | .owner = THIS_MODULE,
| ^~~~~~~~~~~
make[4]: *** [/usr/lib/modules/6.13.7-arch1-1/build/scripts/Makefile.build:196: apple-ibridge.o] Error 1
make[3]: *** [/usr/lib/modules/6.13.7-arch1-1/build/Makefile:1989: .] Error 2
make[2]: *** [/usr/lib/modules/6.13.7-arch1-1/build/Makefile:251: __sub-make] Error 2
make[2]: Leaving directory '/var/lib/dkms/applespi/0.1/build'
make[1]: *** [Makefile:251: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.13.7-arch1-1/build'
make: *** [Makefile:13: all] Error 2
# exit code: 2
# elapsed time: 00:00:01
----------------------------------------------------------------
Hello. I have a macbook 8,1, running ubuntu 24.04 with the 6.8 kernel. My keyboard and trackpad sometimes do work upon rebooting, and sometimes do not. I am trying the touchbar-driver-hid-driver/ branch. I get the same error as I did with the original driver from the main branch. Here is what I see:
root@macbook:~# dkms install -m applespi -v 0.1
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/applespi/0.1/source/dkms.conf)
Building module:
Cleaning build area...
make -j4 KERNELRELEASE=6.8.0-55-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: 6.8.0-55-generic (x86_64)
Consult /var/lib/dkms/applespi/0.1/build/make.log for more information.
and here is what the make.log tells me:
DKMS make.log for applespi-0.1 for kernel 6.8.0-55-generic (x86_64)
Do 20. Mär 11:48:56 +0330 2025
make -C /lib/modules/6.8.0-55-generic/build M=/var/lib/dkms/applespi/0.1/build modules
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-55-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
You are using: gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
CC [M] /var/lib/dkms/applespi/0.1/build/applespi.o
CC [M] /var/lib/dkms/applespi/0.1/build/apple-ibridge.o
CC [M] /var/lib/dkms/applespi/0.1/build/apple-ib-tb.o
CC [M] /var/lib/dkms/applespi/0.1/build/apple-ib-als.o
/var/lib/dkms/applespi/0.1/build/apple-ibridge.c:192:6: warning: no previous prototype for ‘appleib_detach_and_free_hid_driver’ [-Wmissing-proto>
192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/applespi/0.1/build/apple-ib-tb.c: In function ‘appletb_fill_report_info’:
/var/lib/dkms/applespi/0.1/build/apple-ib-tb.c:949:9: warning: enumeration value ‘HID_REPORT_TYPES’ not handled in switch [-Wswitch]
949 | switch (field->report->type) {
| ^~~~~~
/var/lib/dkms/applespi/0.1/build/apple-ibridge.c:905:35: error: initialization of ‘void (*)(struct acpi_device *)’ from incompatible pointer typ>
905 | .remove = appleib_remove,
| ^~~~~~~~~~~~~~
/var/lib/dkms/applespi/0.1/build/apple-ibridge.c:905:35: note: (near initialization for ‘appleib_driver.ops.remove’)
/var/lib/dkms/applespi/0.1/build/apple-ib-als.c: In function ‘appleals_config_iio’:
/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:463:36: warning: passing argument 1 of ‘iio_device_alloc’ makes pointer from integer without a c>
463 | iio_dev = iio_device_alloc(sizeof(als_dev));
| ^~~~~~~~~~~~~~~
| |
| long unsigned int
In file included from ./include/linux/iio/buffer.h:10,
from /var/lib/dkms/applespi/0.1/build/apple-ib-als.c:32:
./include/linux/iio/iio.h:733:49: note: expected ‘struct device *’ but argument is of type ‘long unsigned int’
733 | struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv);
| ~~~~~~~~~~~~~~~^~~~~~
/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:463:19: error: too few arguments to function ‘iio_device_alloc’
463 | iio_dev = iio_device_alloc(sizeof(als_dev));
| ^~~~~~~~~~~~~~~~
./include/linux/iio/iio.h:733:17: note: declared here
733 | struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv);
| ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/applespi/0.1/build/apple-ib-als.c:36:
/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:485:72: error: ‘struct iio_dev’ has no member named ‘id’
485 | iio_trig = iio_trigger_alloc("%s-dev%d", iio_dev->name, iio_dev->id);
| ^~
./include/linux/iio/trigger.h:160:61: note: in definition of macro ‘iio_trigger_alloc’
160 | __iio_trigger_alloc((parent), THIS_MODULE, (fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
./include/linux/iio/trigger.h:160:29: error: passing argument 1 of ‘__iio_trigger_alloc’ from incompatible pointer type [-Werror=incompatible-po>
160 | __iio_trigger_alloc((parent), THIS_MODULE, (fmt), ##__VA_ARGS__)
| ^~~~~~~~
| |
| char *
/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:485:20: note: in expansion of macro ‘iio_trigger_alloc’
485 | iio_trig = iio_trigger_alloc("%s-dev%d", iio_dev->name, iio_dev->id);
| ^~~~~~~~~~~~~~~~~
./include/linux/iio/trigger.h:163:56: note: expected ‘struct device *’ but argument is of type ‘char *’
163 | struct iio_trigger *__iio_trigger_alloc(struct device *parent,
| ~~~~~~~~~~~~~~~^~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/applespi/0.1/build/apple-ib-als.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/var/lib/dkms/applespi/0.1/build/applespi.c: In function ‘applespi_setup_read_txfrs’:
/var/lib/dkms/applespi/0.1/build/applespi.c:590:13: error: ‘struct spi_transfer’ has no member named ‘delay_usecs’
590 | dl_t->delay_usecs = applespi->spi_settings.spi_cs_delay;
| ^~
/var/lib/dkms/applespi/0.1/build/applespi.c: In function ‘applespi_setup_write_txfrs’:
/var/lib/dkms/applespi/0.1/build/applespi.c:619:13: error: ‘struct spi_transfer’ has no member named ‘delay_usecs’
619 | wt_t->delay_usecs = SPI_RW_CHG_DELAY_US;
| ^~
/var/lib/dkms/applespi/0.1/build/applespi.c:622:13: error: ‘struct spi_transfer’ has no member named ‘delay_usecs’
622 | dl_t->delay_usecs = applespi->spi_settings.spi_cs_delay;
| ^~
/var/lib/dkms/applespi/0.1/build/applespi.c:626:13: error: ‘struct spi_transfer’ has no member named ‘delay_usecs’
626 | wr_t->delay_usecs = SPI_RW_CHG_DELAY_US;
| ^~
/var/lib/dkms/applespi/0.1/build/applespi.c: In function ‘applespi_get_saved_bl_level’:
/var/lib/dkms/applespi/0.1/build/applespi.c:1794:38: error: invalid application of ‘sizeof’ to incomplete type ‘struct efivar_entry’
1794 | efivar_entry = kmalloc(sizeof(*efivar_entry), GFP_KERNEL);
| ^
In file included from ./include/linux/string.h:292,
from ./include/linux/bitmap.h:12,
from ./include/linux/cpumask.h:12,
from ./arch/x86/include/asm/paravirt.h:21,
from ./arch/x86/include/asm/irqflags.h:60,
from ./include/linux/irqflags.h:18,
from ./include/linux/spinlock.h:59,
from ./include/linux/mmzone.h:8,
from ./include/linux/gfp.h:7,
from ./include/linux/slab.h:16,
from ./include/linux/resource_ext.h:11,
from ./include/linux/acpi.h:13,
from /var/lib/dkms/applespi/0.1/build/applespi.c:44:
/var/lib/dkms/applespi/0.1/build/applespi.c:1798:28: error: invalid use of undefined type ‘struct efivar_entry’
1798 | memcpy(efivar_entry->var.VariableName, EFI_BL_LEVEL_NAME,
| ^~
./include/linux/fortify-string.h:596:34: note: in definition of macro ‘__fortify_memcpy_chk’
596 | const size_t __p_size = (p_size); \
| ^~~~~~
./include/linux/fortify-string.h:653:17: note: in expansion of macro ‘__struct_size’
653 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
/var/lib/dkms/applespi/0.1/build/applespi.c:1798:9: note: in expansion of macro ‘memcpy’
1798 | memcpy(efivar_entry->var.VariableName, EFI_BL_LEVEL_NAME,
| ^~~~~~
/var/lib/dkms/applespi/0.1/build/applespi.c:1798:28: error: invalid use of undefined type ‘struct efivar_entry’
1798 | memcpy(efivar_entry->var.VariableName, EFI_BL_LEVEL_NAME,
| ^~
./include/linux/fortify-string.h:598:40: note: in definition of macro ‘__fortify_memcpy_chk’
598 | const size_t __p_size_field = (p_size_field); \
| ^~~~~~~~~~~~
./include/linux/fortify-string.h:654:17: note: in expansion of macro ‘__member_size’
654 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
/var/lib/dkms/applespi/0.1/build/applespi.c:1798:9: note: in expansion of macro ‘memcpy’
1798 | memcpy(efivar_entry->var.VariableName, EFI_BL_LEVEL_NAME,
| ^~~~~~
/var/lib/dkms/applespi/0.1/build/applespi.c:1798:28: error: invalid use of undefined type ‘struct efivar_entry’
1798 | memcpy(efivar_entry->var.VariableName, EFI_BL_LEVEL_NAME,
| ^~
./include/linux/fortify-string.h:607:27: note: in definition of macro ‘__fortify_memcpy_chk’
607 | __underlying_##op(p, q, __fortify_size); \
| ^
/var/lib/dkms/applespi/0.1/build/applespi.c:1798:9: note: in expansion of macro ‘memcpy’
1798 | memcpy(efivar_entry->var.VariableName, EFI_BL_LEVEL_NAME,
| ^~~~~~
/var/lib/dkms/applespi/0.1/build/applespi.c:1800:21: error: invalid use of undefined type ‘struct efivar_entry’
1800 | efivar_entry->var.VendorGuid = EFI_BL_LEVEL_GUID;
| ^~
/var/lib/dkms/applespi/0.1/build/applespi.c:1803:15: error: implicit declaration of function ‘efivar_entry_get’; did you mean ‘efi_mokvar_entry_>
1803 | sts = efivar_entry_get(efivar_entry, NULL, &efi_data_len, &efi_data);
| ^~~~~~~~~~~~~~~~
| efi_mokvar_entry_next
/var/lib/dkms/applespi/0.1/build/applespi.c: In function ‘applespi_save_bl_level’:
/var/lib/dkms/applespi/0.1/build/applespi.c:1830:15: error: implicit declaration of function ‘efivar_entry_set_safe’ [-Werror=implicit-function->
1830 | sts = efivar_entry_set_safe((efi_char16_t *)EFI_BL_LEVEL_NAME, efi_guid,
| ^~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/applespi/0.1/build/applespi.c: At top level:
/var/lib/dkms/applespi/0.1/build/applespi.c:2228:27: error: initialization of ‘void (*)(struct spi_device *)’ from incompatible pointer type ‘in>
2228 | .remove = applespi_remove,
| ^~~~~~~~~~~~~~~
/var/lib/dkms/applespi/0.1/build/applespi.c:2228:27: note: (near initialization for ‘applespi_driver.remove’)
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/applespi/0.1/build/applespi.o] Error 1
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/applespi/0.1/build/apple-ibridge.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.8.0-55-generic/Makefile:1925: /var/lib/dkms/applespi/0.1/build] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-55-generic'
make: *** [Makefile:16: all] Error 2
Any ideas?
Hello. I have a macbook 8,1, running ubuntu 24.04 with the 6.8 kernel. My keyboard and trackpad sometimes do work upon rebooting, and sometimes do not. I am trying the touchbar-driver-hid-driver/ branch. I get the same error as I did with the original driver from the main branch. Here is what I see:
Any ideas?
Seems that you are using wrong branch or commit. See the current hash with command $ git rev-parse --short HEAD It should give 774b401
Please check my fork https://github.com/jussike/macbook12-spi-driver/commits/touchbar-driver-hid-driver/ It can be compiled against newer kernel, 6.8 at least. You'll not need to compile applespi at all because it's already merged to mainline. It's removed on my fork.
fails to compile on arch, kernel 6.13.7, mbp 14,3. please advice
I have no time to install 6.13 today but I fixed compiling against 6.11 https://github.com/jussike/macbook12-spi-driver/commits/touchbar-driver-hid-driver-linux-6.11
And I made a fix for 6.13 also but I didn't try even to compile it. Please try: https://github.com/jussike/macbook12-spi-driver/commits/touchbar-driver-hid-driver-linux-6.13
@jussike @tkalant use the patched version from almas https://github.com/almas/macbook12-spi-driver in combination with the macbook-quircks.service from issue #42. worked for me on 6.8
sadly maintianer is afk and wont merge changes into the repo so u need to find the patched forks for yourself
Seems that you are using wrong branch or commit. See the current hash with command $ git rev-parse --short HEAD It should give 774b401
Hello @jussike Thank you for responding. You were right. I cloned the correct repository, ran the installation, and it seems like it went without a problem, but I keep having the same issue. After rebooting sometimes the keyboard works and sometimes not - here is what I see after installing:
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Deprecated feature: REMAKE_INITRD (/usr/src/applespi-0.1/dkms.conf)
Creating symlink /var/lib/dkms/applespi/0.1/source -> /usr/src/applespi-0.1
Building module:
Cleaning build area...
make -j4 KERNELRELEASE=6.8.0-55-generic....
Signing module /var/lib/dkms/applespi/0.1/build/apple-ibridge.ko
Signing module /var/lib/dkms/applespi/0.1/build/apple-ib-tb.ko
Signing module /var/lib/dkms/applespi/0.1/build/apple-ib-als.ko
Cleaning build area...
apple-ibridge.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-55-generic/updates/dkms/
apple-ib-tb.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-55-generic/updates/dkms/
apple-ib-als.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-55-generic/updates/dkms/
depmod....
I have no time to install 6.13 today but I fixed compiling against 6.11 https://github.com/jussike/macbook12-spi-driver/commits/touchbar-driver-hid-driver-linux-6.11
I also installed kernel 6.11, changed to that kernel on grub when booting, and ran the installation from the 6.11 branch you made yesterday. I made sure I am on the c0cf3bf commit. That did not work, here is what I saw:
Building module:
Cleaning build area...
make -j4 KERNELRELEASE=6.11.0-061100-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: 6.11.0-061100-generic (x86_64)
Consult /var/lib/dkms/applespi/0.1/build/make.log for more information.
use the patched version from almas https://github.com/almas/macbook12-spi-driver in combination with the macbook-quircks.service from issue #42. worked for me on 6.8
@arag0re Thank you. I tried this version from almas with 6.8 kernel, it did not work for me. Kept getting the same error as before. And it seems to me (might be wrong) that the macbook-quirks.service is related to the touchbar, which my macbook does not have.
After rebooting sometimes the keyboard works and sometimes not
My fork has no keyboard/touchpad driver bc it's a part of upstream kernel (applespi). Perhaps you should report the upstream driver maintainer. You may use my fork as a touchbar driver if you have any on your device.
Consult /var/lib/dkms/applespi/0.1/build/make.log for more information.
You didn't attach the make.log
My fork has no keyboard/touchpad driver bc it's a part of upstream kernel (applespi). Perhaps you should report the upstream driver maintainer. You may use my fork as a touchbar driver if you have any on your device.
I didn't realize your fork does not have a driver for the keyboard. there is no touchar on my device so I guess I only have the original repository to try (roadrunner) as an option, which did not work. Thank you anyway.
And I made a fix for 6.13 also but I didn't try even to compile it. Please try: https://github.com/jussike/macbook12-spi-driver/commits/touchbar-driver-hid-driver-linux-6.13
the 6.13 fix compiled, installed and works well for me. thank you!
EDIT2: I SOLVED IT! I'LL LATER POST THE SOLUTION!
Hi everyone,
I'm trying to get Linux fully working on my MacBook Pro 13,2 as a replacement for macOS — I'm really tired of macOS, but the hardware is still great, so I'd love to keep using this machine.
I've managed to get both Wi-Fi and sound working, but I'm still stuck on getting the Touch Bar to function. I've tried various versions of the applespi/apple_ibridge modules, including several branches like the 6.11/13 fix versions, but no luck so far.
Currently, I'm running Kubuntu 22.04 with the 6.8.0-59 kernel. The modules install without errors and appear to load correctly (outputs attached below), but the Touch Bar remains completely off — no response at all. I’ve tried various workarounds, but nothing has helped.
Interestingly, I had it working in the past with Ubuntu 18, but now it seems much harder to get it going.
For installing I completely wiped the disk after making a EFI partition wipe, to retain the EmbeddedOS part needed by the touchbar, and in fact if I boot in macOS recovery mode (option+r) the touchbar works, so I think it is not missing the firmware.
I also tried removing usbmuxd to rule that out, but it didn’t help.
Also tried to use the touchbar-reset.service and this:
echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind
echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/bind
and get his in journalctl:
mag 15 21:35:51 scutigliani-MacBookPro systemd[1]: Starting Re-enable MacBook 13,2 TouchBar...
mag 15 21:35:53 scutigliani-MacBookPro acpid[535]: input device has been disconnected, fd 10
mag 15 21:35:53 scutigliani-MacBookPro iio-sensor-prox[24058]: Failed to open directory '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/0003:05AC:8600.001D/HID-SENSOR-200041.1.auto/iio:device0/scan_elements': Error opening directory “/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/0003:05AC:8600.001D/HID-SENSOR-200041.1.auto/iio:device0/scan_elements”: File o directory non esistente
mag 15 21:35:53 scutigliani-MacBookPro iio-sensor-prox[24058]: Could not open for write '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/0003:05AC:8600.001D/HID-SENSOR-200041.1.auto/iio:device0/buffer/enable'
mag 15 21:35:53 scutigliani-MacBookPro systemd[1]: iio-sensor-proxy.service: Deactivated successfully.
mag 15 21:35:53 scutigliani-MacBookPro kernel: usb 1-3: Found UVC 1.50 device iBridge (05ac:8600)
mag 15 21:35:54 scutigliani-MacBookPro kernel: input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.001E/input/input38
mag 15 21:35:54 scutigliani-MacBookPro kernel: apple-ibridge-hid 0003:05AC:8600.001E: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
mag 15 21:35:54 scutigliani-MacBookPro kernel: hid-sensor-hub 0003:05AC:8600.001F: hiddev0,hidraw1: USB HID v1.01 Device [Apple Inc. iBridge] on usb-0000:00:14.0-3/input3
mag 15 21:35:54 scutigliani-MacBookPro systemd[1]: Finished Re-enable MacBook 13,2 TouchBar.
Has anyone had recent success with the Touch Bar on this model? Any ideas or things I could try would be really appreciated.
Thanks!
@jussike (pinging you because I think your fork is the best fit for my situation)
(base) scutigliani@scutigliani-MacBookPro:~$ lsmod | grep "apple"
apple_ib_tb 32768 0
apple_ib_als 20480 0
industrialio_triggered_buffer 12288 2 hid_sensor_trigger,apple_ib_als
applesmc 28672 0
industrialio 126976 6 industrialio_triggered_buffer,hid_sensor_trigger,kfifo_buf,apple_ib_als,hid_sensor_als
apple_mfi_fastcharge 16384 0
apple_ibridge 24576 2 apple_ib_als,apple_ib_tb
hid 180224 7 usbhid,apple_ib_als,hid_sensor_hub,hid_generic,apple_ibridge,uhid,hid_logitech_hidpp
applespi 53248 0
(base) scutigliani@scutigliani-MacBookPro:~$ sudo dmesg | grep -iE "firmware|ibridge|apple_ib_tb"
[sudo] password di scutigliani:
[ 0.130193] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[ 1.696967] usb 1-3: Product: iBridge
[ 1.877094] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0001/input/input6
[ 1.890737] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/skl_dmc_ver1_27.bin (v1.27)
[ 1.928541] hid-generic 0003:05AC:8600.0001: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ 1.929184] hid-generic 0003:05AC:8600.0002: hiddev0,hidraw1: USB HID v1.01 Device [Apple Inc. iBridge] on usb-0000:00:14.0-3/input3
[ 1.931372] hid-sensor-hub 0003:05AC:8600.0002: hiddev0,hidraw1: USB HID v1.01 Device [Apple Inc. iBridge] on usb-0000:00:14.0-3/input3
[ 7.665145] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0001/input/input8
[ 7.718235] apple-ibridge-hid 0003:05AC:8600.0001: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ 8.273569] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[ 8.380815] usb 1-3: Found UVC 1.50 device iBridge (05ac:8600)
[ 8.429832] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.Apple Inc.-MacBookPro13,2.bin failed with error -2
[ 8.435922] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.clm_blob failed with error -2
[ 8.435976] brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txcap_blob failed with error -2
[ 8.506547] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0001/input/input9
[ 8.592612] apple-ibridge-hid 0003:05AC:8600.0001: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ 8.690439] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0001/input/input10
[ 8.722972] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43602/2 wl0: Nov 10 2015 06:38:10 version 7.35.177.61 (r598657) FWID 01-ea662a8c
[ 8.745539] apple-ibridge-hid 0003:05AC:8600.0001: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ 13.723966] usb 1-3: Found UVC 1.50 device iBridge (05ac:8600)
[ 13.726486] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0003/input/input16
[ 13.778534] apple-ibridge-hid 0003:05AC:8600.0003: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ 13.781010] hid-sensor-hub 0003:05AC:8600.0004: hiddev0,hidraw1: USB HID v1.01 Device [Apple Inc. iBridge] on usb-0000:00:14.0-3/input3
(base) scutigliani@scutigliani-MacBookPro:~$ sudo 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
# applespi
industrialio_triggered_buffer
applespi
appleibridge
spi_pxa2xx_platform
intel_lpss_pci
EDIT: Other logs I was able to extract:
[ +0,035601] usb 1-3: Found UVC 1.50 device iBridge (05ac:8600)
[ +0,003968] tb: tb: !!! appletb_probe (HID) CALLED for hdev: 0003:05AC:8600.000C !!!
[ +0,000005] tb: tb: appletb_probe (HID): tb_dev is 000000004c11b429
[ +0,000003] tb: tb: appletb_probe (HID): tb_dev->log_dev is 00000000738d92bc (APP7777:00)
[ +0,000002] tb: tb: --> appletb_probe(hdev name: 0003:05AC:8600.000C, matched hid_id bus:0x3 vendor:0x5ac product:0x8600 driver_data:0xffff8f8118cd3c28)
[ +0,000004] tb: tb: SIMPLE DBG: appletb_probe (HID) entry for 0003:05AC:8600.000C
[ +0,000001] tb: tb: appletb_probe: Calling appletb_fill_report_info for hdev 0003:05AC:8600.000C
[ +0,000002] tb: tb: --> appletb_fill_report_info(hdev name: 0003:05AC:8600.000C)
[ +0,000005] tb: tb: appletb_fill_report_info: Found MODE field (HID_GD_KEYBOARD, HID_USAGE_MODE)
[ +0,000001] tb: tb: appletb_fill_report_info: Interface is for MODE
[ +0,000004] tb: tb: --> appletb_get_usb_iface(hdev name: 0003:05AC:8600.000C)
[ +0,000001] tb: tb: appletb_get_usb_iface: Traversing up from dev 0003:05AC:8600.000C (type NULL) to parent
[ +0,000005] tb: tb: <-- appletb_get_usb_iface() Found usb_interface: 1-3:1.2
[ +0,000002] tb: tb: appletb_fill_report_info: report_info->hdev set to 000000000694472f (0003:05AC:8600.000C)
[ +0,000001] tb: tb: appletb_fill_report_info: report_info->usb_iface set to 00000000beb48edf (1-3:1.2)
[ +0,000002] tb: tb: appletb_fill_report_info: report_id=2, report_type=0x2 (from field->report->type=1)
[ +0,000001] tb: tb: <-- appletb_fill_report_info() rc=1 (info filled)
[ +0,000001] tb: tb: appletb_probe: appletb_fill_report_info returned 1
[ +0,000002] tb: tb: appletb_probe: Checking if both interfaces are now present: mode_info.hdev=000000000694472f, disp_info.hdev=0000000000000000
[ +0,000002] tb: tb: appletb_probe: Not all interfaces present yet. Waiting for the other.
[ +0,000001] tb: tb: <-- appletb_probe() rc=0 (success or waiting for other interface)
[ +0,000022] tb: tb: --> appletb_input_configured(hdev name: Apple Inc. iBridge, input name: Apple Inc. iBridge)
[ +0,000001] tb: tb: appletb_input_configured: Clearing evbit, keybit, ledbit for input device Apple Inc. iBridge
[ +0,000002] tb: tb: appletb_input_configured: Setting EV_KEY, EV_REP, EV_MSC bits
[ +0,000001] tb: tb: appletb_input_configured: Setting capabilities for fn_codes and ESC/UNKNOWN
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 59 and 224
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 60 and 225
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 61 and 120
[ +0,000002] tb: tb: appletb_input_configured: Set cap for 62 and 204
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 63 and 229
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 64 and 230
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 65 and 165
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 66 and 164
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 67 and 163
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 68 and 113
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 87 and 114
[ +0,000001] tb: tb: appletb_input_configured: Set cap for 88 and 115
[ +0,000002] tb: tb: appletb_input_configured: Set cap for KEY_ESC and KEY_UNKNOWN
[ +0,000001] tb: tb: <-- appletb_input_configured() rc=0
[ +0,000054] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.000C/input/input29
[ +0,052013] apple-ibridge-hid 0003:05AC:8600.000C: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ +0,002254] hid-sensor-hub 0003:05AC:8600.000D: hiddev0,hidraw1: USB HID v1.01 Device [Apple Inc. iBridge] on usb-0000:00:14.0-3/input3
Also, same logs but with apple-ibridge module:
[mag16 18:57] apple-ibridge: appleib_init: Apple iBridge driver loading...
[ +0,000043] apple-ibridge: appleib_probe: Probing ACPI device 'APP7777:00' (handle 00000000564a2813)
[ +0,000003] apple-ibridge: appleib_alloc_device: Allocating appleib_device for ACPI dev 'APP7777:00'
[ +0,000001] apple-ibridge: appleib_alloc_device: appleib_device allocated at 0000000069d5cad1 for acpi_dev 'APP7777:00'
[ +0,000005] apple-ibridge: appleib_alloc_device: Lists, mutex, and srcu initialized for acpi_dev 'APP7777:00'
[ +0,000002] apple-ibridge: appleib_alloc_device: Getting ACPI handle for SOCW method for acpi_dev 'APP7777:00'...
[ +0,000005] apple-ibridge: appleib_alloc_device: ACPI SOCW handle 000000007e3e3289 obtained for acpi_dev 'APP7777:00'
[ +0,000001] apple-ibridge: appleib_alloc_device: Ensuring iBridge is powered on (executing SOCW(1)) for acpi_dev 'APP7777:00'...
[ +0,074852] apple-ibridge: appleib_alloc_device: SOCW(1) executed successfully for acpi_dev 'APP7777:00'
[ +0,000005] apple-ibridge: appleib_alloc_device: appleib_device allocation and init complete for 'APP7777:00'
[ +0,000001] apple-ibridge: appleib_probe: appleib_alloc_device for acpi_dev 'APP7777:00' succeeded, ib_dev 0000000069d5cad1
[ +0,000002] apple-ibridge: appleib_probe: Copied subdev templates for acpi_dev 'APP7777:00'
[ +0,000001] apple-ibridge: appleib_probe: Initialized dev_data for acpi_dev 'APP7777:00' (ib_dev 0000000069d5cad1, log_dev name: APP7777:00)
[ +0,000002] apple-ibridge: appleib_probe: Set platform_data for subdev 'apple-ib-tb' for acpi_dev 'APP7777:00'
[ +0,000001] apple-ibridge: appleib_probe: Set platform_data for subdev 'apple-ib-als' for acpi_dev 'APP7777:00'
[ +0,000001] apple-ibridge: appleib_probe: Adding MFD devices for acpi_dev 'APP7777:00'...
[ +0,000123] apple-ibridge: appleib_probe: MFD devices added successfully for acpi_dev 'APP7777:00'
[ +0,000003] apple-ibridge: appleib_probe: Copied HID IDs and HID driver structure for acpi_dev 'APP7777:00'
[ +0,000001] apple-ibridge: appleib_probe: Set driver_data for HID ID V05AC P8600 to ib_dev 0000000069d5cad1 (for acpi_dev 'APP7777:00')
[ +0,000003] apple-ibridge: appleib_probe: Set id_table for our main HID driver (for acpi_dev 'APP7777:00')
[ +0,000001] apple-ibridge: appleib_probe: Registering main HID driver 'apple-ibridge-hid' (for acpi_dev 'APP7777:00')...
[ +0,044699] apple-ibridge: appleib_hid_probe: Probing HID device '0003:05AC:8600.0003' (V05AC P8600), id driver_data: 18446624550453305384
[ +0,000005] apple-ibridge: appleib_hid_probe: USB device for hdev '0003:05AC:8600.0003': 1-3, active config: 1
[ +0,000002] apple-ibridge: appleib_hid_probe: USB configuration for hdev '0003:05AC:8600.0003' is already APPLETB_BASIC_CONFIG (1)
[ +0,000002] apple-ibridge: appleib_hid_probe: Got ib_dev 0000000069d5cad1 from id->driver_data for hdev '0003:05AC:8600.0003'
[ +0,000003] apple-ibridge: appleib_report_fixup: Report fixup for hdev '0003:05AC:8600.0003', rsize 83
[ +0,000002] apple-ibridge: appleib_report_fixup: Report fixup complete for hdev '0003:05AC:8600.0003'
[ +0,000070] apple-ibridge: appleib_hid_probe: hid_parse for '0003:05AC:8600.0003' returned 0
[ +0,000141] apple-ibridge: appleib_hid_probe: hid_hw_start for '0003:05AC:8600.0003' returned 0
[ +0,000003] apple-ibridge: appleib_add_device: Adding HID device '0003:05AC:8600.0003' (V05AC P8600 D18446624550453305384) to ib_dev 0000000069d5cad1
[ +0,000003] apple-ibridge: appleib_add_device: dev_info_new allocated at 000000006d4e29e8
[ +0,000002] apple-ibridge: appleib_add_device: update_lock acquired
[ +0,000001] apple-ibridge: appleib_add_device: Setting needs_io_start to hdev '0003:05AC:8600.0003' (0000000042a7d2cb)
[ +0,000001] apple-ibridge: appleib_add_device: Probing registered HID drivers for new device '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_add_device: Clearing needs_io_start (was 0000000042a7d2cb)
[ +0,000001] apple-ibridge: appleib_add_device: Device '0003:05AC:8600.0003' added to ib_dev->hid_devices list
[ +0,000001] apple-ibridge: appleib_add_device: update_lock released. Device added successfully.
[ +0,000001] apple-ibridge: appleib_hid_probe: appleib_add_device succeeded for '0003:05AC:8600.0003', dev_info_added 000000006d4e29e8
[ +0,000002] apple-ibridge: appleib_start_hid_events: Starting HID events for device '0003:05AC:8600.0003'
[ +0,000019] apple-ibridge: appleib_input_configured: Input configured for hdev '0003:05AC:8600.0003', input: 000000000b4c2d3c
[ +0,000002] apple-ibridge: appleib_forward_int_op: Forwarding op 'input_configured' for hdev '0003:05AC:8600.0003'
[ +0,000001] apple-ibridge: appleib_forward_int_op: srcu_read_lock acquired, idx 0 for op 'input_configured'
[ +0,000001] apple-ibridge: appleib_forward_int_op: Found matching dev_info for hdev '0003:05AC:8600.0003' (op 'input_configured')
[ +0,000008] apple-ibridge: appleib_forward_int_op: srcu_read_unlock for idx 0. Op 'input_configured' final rc 0
[ +0,000071] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0003/input/input18
[ +0,079697] apple-ibridge-hid 0003:05AC:8600.0003: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ +0,000006] apple-ibridge: appleib_start_hid_events: hid_connect for '0003:05AC:8600.0003' returned 0
[ +0,000003] apple-ibridge: appleib_start_hid_events: hid_hw_open for '0003:05AC:8600.0003' returned 0
[ +0,000001] apple-ibridge: appleib_start_hid_events: HID events started successfully for '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_hid_probe: appleib_start_hid_events for '0003:05AC:8600.0003' returned 0
[ +0,000001] apple-ibridge: appleib_hid_probe: Successfully probed HID device '0003:05AC:8600.0003'
[ +0,000033] apple-ibridge: appleib_probe: Main HID driver registered successfully for acpi_dev 'APP7777:00'
[ +0,000002] apple-ibridge: appleib_probe: Set ACPI driver_data to ib_dev 0000000069d5cad1 for acpi_dev 'APP7777:00'
[ +0,000002] apple-ibridge: appleib_probe: ACPI probe for 'APP7777:00' successful
[ +0,006760] apple-ibridge: appleib_register_hid_driver: Attempting to register HID driver 'apple-ib-touchbar' (probe: 00000000b78d907d) with ib_dev 0000000069d5cad1, data 00000000a6409fe5
[ +0,000007] apple-ibridge: appleib_register_hid_driver: drv_info allocated at 00000000bee777fa
[ +0,000001] apple-ibridge: appleib_register_hid_driver: update_lock acquired
[ +0,000002] apple-ibridge: appleib_register_hid_driver: Driver 'apple-ib-touchbar' added to ib_dev->hid_drivers list
[ +0,000001] apple-ibridge: appleib_register_hid_driver: Processing existing hid_device '0003:05AC:8600.0003' for new driver 'apple-ib-touchbar'
[ +0,000002] apple-ibridge: appleib_register_hid_driver: Stopping HID events for '0003:05AC:8600.0003' before probing new driver
[ +0,000001] apple-ibridge: appleib_stop_hid_events: Stopping HID events for device '0003:05AC:8600.0003' (started: 1)
[ +0,000002] apple-ibridge: appleib_stop_hid_events: hid_hw_close called for '0003:05AC:8600.0003'
[ +0,000127] apple-ibridge: appleib_register_hid_driver: Attempting to register HID driver 'apple-ib-als' (probe: 000000002b0bf3e4) with ib_dev 0000000069d5cad1, data 0000000043343679
[ +0,000006] apple-ibridge: appleib_register_hid_driver: drv_info allocated at 00000000d68b9be1
[ +0,052963] apple-ibridge: appleib_stop_hid_events: hid_disconnect called for '0003:05AC:8600.0003'
[ +0,000006] apple-ibridge: appleib_register_hid_driver: Probing new driver 'apple-ib-touchbar' with existing device '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_probe_driver: Probing driver 'apple-ib-touchbar' for device '0003:05AC:8600.0003' (id: V05AC P8600)
[ +0,000015] apple-ibridge: appleib_probe_driver: Calling probe() on sub-driver 'apple-ib-touchbar' for hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_get_drvdata: Getting drvdata for driver 'apple-ib-touchbar' in ib_dev 0000000069d5cad1
[ +0,000003] apple-ibridge: appleib_get_drvdata: srcu_read_lock acquired, idx 0
[ +0,000002] apple-ibridge: appleib_get_drvdata: Found driver 'apple-ib-touchbar', drv_data 00000000a6409fe5
[ +0,000002] apple-ibridge: appleib_get_drvdata: srcu_read_unlock for idx 0. Returning drv_data 00000000a6409fe5
[ +0,000002] apple-ibridge: appleib_find_hid_field: Searching for field_usage 0xff0004 in application 0x10006 on hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report type 0
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report id 1, application 0x10006
[ +0,000002] apple-ibridge: appleib_find_report_field: Searching for field_usage 0xff0004 in report id 1 (maxfield 2)
[ +0,000003] apple-ibridge: appleib_find_report_field: Field_usage 0xff0004 not found in report id 1
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report type 1
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report id 1, application 0x10006
[ +0,000001] apple-ibridge: appleib_find_report_field: Searching for field_usage 0xff0004 in report id 1 (maxfield 1)
[ +0,000002] apple-ibridge: appleib_find_report_field: Field_usage 0xff0004 not found in report id 1
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report id 2, application 0x10006
[ +0,000002] apple-ibridge: appleib_find_report_field: Searching for field_usage 0xff0004 in report id 2 (maxfield 1)
[ +0,000002] apple-ibridge: appleib_find_report_field: Found field with matching HID usage 0xff0004 at field index 0, usage index 0
[ +0,000002] apple-ibridge: appleib_find_hid_field: Found field in report type 1, report id 2
[ +0,000002] apple-ibridge: appleib_probe_driver: Sub-driver probe returned 0
[ +0,000002] apple-ibridge: appleib_probe_driver: Successfully probed and attached driver 'apple-ib-touchbar' to device '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_register_hid_driver: Restarting HID events for '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_start_hid_events: Starting HID events for device '0003:05AC:8600.0003'
[ +0,000025] apple-ibridge: appleib_input_configured: Input configured for hdev '0003:05AC:8600.0003', input: 00000000d14289c0
[ +0,000003] apple-ibridge: appleib_forward_int_op: Forwarding op 'input_configured' for hdev '0003:05AC:8600.0003'
[ +0,000001] apple-ibridge: appleib_forward_int_op: srcu_read_lock acquired, idx 0 for op 'input_configured'
[ +0,000002] apple-ibridge: appleib_forward_int_op: Found matching dev_info for hdev '0003:05AC:8600.0003' (op 'input_configured')
[ +0,000002] apple-ibridge: appleib_forward_int_op: Forwarding op 'input_configured' to sub-driver 'apple-ib-touchbar' for hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_forward_int_op: Sub-driver 'apple-ib-touchbar' returned 0 for op 'input_configured'
[ +0,000002] apple-ibridge: appleib_forward_int_op: srcu_read_unlock for idx 0. Op 'input_configured' final rc 0
[ +0,000093] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0003/input/input19
[ +0,052000] apple-ibridge-hid 0003:05AC:8600.0003: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ +0,000007] apple-ibridge: appleib_start_hid_events: hid_connect for '0003:05AC:8600.0003' returned 0
[ +0,000003] apple-ibridge: appleib_start_hid_events: hid_hw_open for '0003:05AC:8600.0003' returned 0
[ +0,000002] apple-ibridge: appleib_start_hid_events: HID events started successfully for '0003:05AC:8600.0003'
[ +0,000006] apple-ibridge: appleib_register_hid_driver: update_lock released. Successfully registered driver 'apple-ib-touchbar'
[ +0,000037] apple-ibridge: appleib_register_hid_driver: update_lock acquired
[ +0,000005] apple-ibridge: appleib_register_hid_driver: Driver 'apple-ib-als' added to ib_dev->hid_drivers list
[ +0,000002] apple-ibridge: appleib_register_hid_driver: Processing existing hid_device '0003:05AC:8600.0003' for new driver 'apple-ib-als'
[ +0,000002] apple-ibridge: appleib_register_hid_driver: Stopping HID events for '0003:05AC:8600.0003' before probing new driver
[ +0,000002] apple-ibridge: appleib_stop_hid_events: Stopping HID events for device '0003:05AC:8600.0003' (started: 1)
[ +0,000002] apple-ibridge: appleib_stop_hid_events: hid_hw_close called for '0003:05AC:8600.0003'
[ +0,009751] apple-ibridge: appleib_stop_hid_events: hid_disconnect called for '0003:05AC:8600.0003'
[ +0,000005] apple-ibridge: appleib_register_hid_driver: Probing new driver 'apple-ib-als' with existing device '0003:05AC:8600.0003'
[ +0,000003] apple-ibridge: appleib_probe_driver: Probing driver 'apple-ib-als' for device '0003:05AC:8600.0003' (id: V05AC P8600)
[ +0,000003] apple-ibridge: appleib_probe_driver: Calling probe() on sub-driver 'apple-ib-als' for hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_get_drvdata: Getting drvdata for driver 'apple-ib-als' in ib_dev 0000000069d5cad1
[ +0,000003] apple-ibridge: appleib_get_drvdata: srcu_read_lock acquired, idx 0
[ +0,000002] apple-ibridge: appleib_get_drvdata: Found driver 'apple-ib-als', drv_data 0000000043343679
[ +0,000002] apple-ibridge: appleib_get_drvdata: srcu_read_unlock for idx 0. Returning drv_data 0000000043343679
[ +0,000002] apple-ibridge: appleib_find_hid_field: Searching for field_usage 0x200316 in application 0x200041 on hdev '0003:05AC:8600.0003'
[ +0,000003] apple-ibridge: appleib_find_hid_field: Checking report type 0
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report id 1, application 0x10006
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report type 1
[ +0,000001] apple-ibridge: appleib_find_hid_field: Checking report id 1, application 0x10006
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report id 2, application 0x10006
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report type 2
[ +0,000002] apple-ibridge: appleib_find_hid_field: Field_usage 0x200316 in application 0x200041 not found on hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_find_hid_field: Searching for field_usage 0x2004d1 in application 0x200041 on hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report type 0
[ +0,000005] apple-ibridge: appleib_find_hid_field: Checking report id 1, application 0x10006
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report type 1
[ +0,000001] apple-ibridge: appleib_find_hid_field: Checking report id 1, application 0x10006
[ +0,000002] apple-ibridge: appleib_find_hid_field: Checking report id 2, application 0x10006
[ +0,000004] apple-ibridge: appleib_find_hid_field: Checking report type 2
[ +0,000002] apple-ibridge: appleib_find_hid_field: Field_usage 0x2004d1 in application 0x200041 not found on hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_probe_driver: Sub-driver probe returned -19
[ +0,000002] apple-ibridge: appleib_probe_driver: Sub-driver probe failed with -19
[ +0,000002] apple-ibridge: appleib_register_hid_driver: Restarting HID events for '0003:05AC:8600.0003'
[ +0,000001] apple-ibridge: appleib_start_hid_events: Starting HID events for device '0003:05AC:8600.0003'
[ +0,000025] apple-ibridge: appleib_input_configured: Input configured for hdev '0003:05AC:8600.0003', input: 00000000317dea5c
[ +0,000005] apple-ibridge: appleib_forward_int_op: Forwarding op 'input_configured' for hdev '0003:05AC:8600.0003'
[ +0,000002] apple-ibridge: appleib_forward_int_op: srcu_read_lock acquired, idx 0 for op 'input_configured'
[ +0,000002] apple-ibridge: appleib_forward_int_op: Found matching dev_info for hdev '0003:05AC:8600.0003' (op 'input_configured')
[ +0,000002] apple-ibridge: appleib_forward_int_op: Forwarding op 'input_configured' to sub-driver 'apple-ib-touchbar' for hdev '0003:05AC:8600.0003'
[ +0,000003] apple-ibridge: appleib_forward_int_op: Sub-driver 'apple-ib-touchbar' returned 0 for op 'input_configured'
[ +0,000003] apple-ibridge: appleib_forward_int_op: srcu_read_unlock for idx 0. Op 'input_configured' final rc 0
[ +0,000073] input: Apple Inc. iBridge as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:05AC:8600.0003/input/input20
[ +0,052036] apple-ibridge-hid 0003:05AC:8600.0003: input,hidraw0: USB HID v1.01 Keyboard [Apple Inc. iBridge] on usb-0000:00:14.0-3/input2
[ +0,000007] apple-ibridge: appleib_start_hid_events: hid_connect for '0003:05AC:8600.0003' returned 0
[ +0,000002] apple-ibridge: appleib_start_hid_events: hid_hw_open for '0003:05AC:8600.0003' returned 0
[ +0,000002] apple-ibridge: appleib_start_hid_events: HID events started successfully for '0003:05AC:8600.0003'
[ +0,000001] apple-ibridge: appleib_register_hid_driver: update_lock released. Successfully registered driver 'apple-ib-als'
EDIT2: I SOLVED IT! I'LL LATER POST THE SOLUTION!
Great! Please post your solution.
Problem Description:
The apple-ibridge driver system, particularly the apple-ib-tb sub-driver for the Touch Bar, relies on two distinct HID reports/interfaces exposed by the Apple iBridge chip (USB VID:05AC, PID:8600) under its first USB configuration:
- An interface/report for Touch Bar Mode control (ESC, Fn keys, Special keys).
- An interface/report for Touch Bar Display control (brightness, on/off).
Analysis of lsusb -v -d 05ac:8600 for Configuration 1 (default) shows:
- USB Interface 2:
bInterfaceClass 3 (HID),bInterfaceProtocol 1 (Keyboard),wDescriptorLength 83. - USB Interface 3:
bInterfaceClass 3 (HID),bInterfaceProtocol 1 (Keyboard),wDescriptorLength 634.
The apple-ibridge-hid driver (the HID muxer component of apple-ibridge.c) correctly probes the HID device created from USB Interface 2. The apple-ib-tb sub-driver's probe function is then called with this hid_device, and it successfully populates its mode_info structure by finding the HID_USAGE_MODE (0xff0004) in application 0x10006.
However, USB Interface 3 (which is expected to provide the HID_USAGE_DISP for disp_info) is claimed by the kernel's generic hid-sensor-hub driver. This is evidenced by:
dmesglogs showinghid-sensor-hubbinding to ahid_device(e.g.,0003:05AC:8600.000Xwhere X corresponds to Interface 3, often seen on/input3).ls -l /sys/bus/usb/devices/.../1-3:1.3/Y.Y.Y.Y/driverpointing tohid-sensor-hub.
As a result, apple-ibridge-hid is not given a chance to probe the hid_device associated with USB Interface 3. Consequently, the apple-ib-tb sub-driver's probe function is not called for this second required interface, tb_dev->disp_info.hdev remains NULL, and the condition if (tb_dev->mode_info.hdev && tb_dev->disp_info.hdev) is never met. This prevents the full initialization of the Touch Bar, including setting its initial mode/display state, registering the input handler for Fn key events, and creating sysfs attributes. The Touch Bar remains non-functional.
Workaround Implemented (via udev rule):
To resolve this, a udev rule was created to forcibly unbind hid-sensor-hub from the hid_device associated with USB Interface 3, and then attempt to re-trigger a driver probe for that hid_device, allowing apple-ibridge-hid to claim it.
The effective udev rule in /etc/udev/rules.d/98-apple-ibridge-custom.rules:
ACTION=="add", SUBSYSTEM=="hid", ENV{HID_ID}=="0003:000005AC:00008600", ENV{HID_PHYS}=="*input3", ATTR{driver}=="hid-sensor-hub", \
RUN+="/bin/sh -c '/usr/bin/logger -t UDEV-IBRIDGE Unbinding %k from hid-sensor-hub; echo %k > /sys%p/driver/unbind; /usr/bin/logger -t UDEV-IBRIDGE Unbound %k. Attempting to trigger drivers_probe; echo %k > /sys/bus/hid/drivers_probe; exit 0'"
Explanation of the udev rule:
ACTION=="add", SUBSYSTEM=="hid": Triggers when a HID device is added.ENV{HID_ID}=="0003:000005AC:00008600": Matches the iBridge HID device by its vendor/product ID (case-corrected).ENV{HID_PHYS}=="*input3": Matches the physical path ending in/input3, which corresponds to USB Interface 3.ATTR{driver}=="hid-sensor-hub": Ensures this rule only runs ifhid-sensor-hubis the driver currently bound (or about to bind) during theaddevent.RUN+=...:- Logs the attempt.
echo %k > /sys%p/driver/unbind: Unbindshid-sensor-hubfrom the specific HID device (%kis the kernel name of the HID device, e.g.,0003:05AC:8600.000X).%pis its sysfs path.echo %k > /sys/bus/hid/drivers_probe: Triggers the HID core to re-probe drivers for the now-unbound HID device.
This workaround allows apple-ibridge-hid to subsequently probe the HID device from USB Interface 3. The apple-ib-tb sub-driver's probe is then called a second time, successfully populating disp_info, leading to full Touch Bar initialization and functionality.
Proposed Long-Term Solution (Driver-Level Change):
While the udev rule provides a functional workaround, it's not ideal as it relies on specific sysfs paths and external configuration. A more robust solution would involve changes at the driver level.
The apple-ibridge.c module should ideally register a struct usb_driver in addition to its ACPI and HID muxer drivers. This usb_driver would:
-
Have a
usb_device_idtable that specifically matches both USB Interface 2 and USB Interface 3 of the iBridge device (VID:05AC, PID:8600). This match could be based on VID, PID, andbInterfaceNumber.// Example ID table entries for the usb_driver in apple-ibridge.c static const struct usb_device_id apple_ibridge_usb_table[] = { { USB_DEVICE_INTERFACE_NUMBER(USB_ID_VENDOR_APPLE, USB_ID_PRODUCT_IBRIDGE, 2) }, // For Interface 2 { USB_DEVICE_INTERFACE_NUMBER(USB_ID_VENDOR_APPLE, USB_ID_PRODUCT_IBRIDGE, 3) }, // For Interface 3 { } /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, apple_ibridge_usb_table);(Note:
USB_DEVICE_INTERFACE_NUMBERmight require specific kernel versions or a custom macro if not standardly available for this exact purpose inusb_device_id.) Alternatively, a more generalUSB_DEVICE(USB_ID_VENDOR_APPLE, USB_ID_PRODUCT_IBRIDGE)could be used, and the USB probe function would then checkinterface->cur_altsetting->desc.bInterfaceNumberto differentiate. -
Implement a USB
probefunction. This function would be called by the USB core for each matching USB interface.- Inside this USB
probefunction, the driver would explicitly tell the USB core that this interface should be handled by the HID subsystem, and specifically by its ownapple-ibridge-hiddriver, or it could directly interact with the HID core to register thehid_device. - By claiming the USB interfaces directly,
apple-ibridgewould have precedence over generic drivers likeusbhid(which then delegates tohid-sensor-huborhid-generic). The USB core typically prefers more specific driver matches.
- Inside this USB
-
Coordination: The
apple-ibridgeACPI driver would still be responsible for overall device power management (SOCW) and MFD cell creation. The new USB driver component would handle the binding to the specific USB interfaces that expose HID functionality, ensuring they are passed to theapple-ibridge-hidmuxer.
This approach would make the driver self-contained and less reliant on udev rules to fight for interface control, leading to a more stable and predictable initialization sequence for all necessary Touch Bar components.
@scuty2000 Great work, thank you.
I'm evaluating Cachyos (linux 6.15) on my MBP. Unfortunately neither of workarounds (via udev or via systemd service) works. So it really looks like we need a patch to the driver. Maybe we can try to get it to upstream if it works well? Are you able to test your driver level ideas?
Macbook Pro 14,3 running arch, kernel 6.15.7-arch1-1. Also attempted under linux-zen (same version). The driver builds properly, but I'm not seeing anything that suggests the driver is enumerating the device properly.
cc @jussike
Update: I was able to get this working properly after a full reinstall of MacOS, and leaving the EFI partition intact after install (mounted under /boot/efi). After installing jussike's module, I did the bind/unbind command, and the touchbar appeared. The only issue that stands out appears to be a driver/hardware quirk - I have to unplug all my USB devices at boot-time for the touchbar to appear. Once booted and the touchbar is available, I can connect my devices. The Mac USB hardware is incredible touchy/flaky and devices sometimes take a long time to enumerate, assuming they don't issue warnings or fail outright.
I wrote a quick MacOS install guide to remind myself how I installed Arch for touchbar use, hopefully someone finds it useful.
https://gist.github.com/blockfeed/2e2f64be8836b03890c736f52a0ab5f4
Workaround Implemented (via
udevrule):To resolve this, a
udevrule was created to forcibly unbindhid-sensor-hubfrom thehid_deviceassociated with USB Interface 3, and then attempt to re-trigger a driver probe for thathid_device, allowingapple-ibridge-hidto claim it.The effective
udevrule in/etc/udev/rules.d/98-apple-ibridge-custom.rules:ACTION=="add", SUBSYSTEM=="hid", ENV{HID_ID}=="0003:000005AC:00008600", ENV{HID_PHYS}=="*input3", ATTR{driver}=="hid-sensor-hub", \ RUN+="/bin/sh -c '/usr/bin/logger -t UDEV-IBRIDGE Unbinding %k from hid-sensor-hub; echo %k > /sys%p/driver/unbind; /usr/bin/logger -t UDEV-IBRIDGE Unbound %k. Attempting to trigger drivers_probe; echo %k > /sys/bus/hid/drivers_probe; exit 0'"
you sir are a genius. For 2 weeks I had been trying to enable the touchbar on an 13,2 and it just wouldn't work. Your udev rule made it light up for the first time!
thanks a lot, -Christian