Skip to content

Add kernel 6.17-compatible apple-ibridge Touch Bar driver (PR #77 patches)#4

Merged
LeslieKeys merged 2 commits into
mainfrom
copilot/diagnose-touch-bar-issue
Mar 21, 2026
Merged

Add kernel 6.17-compatible apple-ibridge Touch Bar driver (PR #77 patches)#4
LeslieKeys merged 2 commits into
mainfrom
copilot/diagnose-touch-bar-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 21, 2026

The apple-ibridge driver fails to compile on Linux 6.17 due to breaking kernel API changes across HID, ACPI, IIO, SPI, and EFI subsystems. This adds the full patched driver source from roadrunner2/macbook12-spi-driver PR #77 along with an installation guide.

Driver patches (kernel 6.17 compat)

  • apple-ibridge.creport_fixup return type __u8 *const __u8 *; appleib_remove intvoid; removed .owner from struct acpi_driver
  • apple-ib-tb.cappletb_platform_remove intvoid
  • apple-ib-als.ciio_device_alloc/iio_trigger_alloc require parent struct device * as first arg; iio_dev->idiio_device_id(iio_dev); appleals_platform_remove intvoid
  • applespi.casm/unaligned.hlinux/unaligned.h; spi_transfer.delay_usecs.delay.value/.delay.unit (×4); no_llseeknoop_llseek; EFI helpers rewritten from efivar_entry_get/set_safe to efivar_get/set_variable; applespi_remove/appleacpi_remove intvoid; removed .owner from struct acpi_driver; added MODULE_IMPORT_NS("EFIVAR")

Example of the SPI delay API change (one of four instances in applespi.c):

/* before */
dl_t->delay_usecs = applespi->spi_settings.spi_cs_delay;

/* after */
dl_t->delay.value = applespi->spi_settings.spi_cs_delay;
dl_t->delay.unit  = SPI_DELAY_UNIT_USECS;

Supporting files

  • Makefile, dkms.conf, apple-ibridge.h, applespi.h, applespi_trace.h — carried over from upstream touchbar-driver-hid-driver branch unchanged
  • INSTALL.md — end-to-end DKMS install guide covering cleanup of broken prior installs, module loading, and verification steps (lsmod, dmesg, dkms status)
Original prompt

Diagnose and resolve why the Touch Bar is not working on a 2017 MacBook Pro running Ubuntu 24.04 (Linux kernel 6.17). Ensure the correct patched apple-ibridge module is installed and loaded, based on the latest code compatible with kernel 6.17 as in roadrunner2/macbook12-spi-driver PR #77. Provide clear documentation and steps for verification.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: I'm just install Ubuntu24 on my Macbook Pro2017, I need to support my drive and other things like touchbar, speaker, wifi and so on

Assistant: To get all your hardware working on a 2017 MacBook Pro running Ubuntu, the best and most comprehensive community resource is the Dunedan/mbp-2016-linux repository. This repository tracks the state of Linux on 2016 and 2017 MacBook Pros and provides step-by-step solutions for missing drivers.

Here is a breakdown of what you'll need to do for your specific components:

1. Wi-Fi

On 2017 models, the Broadcom Wi-Fi card usually requires proprietary drivers.

  • You will need to install the bcmwl-kernel-source package.
  • If you don't have internet right now, you might need to tether your phone via USB to download the driver first.
  • Command: sudo apt install bcmwl-kernel-source

2. Touchbar

The Touchbar requires a specific driver called macbook12-spi-driver or the appletb driver, depending on your kernel.

  • Most modern solutions for the Touchbar use roadrunner2/macbook12-spi-driver.
  • Follow the instructions in the repository to compile and install the module via DKMS, which will enable the Touchbar to function with standard function keys.

3. Audio / Speakers

Audio is historically the most complex part of getting Linux working perfectly on this generation of MacBooks.

  • You will likely need to install a specific audio driver to get the internal speakers to work.
  • Look into the davidjo/snd_hda_macbookpro repository, which provides a script to set up the necessary kernel modules for sound on modern MacBooks.

4. Suspend / Wake

Suspend can sometimes be finicky on these models. The Dunedan repo contains specific GRUB boot parameters and fixes to ensure your laptop wakes up correctly when you open the lid.

Next Steps:

I highly recommend reading through the State of Linux on the MacBook Pro 2016 & 2017 README. It includes a support matrix and links to the specific drivers you need for your exact model (either MacBookPro14,1, MacBookPro14,2, or MacBookPro14,3).

User: How should I do to use my touchbar?

Assistant: To get your Touchbar working on Ubuntu 24, you'll need to install the macbook12-spi-driver created by the community (specifically by the user roadrunner2). This driver package handles the Touchbar (via the iBridge chip), as well as the internal keyboard and trackpad for 2016/2017 MacBooks.

Here are the step-by-step instructions to install it using DKMS (Dynamic Kernel Module Support), which ensures the driver stays installed even when Ubuntu updates your kernel.

Open your terminal and run the following commands:

1. Add the necessary modules to initramfs

First, you need to tell Ubuntu to load the SPI and Apple drivers during boot:

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

2. Install DKMS and Git

Make sure you have git and dkms installed so you can download and build the driver:

sudo apt update
sudo apt install git dkms

3. Download and Install the Driver

Clone the repository into the /usr/src directory, then use DKMS to install it:

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

4. Update Initramfs

After the driver is installed, update your initial ramdisk so the new modules are included on the next boot:

sudo update-initramfs -u

5. Reboot

Restart your MacBook:

sudo reboot

How the Touchbar will work:

Once rebooted, the apple_ibridge and apple_ib_tb kernel modules will load automatically.

  • It provides basic Touchbar functionality, showing the standard F1-F12 function keys and media controls.
  • It will switch modes based on whether you are holding the Fn key.
  • The Touchbar will automatically dim and turn off after 5 minutes of inactivity to save battery, and wake up instantly when you touch the trackpad, keyboard, or Touchbar itself.

User: I: The initramfs will attempt to resume from /dev/nvme0n1p3
I: (UUID=b09ba33e-606a-49da-9ba2-1875c24ad88b)
I: Set the RESUME variable to override this.
Errors were encountered while processing:
broadcom-sta-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
les...

This pull request was created from Copilot chat.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Diagnose and resolve Touch Bar issues on 2017 MacBook Pro Add kernel 6.17-compatible apple-ibridge Touch Bar driver (PR #77 patches) Mar 21, 2026
Copilot AI requested a review from LeslieKeys March 21, 2026 15:30
@LeslieKeys LeslieKeys marked this pull request as ready for review March 21, 2026 15:37
@LeslieKeys LeslieKeys merged commit fa239d5 into main Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants