Add macbook12-spi-driver with kernel 6.17 compatibility fixes (PR #77)#3
Closed
Copilot wants to merge 2 commits into
Closed
Add macbook12-spi-driver with kernel 6.17 compatibility fixes (PR #77)#3Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Applied all fixes from roadrunner2/macbook12-spi-driver#77: - applespi.c: linux/unaligned.h header, SPI delay struct fields, noop_llseek, efivar API update, void remove callbacks, remove .owner from acpi_driver, MODULE_IMPORT_NS(EFIVAR) - apple-ibridge.c: const report_fixup return type, void remove, remove .owner from acpi_driver - apple-ib-tb.c: void platform_remove callback - apple-ib-als.c: iio_device_alloc/iio_trigger_alloc parent arg, iio_device_id(), void platform_remove callback Co-authored-by: LeslieKeys <66516783+LeslieKeys@users.noreply.github.com> Agent-Logs-Url: https://github.com/LeslieKeys/skills-introduction-to-github/sessions/0b2ef6e7-9a92-4b51-b4a4-16034156f587
Copilot
AI
changed the title
[WIP] Fix compilation errors for Linux kernel 6.17+
Add macbook12-spi-driver with kernel 6.17 compatibility fixes (PR #77)
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
macbook12-spi-driver(Touch Bar, keyboard, trackpad, ALS) fails to compile on Linux kernel 6.17 due to 16 API breakages across four modules. This adds the full driver source with all fixes from roadrunner2/macbook12-spi-driver#77 applied.Changes by file
applespi.c— 8 fixes:asm/unaligned.h→linux/unaligned.hspi_transfer.delay_usecs→delay.value+delay.unit = SPI_DELAY_UNIT_USECS(4 instances)no_llseek→noop_llseekefivar_entry_get/set_safewithefivar_get_variable/efivar_set_variableapplespi_remove/appleacpi_remove:int→void.owner = THIS_MODULEfromstruct acpi_driverMODULE_IMPORT_NS("EFIVAR")apple-ibridge.c— 3 fixes:appleib_report_fixupreturn type:__u8 *→const __u8 *appleib_remove:int→void.ownerfromacpi_driverapple-ib-tb.c— 1 fix:appletb_platform_remove:int→voidapple-ib-als.c— 3 fixes:iio_device_alloc/iio_trigger_allocnow require parentstruct device *as first argiio_dev->id→iio_device_id(iio_dev)appleals_platform_remove:int→voidSupporting files:
Makefile,dkms.conf,applespi.h,applespi_trace.h,apple-ibridge.hExample: SPI delay fix
Original prompt
Create a fork of roadrunner2/macbook12-spi-driver and apply the changes from pull request #77 (Fix compilation errors for Linux kernel 6.17) to make it compatible with kernel 6.17+.
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.
bcmwl-kernel-sourcepackage.sudo apt install bcmwl-kernel-source2. Touchbar
The Touchbar requires a specific driver called
macbook12-spi-driveror theappletbdriver, depending on your kernel.3. Audio / Speakers
Audio is historically the most complex part of getting Linux working perfectly on this generation of MacBooks.
4. Suspend / Wake
Suspend can sometimes be finicky on these models. The
Dunedanrepo 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, orMacBookPro14,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-drivercreated by the community (specifically by the userroadrunner2). 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
gitanddkmsinstalled so you can download and build the driver:3. Download and Install the Driver
Clone the repository into the
/usr/srcdirectory, then use DKMS to install it:4. Update Initramfs
After the driver is installed, update your initial ramdisk so the new modules are included on the next boot:
5. Reboot
Restart your MacBook:
How the Touchbar will work:
Once rebooted, the
apple_ibridgeandapple_ib_tbkernel modules will load automatically.Fnkey.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)
lesliekeys@lesliekeys-MacBookPro:~/Downloads$
Assistant: The error you are seeing is because the
broadcom-sta-dkmspackage (which provides the proprietarywldri...This pull request was created from Copilot chat.
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.