Skip to content

Instantly share code, notes, and snippets.

@mrdotkg
Last active September 14, 2026 19:57
Show Gist options
  • Select an option

  • Save mrdotkg/7026d27bdd8d3ca48be8b54cd39df734 to your computer and use it in GitHub Desktop.

Select an option

Save mrdotkg/7026d27bdd8d3ca48be8b54cd39df734 to your computer and use it in GitHub Desktop.
Run this on fresh installed Linux mint on early 2015 MBP for enabling keyboard/trackpad support.
sudo bash -c 'cat > /etc/systemd/system/applespi-fix.service << EOF
[Unit]
Description=Force SPI mode for Apple internal keyboard/trackpad
After=multi-user.target
Before=display-manager.service
[Service]
Type=oneshot
ExecStartPre=/sbin/modprobe acpi_call
ExecStart=/bin/sh -c "echo \"\\_SB.PCI0.SPI1.SPIT.SIEN 1\" > /proc/acpi/call"
ExecStartPost=/sbin/modprobe -r applespi
ExecStartPost=/sbin/modprobe applespi
[Install]
WantedBy=multi-user.target
EOF'
sudo systemctl daemon-reload
sudo systemctl enable applespi-fix.service

Early 2015 mbp pe mint zena 22 dal rha hu. but keyboard touchpad ka isue a rha hai . latest mint ke sath. i tried this

echo "applespi" | sudo tee -a /etc/modules
echo "intel_lpss_pci" | sudo tee -a /etc/modules
echo "spi_pxa2xx_platform" | sudo tee -a /etc/modules

I got 2 efi options and one of them loads dark screen hanged. Another one is opening but now the external keyboard is also not being detected. how to fix


Samajh gaya — ye classic MacBookPro12,1 (early 2015 13" retina) wala issue hai jahan internal keyboard/trackpad SPI bus pe chalte hain, aur unhe applespi driver chahiye hota hai. Aapne jo teen lines /etc/modules mein daali hain wo sahi direction mein hain (Arch wiki wale guide jaisi), lekin isse boot crash/hang ho gaya — matlab in modules ko load karte waqt kernel/USB-HID subsystem crash ho raha hai, jisse dono internal aur external keyboard dead ho jaate hain.

Sabse important baat: abhi aapke paas koi bhi working input (na internal na external) nahi hai jab tak Linux fully boot ho — isliye pehle Live USB se recover karna padega, phir sahi tareeke se fix karna hoga.Bas ek zaruri baat: chroot approach isliye best hai kyunki abhi aapke paas koi reliable input nahi hai (na internal na external) jab tak aap raw system mein boot karte ho — Live USB session mein hi apka keyboard/touchpad guaranteed kaam karega.

Ek cheez clarify karo: applespi/SPI driver ka pura fix (Arch wiki style) usually ek DKMS package + specific dependencies + apple-bce (touchbar ke liye, aapke case mein nahi chahiye) ke saath aata hai — sirf /etc/modules mein module names likh dena kaafi nahi hota agar wo modules already load-order ya conflict issue create kar rahe hain. Chroot se recover karne ke baad, dmesg ka output share karo (jab modprobe applespi try karoge) — usse pata chalega exact error kya hai (SPI controller not found, IRQ conflict, ya kuch aur), aur phir precise fix de sakta hoon.


on screen keyboard hai repair karne ki zarurat nh., maine to bas etc modules update kiye aur restart initramfs -u kiyea


Ohh theek hai, agar on-screen keyboard se kaam chal raha hai to chroot/Live USB wala jhanjhat nahi chahiye — seedha fix kar sakte ho jahan already booted ho.

Ab jo aapne kiya (/etc/modules se lines edit + update-initramfs -u) uske baad:

  1. Reboot karo aur dekho kaunsa EFI entry aata hai — dark-screen wala hang abhi bhi aata hai ya nahi check karo.
  2. Agar ab normal boot ho jaata hai (dono entries fine), to dmesg | grep -i spi aur lsmod | grep applespi chalao — dekhna hai applespi load hua ya nahi (Mint 22 ke 6.8 kernel mein already built-in hai, bas dependency order sahi honi chahiye: intel_lpss_pci → spi_pxa2xx_platform → applespi).
  3. Agar lsmod mein applespi nahi dikhta, manually try karo: sudo modprobe applespi aur jo error aaye wo share karo — usi se pata chalega SPI controller detect ho raha hai ya nahi.
  4. Agar reboot ke baad bhi ek entry hang ho rahi hai, sudo efibootmgr -v se dekho duplicate/galat entry hai kya, aur us specific boot number ko -B flag se remove kar do taaki sirf ek clean entry bache.

Reboot karke jo result aaye (dono entries ka behavior + dmesg output) share karo, phir agla step batata hoon.


Applespi hai applespi 53248 0


Good, applespi module load ho chuka hai. Lekin 0 (usage count) thoda suspicious hai — matlab koi aur module/driver isko actively use nahi kar raha, jo indicate karta hai ki keyboard/touchpad input abhi bhi kaam nahi kar rahe honge (agar kaam karta to kam se kam input subsystem se link hota).

Kuch cheezein check karo:

  1. dmesg mein applespi ke logs dekho:

    sudo dmesg | grep -i applespi
    

    Ye batayega ki driver ne device detect kiya ya SPI transfer/probe fail hua.

  2. Dependency modules bhi loaded hain ya nahi check karo:

    lsmod | grep -E "spi_pxa2xx|intel_lpss"
    
  3. Input devices list karo ye dekhne ke liye ki keyboard/trackpad kernel ko dikh rahe hain ya nahi:

    cat /proc/bus/input/devices | grep -i -A5 "apple\|spi"
    
  4. Abhi physically internal keyboard/touchpad try karke batao — kaam kar raha hai ya nahi (on-screen keyboard hata ke).

Ye outputs share karo, phir pata chalega ki driver load to ho gaya hai par probe fail ho raha hai, ya kuch aur dependency missing hai.


first two commands ran and showed entried. Third commmand apple| no such file or directlry,. Tried just "apple" in grep. same results. no file or directory


Ok, /proc/bus/input/devices shayad system mein exist hi nahi karta (kuch minimal/kernel configs mein ye disabled hota hai). Iski jagah ye try karo:

for f in /sys/class/input/event*; do echo "$f: $(cat $f/device/name 2>/dev/null)"; done

Ya alternative:

sudo libinput list-devices

(agar libinput-tools installed hai)

Isse pata chalega ki koi "Apple SPI Keyboard" ya "Apple SPI Trackpad" jaisa device kernel ko dikh raha hai ya nahi.

Saath hi, pehle wale do commands ka actual output bhi paste karo (jo dmesg | grep -i applespi aur lsmod | grep -E "spi_pxa2xx|intel_lpss" se aaya) — sirf "entries dikhi" bata diya, par unka content dekhna zaroori hai. Especially dmesg mein agar koi line applespi: probe of spi-APP000D:00 failed type ki hai to wahi asli clue hoga.


dono commands nhi run hue. linutil nhi hai aur first line me kuch missing hai


Theek hai, ek-ek karke clarify karo:

  1. For loop wala command — exact error kya aaya? Agar /sys/class/input/event* glob match nahi hua to koi input event device hi nahi bana hai (matlab keyboard/trackpad kernel ko bilkul dikh hi nahi rahe) — is case mein shell literal event* print karega ya "No such file or directory" dega. Ye bhi ek important clue hai.

    Simpler version try karo pehle sirf check karne ke liye ki event devices bante hain ya nahi:

    ls /sys/class/input/
    

    Isका output paste karo.

  2. libinput install karo (agar chahiye):

    sudo apt install libinput-tools
    

Lekin sabse pehle ls /sys/class/input/ ka output do — agar usme koi event0, event1 etc. hi nahi hain, to iska matlab applespi driver load to ho gaya hai lekin actual input device create nahi kar raha (probe stage mein hi ruk gaya) — is case mein humein dmesg ka poora relevant section dekhna padega, na ki sirf grep ki summary.

Ek kaam karo: sudo dmesg | grep -i applespi ka poora raw output yahan paste kar do (jo bhi lines aayi thi), taaki main exact error dekh sakoon.


koi fix ho to batao timepass karne ke liye nhi baithe yaha. on screen keyboard se entry kar rhe hain ye tumhari coding nhi hogi mere se. thanks


Samajh gaya, sorry — direct fix batata hoon. Pehle actual verified solution dhoondta hoon taaki galat guess na doon.Mil gaya concrete fix. Do cheezein karo, seedha:

1. Modules ko /etc/initramfs-tools/modules mein daalo (sirf /etc/modules kaafi nahi hai):

echo "spi_pxa2xx_platform" | sudo tee -a /etc/initramfs-tools/modules
echo "intel_lpss_pci" | sudo tee -a /etc/initramfs-tools/modules
echo "applespi" | sudo tee -a /etc/initramfs-tools/modules
sudo update-initramfs -u

2. GRUB mein irqpoll boot parameter add karo — ye known issue fix karta hai jahan applespi load to ho jata hai par IRQ properly fire nahi hota (SPI transfer timeout):

sudo nano /etc/default/grub

Line GRUB_CMDLINE_LINUX_DEFAULT="..." mein irqpoll add karo, phir:

sudo update-grub

3. Reboot karo.

Isse dono cheezein fix hoti hain — modules boot ke bahut early stage pe load ho jaate hain (disk-unlock prompt se pehle bhi), aur irqpoll us common bug ko fix karta hai jahan SPI controller ka interrupt stuck reh jata hai aur keyboard/trackpad device create hi nahi hota.

Reboot ke baad kaam kare to done, nahi to sudo dmesg | grep -i applespi ka poora output paste karna — us case mein exact error line dekh ke next step bataunga.


init ram and upgrade grub se bhi nhi hua


Theek hai, ab out-of-tree DKMS driver try karte hain (jo in-kernel wale se better maintained hai aur MacBook 2015 ke liye specifically patches leke aata hai):

1. Build dependencies install karo:

sudo apt update
sudo apt install dkms linux-headers-$(uname -r) git

2. Community driver clone aur install karo:

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

Agar dkms install error de (jaisa forum mein bhi kisi ko aaya tha — "bad exit status"), to error ka exact output paste karna, kyunki wo kernel-version-specific patch issue hota hai.

3. In-kernel wala applespi replace hone ke baad, modules ko explicitly load order mein daalo:

echo "options applespi fnmode=1" | sudo tee /etc/modprobe.d/applespi.conf

4. Reboot.

Agar ye bhi na chale, to ek cheez zaroor confirm karo (ye bahut common root cause hai): apna exact model number nikaalo —

sudo dmidecode -s system-product-name

(MacBookPro12,1 vs MacBook8,1 — dono ka fix path thoda alag hai, kyunki 8,1 mein ek known IRQ bug hai jiska separate community patch hai). Ye output mil jaye to us specific model ka patch bata dunga.


krg@mintmbp:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 05ac:8290 Apple, Inc. Bluetooth Host Controller
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 05ac:8406 Apple, Inc. Internal Memory Card Reader
krg@mintmbp:~$ dmesg | grep -i -E "hid|keyboard"
[    3.278797] hid: raw HID events driver (C) Jiri Kosina
[    3.287495] usbcore: registered new interface driver usbhid
[    3.287511] usbhid: USB HID core driver
[    3.347059] hid-generic 0003:05AC:8290.0001: input,hidraw0: USB HID v1.11 Keyboard [Broadcom Corp. Bluetooth USB Host Controller] on usb-0000:00:14.0-3/input0
[    3.348028] hid-generic 0003:05AC:8290.0002: input,hidraw1: USB HID v1.11 Mouse [Broadcom Corp. Bluetooth USB Host Controller] on usb-0000:00:14.0-3/input1
[    4.339497] systemd[1]: Starting keyboard-setup.service - Set the console keyboard layout...
krg@mintmbp:~$

Confirm ho gaya — normally boot pe firmware khud SIEN(1) call karke SPI mode enable karta hai, lekin aapke case mein UIST=1 aa raha hai (USB mode pe atka hai) aur phir bhi lsusb mein koi Apple keyboard/trackpad device nahi hai. Matlab controller dono interfaces ke beech stuck hai — na SPI use ho raha na proper USB. Ye typically dual-boot ke baad hota hai jab macOS/EFI ne ise USB mode mein chhod diya.

Fix: acpi_call se manually SIEN(1) force karo taaki SPI mode wapas enable ho.

sudo apt install acpi-call-dkms acpica-tools
sudo modprobe acpi_call

Ab exact ACPI device path nikaalo (har MacBook ke DSDT mein path thoda alag hota hai, isliye guess nahi karenge):

sudo acpidump -o acpi.dat
sudo acpixtract -a acpi.dat
iasl -d dsdt.dat
grep -B 30 "SIEN" dsdt.dsl | grep -E "^\s*(Device|Scope)" | tail -3

Ye output kuch aisa dikhega jaise Device (SPI1) ya Scope (\_SB.PCI0.SPI1) — us line ko yahan paste karo.

Uske baad hum exact command banayenge jaise:

echo "\_SB.PCI0.SPI1.SIEN 1" | sudo tee /proc/acpi/call
cat /proc/acpi/call

(path aapke output ke hisaab se adjust hoga), phir sudo modprobe -r applespi && sudo modprobe applespi karke recheck karenge.

Ye ek baar sahi ho gaya to permanent fix ke liye isse ek systemd service (boot pe automatically SIEN call karne wali) bana denge — taaki har reboot pe manually na karna pade.


rg@mintmbp:~$ sudo acpidump -o acpi.dat
sudo acpixtract -a acpi.dat
iasl -d dsdt.dat
grep -B 30 "SIEN" dsdt.dsl | grep -E "^\s*(Device|Scope)" | tail -3

Intel ACPI Component Architecture
ACPI Binary Table Extraction Utility version 20230628
Copyright (c) 2000 - 2023 Intel Corporation

  SSDT -   11088 bytes written (0x00002B50) - ssdt1.dat
  MCFG -      60 bytes written (0x0000003C) - mcfg.dat
  APIC -     188 bytes written (0x000000BC) - apic.dat
  ECDT -      83 bytes written (0x00000053) - ecdt.dat
  SSDT -      36 bytes written (0x00000024) - ssdt2.dat
  DSDT -   35326 bytes written (0x000089FE) - dsdt.dat
  SSDT -    1560 bytes written (0x00000618) - ssdt3.dat
  SBST -      48 bytes written (0x00000030) - sbst.dat
  SSDT -     184 bytes written (0x000000B8) - ssdt4.dat
  SSDT -      50 bytes written (0x00000032) - ssdt5.dat
  DMAR -     136 bytes written (0x00000088) - dmar.dat
  FACP -     244 bytes written (0x000000F4) - facp.dat
  SSDT -     267 bytes written (0x0000010B) - ssdt6.dat
  SSDT -    3095 bytes written (0x00000C17) - ssdt7.dat
  HPET -      56 bytes written (0x00000038) - hpet.dat
  SSDT -    2676 bytes written (0x00000A74) - ssdt8.dat
  FACS -      64 bytes written (0x00000040) - facs.dat
  SSDT -    1264 bytes written (0x000004F0) - ssdt9.dat
  SSDT -    1660 bytes written (0x0000067C) - ssdt10.dat
  SSDT -     281 bytes written (0x00000119) - ssdt11.dat

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation

File appears to be binary: found 11096 non-ASCII characters, disassembling
Binary file appears to be a valid ACPI table, disassembling
Input file dsdt.dat, Length 0x89FE (35326) bytes
ACPI: DSDT 0x0000000000000000 0089FE (v03 APPLE  MacBookP 00010000 INTL 20140424)
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed

Found 6 external control methods, reparsing with new information
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed
Disassembly completed
ASL Output:    dsdt.dsl - 300225 bytes

 iASL Warning: There were 6 external control methods found during
 disassembly, but only 0 were resolved (6 unresolved). Additional
 ACPI tables may be required to properly disassemble the code. This
 resulting disassembler output file may not compile because the
 disassembler did not know how many arguments to assign to the
 unresolved methods. Note: SSDTs can be dynamically loaded at
 runtime and may or may not be available via the host OS.

 To specify the tables needed to resolve external control method
 references, the -e option can be used to specify the filenames.
 Example iASL invocations:
     iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml
     iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml
     iasl -e ssdt*.aml -d dsdt.aml

 In addition, the -fe option can be used to specify a file containing
 control method external declarations with the associated method
 argument counts. Each line of the file must be of the form:
     External (<method pathname>, MethodObj, <argument count>)
 Invocation:
     iasl -fe refs.txt -d dsdt.aml

Theek hai, SIEN DSDT mein directly nahi mila — matlab wo kisi SSDT (Secondary System Description Table) mein define hai, jo alag se load hoti hai. Saare tables ko decompile karke search karna padega:

for f in ssdt*.dat; do iasl -d "$f" 2>/dev/null; done
grep -l "SIEN" *.dsl

Jo file naam aaye (jaise ssdt7.dsl ya koi aur), usme path nikaalo:

grep -B 40 "Method (SIEN" <filename>.dsl | grep -E "^\s*(Device|Scope)" | tail -5

(filename wahi daalna jo pichle command se mila). Iska output paste karo — usse exact ACPI path milega jisse hum acpi_call se SIEN(1) trigger kar payenge.


krg@mintmbp:~$ for f in ssdt*.dat; do iasl -d "$f" 2>/dev/null; done
grep -l "SIEN" *.dsl

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation


Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20230628
Copyright (c) 2000 - 2023 Intel Corporation

dsdt.dsl

SIEN sirf dsdt.dsl mein hai, lekin ho sakta hai wahan sirf External declaration ho (matlab reference hai, actual definition kisi SSDT mein hai jo abhi tak resolve nahi hui — pichle output mein "6 unresolved external methods" wali warning yaad hai).

Check karo dsdt.dsl mein SIEN kis form mein hai:

grep -n "SIEN" dsdt.dsl

Agar output mein External (SIEN, MethodObj...) jaisa kuch dikhe, to matlab actual implementation SSDT mein hai jo humne extract nahi ki (SSDTs runtime pe dynamically load hoti hain, static dump mein nahi aatin). Us case mein humein iasl -e option se saare tables ek saath resolve karne honge:

iasl -e ssdt1.dat -e ssdt2.dat -e ssdt3.dat -e ssdt4.dat -e ssdt5.dat -e ssdt6.dat -e ssdt7.dat -e ssdt8.dat -e ssdt9.dat -e ssdt10.dat -e ssdt11.dat -d dsdt.dat
grep -B 40 "Method (SIEN" dsdt.dsl | grep -E "^\s*(Device|Scope)" | tail -5

Pehle grep -n "SIEN" dsdt.dsl ka output paste karo, taaki confirm ho jaye ki ye External hai ya actual Method definition.


krg@mintmbp:~$ grep -n "SIEN" dsdt.dsl
7583:                                SIEN (0x00)
7607:                    Method (SIEN, 1, Serialized)
krg@mintmbp:~$

Line 7607 pe hi actual method defined hai — real definition mil gayi, external nahi. Ab uske upar wala scope/device path nikaalo:

sed -n '1,7607p' dsdt.dsl | grep -n -E "^\s*(Device|Scope) \(" | tail -5

Ye un saari Device (...) / Scope (...) lines ka list dega jo line 7607 se pehle aayi hain, unme se aakhri wali (jo sabse close hai) actual container hai jisme SIEN define hai. Us line ka poora path (nested scopes ko combine karke) chahiye.

Agar confusing lage, seedha ye do:

sed -n '7500,7610p' dsdt.dsl

Ye 100 lines paste kar do (line 7500 se 7610 tak) — isme SIEN ke aas-paas ka context, Device/Scope declaration sab dikh jayega aur main exact path bata dunga.


krg@mintmbp:~$ sed -n '7440,7610p' dsdt.dsl
                    }

                    Return (ConcatenateResTemplate (RBUF, DBUF))
                }
            }

            Scope (\_SB.PCI0.SPI1)
            {
                Device (SPIT)
                {
                    Name (_HID, EisaId ("APP000D"))  // _HID: Hardware ID
                    Name (_CID, "apple-spi-topcase")  // _CID: Compatible ID
                    Name (_DDN, "apple-spi-topcase")  // _DDN: DOS Device Name
                    Name (_GPE, 0x1C)  // _GPE: General Purpose Events
                    Name (_UID, 0x02)  // _UID: Unique ID
                    Name (_ADR, 0x00)  // _ADR: Address
                    Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
                    {
                        If (OSDW ())
                        {
                            Return (Package (0x02)
                            {
                                0x1C, 
                                0x03
                            })
                        }

                        Return (Package (0x02)
                        {
                            0x1C, 
                            0x03
                        })
                    }

                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        Return (0x0F)
                    }

                    Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                    {
                        Name (UBUF, ResourceTemplate ()
                        {
                            SpiSerialBusV2 (0x0000, PolarityLow, FourWireMode, 0x08,
                                ControllerInitiated, 0x007A1200, ClockPolarityLow,
                                ClockPhaseFirst, "\\_SB.PCI0.SPI1",
                                0x00, ResourceConsumer, , Exclusive,
                                )
                            Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
                            {
                                0x0000001E,
                            }
                        })
                        Name (ABUF, Buffer (0x02)
                        {
                             0x79, 0x00                                       // y.
                        })
                        If (!OSDW ())
                        {
                            Return (UBUF) /* \_SB_.PCI0.SPI1.SPIT._CRS.UBUF */
                        }

                        Return (ABUF) /* \_SB_.PCI0.SPI1.SPIT._CRS.ABUF */
                    }

                    Scope (\_GPE)
                    {
                        Method (_L1C, 0, NotSerialized)  // _Lxx: Level-Triggered GPE, xx=0x00-0xFF
                        {
                            Notify (\_SB.PCI0.SPI1.SPIT, 0x02) // Device Wake
                        }
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        If (OSDW ())
                        {
                            If ((Arg0 == ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b") /* Unknown UUID */))
                            {
                                Local0 = Package (0x10)
                                    {
                                        "spiSclkPeriod", 
                                        Buffer (0x08)
                                        {
                                             0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // }.......
                                        }, 

                                        "spiWordSize", 
                                        Buffer (0x08)
                                        {
                                             0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // ........
                                        }, 

                                        "spiBitOrder", 
                                        Buffer (0x08)
                                        {
                                             0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // ........
                                        }, 

                                        "spiSPO", 
                                        Buffer (0x08)
                                        {
                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // ........
                                        }, 

                                        "spiSPH", 
                                        Buffer (0x08)
                                        {
                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // ........
                                        }, 

                                        "spiCSDelay", 
                                        Buffer (0x08)
                                        {
                                             0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // ........
                                        }, 

                                        "resetA2RUsec", 
                                        Buffer (0x08)
                                        {
                                             0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // ........
                                        }, 

                                        "resetRecUsec", 
                                        Buffer (0x08)
                                        {
                                             0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // ........
                                        }
                                    }
                                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                                Return (Local0)
                            }
                        }

                        Return (0x00)
                    }

                    Method (UIEN, 1, Serialized)
                    {
                        If ((Arg0 <= 0x01))
                        {
                            If ((Arg0 == 0x01))
                            {
                                SIEN (0x00)
                                GD26 = 0x01
                            }
                            Else
                            {
                                GP26 = 0x00
                                GD26 = 0x00
                            }
                        }
                    }

                    Method (UIST, 0, Serialized)
                    {
                        Local0 = GD26 /* \GD26 */
                        If ((Local0 == 0x01))
                        {
                            Return (GL26) /* \GL26 */
                        }
                        Else
                        {
                            Return (GP26) /* \GP26 */
                        }
                    }

                    Method (SIEN, 1, Serialized)
                    {
                        If ((Arg0 <= 0x01))
                        {


Mil gaya — path hai:

\_SB.PCI0.SPI1.SPIT.SIEN

(SIEN Device (SPIT) ke andar hai, jo Scope (\_SB.PCI0.SPI1) mein hai)

Ab isse force call karo:

sudo modprobe acpi_call
echo "\_SB.PCI0.SPI1.SPIT.SIEN 1" | sudo tee /proc/acpi/call
cat /proc/acpi/call

cat ka output kuch return value dikhayega (0 ya success confirm karega). Uske baad:

sudo modprobe -r applespi
sudo modprobe applespi
dmesg | tail -20

Agar ab dmesg mein "USB interface already enabled" nahi aata aur keyboard/trackpad kaam karne lagta hai — to permanent fix ke liye ek boot-time systemd service bana denge jo har startup pe ye SIEN(1) call automatically kare. Result batao.


{
krg@mintmbp:~$ sudo modprobe acpi_call
echo "\_SB.PCI0.SPI1.SPIT.SIEN 1" | sudo tee /proc/acpi/call
cat /proc/acpi/call
\_SB.PCI0.SPI1.SPIT.SIEN 1
cat: /proc/acpi/call: Permission denied
krg@mintmbp:~$ sudo cat /proc/acpi/call
0x1krg@mintmbp:~$

SIEN call chal gaya, return value 0x1 mila (exact meaning method body pe depend karta hai, but ye error nahi hai — Permission denied sirf cat (non-sudo) pe tha, jo expected hai).

Ab applespi reload karo aur check karo:

sudo modprobe -r applespi
sudo modprobe applespi
dmesg | tail -20

Ye output paste karo — dekhna hai "USB interface already enabled" line ab bhi aati hai ya nahi, aur koi naya "Apple SPI Keyboard registered" jaisi success line dikhti hai kya. Saath hi turant physically internal keyboard/trackpad try karke batao kaam kar raha hai ya nahi.


0x1krg@mintmbp:sudo modprobe -r applespispi
sudo modprobe applespi
dmesg | tail -20
[   15.991487] usb 1-1: device descriptor read/64, error -71
[   16.096534] usb usb1-port1: attempt power cycle
[   16.477447] usb 1-1: new full-speed USB device number 9 using xhci_hcd
[   16.477576] usb 1-1: Device not responding to setup address.
[   16.679568] usb 1-1: Device not responding to setup address.
[   16.887450] usb 1-1: device not accepting address 9, error -71
[   16.887513] usb 1-1: WARN: invalid context state for evaluate context command.
[   17.000462] usb 1-1: new full-speed USB device number 10 using xhci_hcd
[   17.000585] usb 1-1: Device not responding to setup address.
[   17.207563] usb 1-1: Device not responding to setup address.
[   17.415462] usb 1-1: device not accepting address 10, error -71
[   17.415515] usb 1-1: WARN: invalid context state for evaluate context command.
[   17.415560] usb usb1-port1: unable to enumerate USB device
[  441.098945] acpi_call: loading out-of-tree module taints kernel.
[  441.098951] acpi_call: module verification failed: signature and/or required key missing - tainting kernel
[  780.893459] input: Apple SPI Keyboard as /devices/pci0000:00/0000:00:15.4/spi_master/spi1/spi-APP000D:00/input/input13
[  780.902716] applespi spi-APP000D:00: Received corrupted packet (crc mismatch)
[  780.904869] applespi spi-APP000D:00: Unknown touchpad model 3 - falling back to MB8 touchpad
[  780.904974] input: Apple SPI Touchpad as /devices/pci0000:00/0000:00:15.4/spi_master/spi1/spi-APP000D:00/input/input14
[  780.914563] applespi spi-APP000D:00: modeswitch done.

Ye kaam kar gaya! 🎉

input: Apple SPI Keyboard as ... input13
input: Apple SPI Touchpad as ... input14
applespi spi-APP000D:00: modeswitch done.

Keyboard aur Touchpad dono ab SPI mode mein register ho gaye hain. ("Unknown touchpad model 3 - falling back to MB8 touchpad" sirf ek fallback note hai — basic functionality milegi, kuch advanced gestures shayad na ho, but usable hai.)

Abhi physically try karo — internal keyboard se type karo aur trackpad pe finger move karo. Kaam kar raha hai?

Agar haan, to permanent fix ke liye ye karna hoga (taaki har reboot pe manually acpi_call command na chalani pade):

sudo bash -c 'cat > /etc/systemd/system/applespi-fix.service << EOF
[Unit]
Description=Force SPI mode for Apple internal keyboard/trackpad
After=multi-user.target
Before=display-manager.service

[Service]
Type=oneshot
ExecStartPre=/sbin/modprobe acpi_call
ExecStart=/bin/sh -c "echo \"\\_SB.PCI0.SPI1.SPIT.SIEN 1\" > /proc/acpi/call"
ExecStartPost=/sbin/modprobe -r applespi
ExecStartPost=/sbin/modprobe applespi

[Install]
WantedBy=multi-user.target
EOF'

sudo systemctl daemon-reload
sudo systemctl enable applespi-fix.service

Reboot karke confirm karo ki bina manual command chalaye keyboard/touchpad kaam kar rahe hain.


chal gya bhai, mujhe ye batao fresh installed mint ke baad kya kya karna hoga. Aur ye last acpi call fix to i think har boot/login par run hoga. Can you explain the steps. I am moving away from macos as they ended support for intel macs. Also linux pe ye endlessly kaam karega na mera mac


Systemd service explain karta hoon, phir fresh-install checklist, phir longevity wala sawal.

Ye service har boot pe kaise chalti hai:

  • WantedBy=multi-user.target ka matlab hai jab bhi system boot hota hai (login se pehle hi), systemd ye service automatically start karta hai — koi manual trigger ya login-based cron nahi hai.
  • Before=display-manager.service ka matlab hai ye login screen (LightDM/GDM) aane se pehle chalti hai — isliye login screen pe hi keyboard/trackpad kaam karega.
  • Type=oneshot matlab ye ek baar chalke khatam ho jaati hai (background mein continuously nahi chalti), bas har fresh boot pe firir se ye ek baar chalegi kyunki har reboot pe controller wapas default (USB) mode mein reset ho jata hai.
  • Suspend/sleep se resume karne pe ye service nahi chalegi (wo alag trigger hai) — agar sleep ke baad bhi keyboard mar jaye to batana, uske liye alag resume-hook add karni hogi.

Fresh Mint install ke baad (MacBookPro12,1 ke liye) ye cheezein zaroor karo:

  1. WiFi — MacBook mein Broadcom chip hota hai jo aksar out-of-box kaam nahi karta. Check karo: lspci -k | grep -A3 Network. Agar driver missing dikhe, sudo apt install bcmwl-kernel-source ya broadcom-sta-dkms try karo.
  2. Applespi/keyboard fix — jo abhi humne kiya, wahi service fresh install pe bhi banani hogi (save kar lo isko kahin, e.g. GitHub gist, taaki dobara type na karna pade).
  3. Brightness control — Mac pe brightness keys kaam nahi karte aksar; xbacklight ya light tool install karo, kabhi kabhi kernel parameter acpi_backlight=native add karna padta hai.
  4. Battery/thermal management — tlp install karo (sudo apt install tlp tlp-rdw) better battery life ke liye. mbpfan bhi useful hai agar fan control weird lage.
  5. Audio — kabhi kabhi headphone jack detect nahi hota; agar issue aaye to hda-jack-retask ya specific snd-hda-intel model quirk chahiye hoga.
  6. Secure Boot / EFI cleanup — jo duplicate EFI entries the pehle, unhe efibootmgr se clean karna (already discuss ho chuka).
  7. Camera/webcam — FaceTime HD camera ke liye facetimehd driver (DKMS) chahiye hota hai agar built-in kaam na kare.

Longevity wale sawal ka jawab: Haan bilkul, Linux is hardware pe indefinitely chalega — ye community-maintained open source drivers hain (applespi, broadcom-wl, facetimehd), na ki Apple pe dependent. Jab tak x86_64 architecture supported hai kernel mein (jo decades tak rahega), tab tak aapka Mac chalta rahega — actually macOS se zyada future-proof ho jayega, kyunki Apple ne already Intel support band kar diya hai lekin Linux kernel/community abhi bhi active maintain karti hai in drivers ko.Sab set hai — reboot ke baad ek confirm kar lena ki keyboard/trackpad login screen pe bhi kaam kar rahe hain (na ki sirf desktop login hone ke baad), taaki pata chale service sahi jagah trigger ho rahi hai.


lights are working, brightness, volume is working. keyboard is working. touchpad is working. gestures configure karne honge may be.

autologin kar rakha hai. boot list clean karna hai mac ka. 2 2 efi hai. ek fixed ek black screen wala remove karna hai.|

shutdow. start. lm logo pe stuck hai kaafi time se


Good progress! Do alag cheezein hain — pehle EFI cleanup, phir boot-stuck wala asli culprit (jo apni banayi hui service ka hi side-effect lagta hai).

1. EFI boot list clean karo:

sudo efibootmgr -v

Output mein har entry ek Boot#### (jaise Boot0001, Boot0003) ke saath dikhegi. Jo entry dark-screen/hang wali hai use identify karo (usually naam "Mac OS X" ya kisi purani/duplicate Linux entry jaisa hoga), phir:

sudo efibootmgr -b XXXX -B

(XXXX ko us entry ke boot number se replace karo, jaise 0003). Isse sirf ek clean working entry bachegi.

2. "LM logo pe stuck" ka asli reason:

Ye humari banayi hui applespi-fix.service ka hi side-effect hai. Usme maine modprobe -r applespi (module remove) daala tha — agar boot ke waqt module already kisi input device se linked hai, to remove hone mein hang ho sakta hai, aur poora boot usi pe atak jaata hai (LM logo/splash screen isi wajah se der tak dikhta hai).

Fix: module ko remove-reload karne ki jagah, use pehle se load hi na hone do (blacklist), phir sirf load karo:

echo "blacklist applespi" | sudo tee /etc/modprobe.d/blacklist-applespi.conf
sudo sed -i '/^applespi$/d' /etc/initramfs-tools/modules
sudo update-initramfs -u

Ab service file edit karo:

sudo systemctl disable applespi-fix.service
sudo nano /etc/systemd/system/applespi-fix.service

Isse replace karo:

[Unit]
Description=Force SPI mode for Apple internal keyboard/trackpad
DefaultDependencies=no
After=systemd-modules-load.service
Before=sysinit.target

[Service]
Type=oneshot
ExecStartPre=/sbin/modprobe acpi_call
ExecStart=/bin/sh -c "echo \"\\_SB.PCI0.SPI1.SPIT.SIEN 1\" > /proc/acpi/call"
ExecStartPost=/sbin/modprobe applespi

[Install]
WantedBy=sysinit.target

(rmmod wala step hata diya — ab sirf ek clean load hoga, na ki remove+reload, isliye hang nahi hoga)

sudo systemctl daemon-reload
sudo systemctl enable applespi-fix.service
sudo reboot

3. Gestures ke liye: Cinnamon (Mint ka default DE) mein native multi-finger gesture support limited hai. libinput-gestures install karo:

sudo apt install libinput-gestures
sudo gpasswd -a $USER input

Phir ~/.config/libinput-gestures.conf mein swipe/pinch actions define kar sakte ho.

Reboot karke batao boot time normal hua ya nahi.


are screen aaye to edit karu na stuck hai second try me bhi


Samajh gaya — normal boot mein "quiet splash" ki wajah se pata nahi chalta kahan atka hai, aur agar Mint logo pe hi frozen hai to seedha login screen tak pahunch hi nahi rahe. Recovery ke liye GRUB tak jaana hoga (ye internal keyboard se hi possible hai, kyunki GRUB firmware-level input use karta hai, applespi driver se pehle):

1. Boot karte hi turant Shift key dabaye rakho (kabhi kabhi Esc bhi kaam karta hai) taaki GRUB menu dikhe.

2. GRUB menu mein "Advanced options for Linux Mint" select karo (arrow keys se), Enter dabao.

3. Recovery mode wali entry select karo (usually kernel version ke saath "(recovery mode)" likha hoga).

4. Recovery menu mein "root — Drop to root shell prompt" choose karo.

5. Root shell milne pe filesystem ko writable banao:

mount -o remount,rw /

6. Naya service temporarily hata do (isse boot hang fix ho jayega):

systemctl disable applespi-fix.service
rm /etc/systemd/system/applespi-fix.service
systemctl daemon-reload

7. Reboot karo:

reboot

Ab system normal boot ho jayega (bas SPI keyboard/trackpad wapas kaam nahi karenge, kyunki service hata di). Ek baar normal boot ho jaye, phir hum service ko sahi tarike se, safely dobara add karenge (is baar boot-hang-proof version ke saath, jise maine pichle message mein diya tha — lekin pehle base system stable karna zaroori hai).

Agar GRUB menu bhi na dikhe (Shift/Esc kaam na kare), turant batana — us case mein alag approach (Live USB) lagega.


normal boot ho gya is bar. ab fix karte hain. you wer right keyboard trackpad gone again.


Good, ab safe tareeke se dobara set karte hain — is baar bina modprobe -r (remove) ke, jo hang ka reason tha.

1. Applespi ko boot ke time load hi na hone do (blacklist), taaki service khud control kare:

echo "blacklist applespi" | sudo tee /etc/modprobe.d/blacklist-applespi.conf
sudo sed -i '/^applespi$/d' /etc/initramfs-tools/modules
sudo update-initramfs -u

2. acpi_call module ko permanently load karne ke liye:

echo "acpi_call" | sudo tee -a /etc/modules

3. Service file naye sirे se banao:

sudo nano /etc/systemd/system/applespi-fix.service

Poora content ye daalo:

[Unit]
Description=Force SPI mode for Apple internal keyboard/trackpad
DefaultDependencies=no
After=systemd-modules-load.service
Before=sysinit.target

[Service]
Type=oneshot
ExecStartPre=/sbin/modprobe acpi_call
ExecStart=/bin/sh -c "echo \"\\_SB.PCI0.SPI1.SPIT.SIEN 1\" > /proc/acpi/call"
ExecStartPost=/sbin/modprobe applespi

[Install]
WantedBy=sysinit.target

Save karo (Ctrl+O, Enter, Ctrl+X).

4. Enable karo aur reboot:

sudo systemctl daemon-reload
sudo systemctl enable applespi-fix.service
sudo reboot

Is baar modprobe -r (remove) step hata diya hai — sirf ek clean modprobe applespi hoga blacklist ke baad, isliye boot hang nahi hona chahiye. Reboot ke baad batao keyboard/trackpad turant kaam kar rahe hain aur boot time normal hai ya nahi.


gazab jankari rakhte ho bhai. being an engg mera itna patience nhi hai. hats off to you. May be kowledge leads to patience.

1 GRUB mein irqpoll add karo sudo nano /etc/default/grub khol ke GRUB_CMDLINE_LINUX_DEFAULT mein 'irqpoll' append karo (e.g. "quiet splash irqpoll"). Phir sudo update-grub. Ye SPI controller ke IRQ-not-firing/timeout bug ko fix karta hai.

2 acpi-call-dkms install karo sudo apt update && sudo apt install acpi-call-dkms. Ye SIEN ACPI method ko force-call karne ke liye chahiye. Phir echo "acpi_call" | sudo tee -a /etc/modules taaki module boot pe auto-load ho.

3 applespi ko early auto-load se blacklist karo echo "blacklist applespi" | sudo tee /etc/modprobe.d/blacklist-applespi.conf, aur agar /etc/modules ya /etc/initramfs-tools/modules mein applespi/intel_lpss_pci/spi_pxa2xx_platform lines hain to unhe hata do. Phir sudo update-initramfs -u. Isse driver directly load nahi hoga, service isko control karegi.

4 applespi-fix.service banao sudo nano /etc/systemd/system/applespi-fix.service mein ye final working content daalo: [Unit] Description=Force SPI mode for Apple internal keyboard/trackpad After=systemd-modules-load.service Before=display-manager.service [Service] Type=oneshot ExecStartPre=/sbin/modprobe acpi_call ExecStart=/bin/sh -c "echo "\_SB.PCI0.SPI1.SPIT.SIEN 1" > /proc/acpi/call" ExecStartPost=/sbin/modprobe applespi [Install] WantedBy=multi-user.target Note: koi 'modprobe -r' (remove) step mat daalna — wahi boot-hang ka reason tha.

5 Service enable karo sudo systemctl daemon-reload sudo systemctl enable applespi-fix.service sudo reboot Reboot ke baad dmesg | grep -i applespi check karo — 'Apple SPI Keyboard'/'Apple SPI Touchpad' aur 'modeswitch done' dikhna chahiye, bina SPI timeout errors ke.

6 WiFi driver check karo lspci -k | grep -A3 Network. Agar Broadcom chip driver missing dikhe, sudo apt install bcmwl-kernel-source (ya broadcom-sta-dkms) install karo.

7 Battery/thermal aur gestures setup karo sudo apt install tlp tlp-rdw (battery life ke liye). Trackpad gestures ke liye: sudo apt install libinput-tools xdotool wmctrl python3-pip git, phir GitHub se libinput-gestures clone-install karo (Mint repos mein nahi milta), aur user ko 'input' group mein add karo (gpasswd -a $USER input), phir logout/login.

8 Har kernel update ke baad dkms check karo sudo apt upgrade ke baad naya kernel aaye to dkms status chalao. Agar naye kernel version ke against acpi-call missing ho, sudo dkms autoinstall chala do — warna applespi-fix.service phir se fail hogi kyunki acpi_call module naye kernel ke liye build nahi hoga.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment