Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for newer kernels. (Tested on 6.11.x) #1

Open
wants to merge 2 commits into
base: touchbar-driver-hid-driver
Choose a base branch
from

Conversation

RealFX-Code
Copy link

Let me know of any compatibility issues, this patch works for me.

@snoweuph
Copy link

@RealFX-Code Ive tryed installing your Fork, because its the one which claims the newest Kernel Compatibilty with 6.1.1, but it looks like it doesnt compile on 6.12.4 anymore (im on fedora 41).

also looks like I know to little about low level stuff like this, to fix it for 6.12. can you maybe take look?

sudo make test
make -C /lib/modules/6.12.4-200.fc41.x86_64/build M=/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver modules
make[1]: Verzeichnis „/usr/src/kernels/6.12.4-200.fc41.x86_64wird betreten
  CC [M]  /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.o
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:192:6: Warnung: kein vorheriger Prototyp für »appleib_detach_and_free_hid_driver« [-Wmissing-prototypes]
  192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:752:25: Fehler: Initialisierung von »const __u8 * (*)(struct hid_device *, __u8 *, unsigned int *)« {alias »const unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)«} von inkompatiblem Zeigertyp »__u8 * (*)(struct hid_device *, __u8 *, unsigned int *)« {alias »unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)«} [-Wincompatible-pointer-types]
  752 |         .report_fixup = appleib_report_fixup,
      |                         ^~~~~~~~~~~~~~~~~~~~
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:752:25: Anmerkung: (nahe der Initialisierung für »appleib_hid_driver.report_fixup«)
make[3]: *** [scripts/Makefile.build:229: /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.o] Fehler 1
make[2]: *** [/usr/src/kernels/6.12.4-200.fc41.x86_64/Makefile:1976: /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver] Fehler 2
make[1]: *** [Makefile:236: __sub-make] Fehler 2
make[1]: Verzeichnis „/usr/src/kernels/6.12.4-200.fc41.x86_64wird verlassen
make: *** [Makefile:30: all] Fehler 2

@RealFX-Code
Copy link
Author

@RealFX-Code Ive tryed installing your Fork, because its the one which claims the newest Kernel Compatibilty with 6.1.1, but it looks like it doesnt compile on 6.12.4 anymore (im on fedora 41).

also looks like I know to little about low level stuff like this, to fix it for 6.12. can you maybe take look?

sudo make test
make -C /lib/modules/6.12.4-200.fc41.x86_64/build M=/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver modules
make[1]: Verzeichnis „/usr/src/kernels/6.12.4-200.fc41.x86_64wird betreten
  CC [M]  /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.o
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:192:6: Warnung: kein vorheriger Prototyp für »appleib_detach_and_free_hid_driver« [-Wmissing-prototypes]
  192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:752:25: Fehler: Initialisierung von »const __u8 * (*)(struct hid_device *, __u8 *, unsigned int *)« {alias »const unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)«} von inkompatiblem Zeigertyp »__u8 * (*)(struct hid_device *, __u8 *, unsigned int *)« {alias »unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)«} [-Wincompatible-pointer-types]
  752 |         .report_fixup = appleib_report_fixup,
      |                         ^~~~~~~~~~~~~~~~~~~~
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:752:25: Anmerkung: (nahe der Initialisierung für »appleib_hid_driver.report_fixup«)
make[3]: *** [scripts/Makefile.build:229: /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.o] Fehler 1
make[2]: *** [/usr/src/kernels/6.12.4-200.fc41.x86_64/Makefile:1976: /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver] Fehler 2
make[1]: *** [Makefile:236: __sub-make] Fehler 2
make[1]: Verzeichnis „/usr/src/kernels/6.12.4-200.fc41.x86_64wird verlassen
make: *** [Makefile:30: all] Fehler 2

This driver is wierd, I updated my gentoo system and it stopped compiling, iirc you can revert my two commits and it builds again.

tip: if you want me to be able to read your logs, please make them english.

@snoweuph
Copy link

snoweuph commented Dec 24, 2024

@RealFX-Code Ive tryed installing your Fork, because its the one which claims the newest Kernel Compatibilty with 6.1.1, but it looks like it doesnt compile on 6.12.4 anymore (im on fedora 41).
also looks like I know to little about low level stuff like this, to fix it for 6.12. can you maybe take look?

sudo make test
make -C /lib/modules/6.12.4-200.fc41.x86_64/build M=/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver modules
make[1]: Verzeichnis „/usr/src/kernels/6.12.4-200.fc41.x86_64wird betreten
  CC [M]  /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.o
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:192:6: Warnung: kein vorheriger Prototyp für »appleib_detach_and_free_hid_driver« [-Wmissing-prototypes]
  192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:752:25: Fehler: Initialisierung von »const __u8 * (*)(struct hid_device *, __u8 *, unsigned int *)« {alias »const unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)«} von inkompatiblem Zeigertyp »__u8 * (*)(struct hid_device *, __u8 *, unsigned int *)« {alias »unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)«} [-Wincompatible-pointer-types]
  752 |         .report_fixup = appleib_report_fixup,
      |                         ^~~~~~~~~~~~~~~~~~~~
/home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.c:752:25: Anmerkung: (nahe der Initialisierung für »appleib_hid_driver.report_fixup«)
make[3]: *** [scripts/Makefile.build:229: /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver/apple-ibridge.o] Fehler 1
make[2]: *** [/usr/src/kernels/6.12.4-200.fc41.x86_64/Makefile:1976: /home/snoweuph/Downloads/macbook12-spi-driver/macbook12-spi-driver/macbook12-spi-driver/apple-touchbar-drv/macbook12-spi-driver/macbook12-spi-driver] Fehler 2
make[1]: *** [Makefile:236: __sub-make] Fehler 2
make[1]: Verzeichnis „/usr/src/kernels/6.12.4-200.fc41.x86_64wird verlassen
make: *** [Makefile:30: all] Fehler 2

This driver is wierd, I updated my gentoo system and it stopped compiling, iirc you can revert my two commits and it builds again.

tip: if you want me to be able to read your logs, please make them english.

Oh true, sry my bad.
Also ive switched to LLVM, so thats why the log now looks a litle bit different, bu the message is basicly the same as before.

Without your two commits now:

root@fedorabook-pro:/usr/src/applespi-0.1# LANG=en LLVM=1 make test
make -C /lib/modules/6.12.4-200.fc41.x86_64/build M=/usr/src/applespi-0.1 modules
make[1]: Entering directory '/usr/src/kernels/6.12.4-200.fc41.x86_64'
  CC [M]  /usr/src/applespi-0.1/apple-ibridge.o
/usr/src/applespi-0.1/apple-ibridge.c:192:6: warning: no previous prototype for function 'appleib_detach_and_free_hid_driver' [-Wmissing-prototypes]
  192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
      |      ^
/usr/src/applespi-0.1/apple-ibridge.c:192:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
  192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
      | ^
      | static 
/usr/src/applespi-0.1/apple-ibridge.c:752:18: error: incompatible function pointer types initializing 'const __u8 *(*)(struct hid_device *, __u8 *, unsigned int *)' (aka 'const unsigned char *(*)(struct hid_device *, unsigned char *, unsigned int *)') with an expression of type '__u8 *(struct hid_device *, __u8 *, unsigned int *)' (aka 'unsigned char *(struct hid_device *, unsigned char *, unsigned int *)') [-Wincompatible-function-pointer-types]
  752 |         .report_fixup = appleib_report_fixup,
      |                         ^~~~~~~~~~~~~~~~~~~~
/usr/src/applespi-0.1/apple-ibridge.c:901:3: error: field designator 'owner' does not refer to any field in type 'struct acpi_driver'
  901 |         .owner          = THIS_MODULE,
      |         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
make[3]: *** [scripts/Makefile.build:229: /usr/src/applespi-0.1/apple-ibridge.o] Error 1
make[2]: *** [/usr/src/kernels/6.12.4-200.fc41.x86_64/Makefile:1976: /usr/src/applespi-0.1] Error 2
make[1]: *** [Makefile:236: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.12.4-200.fc41.x86_64'
make: *** [Makefile:30: all] Error 2

with them:

root@fedorabook-pro:/usr/src/applespi-0.1# LANG=en LLVM=1 make test
make -C /lib/modules/6.12.4-200.fc41.x86_64/build M=/usr/src/applespi-0.1 modules
make[1]: Entering directory '/usr/src/kernels/6.12.4-200.fc41.x86_64'
  CC [M]  /usr/src/applespi-0.1/apple-ibridge.o
/usr/src/applespi-0.1/apple-ibridge.c:192:6: warning: no previous prototype for function 'appleib_detach_and_free_hid_driver' [-Wmissing-prototypes]
  192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
      |      ^
/usr/src/applespi-0.1/apple-ibridge.c:192:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
  192 | void appleib_detach_and_free_hid_driver(struct appleib_device *ib_dev,
      | ^
      | static 
/usr/src/applespi-0.1/apple-ibridge.c:752:18: error: incompatible function pointer types initializing 'const __u8 *(*)(struct hid_device *, __u8 *, unsigned int *)' (aka 'const unsigned char *(*)(struct hid_device *, unsigned char *, unsigned int *)') with an expression of type '__u8 *(struct hid_device *, __u8 *, unsigned int *)' (aka 'unsigned char *(struct hid_device *, unsigned char *, unsigned int *)') [-Wincompatible-function-pointer-types]
  752 |         .report_fixup = appleib_report_fixup,
      |                         ^~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
make[3]: *** [scripts/Makefile.build:229: /usr/src/applespi-0.1/apple-ibridge.o] Error 1
make[2]: *** [/usr/src/kernels/6.12.4-200.fc41.x86_64/Makefile:1976: /usr/src/applespi-0.1] Error 2
make[1]: *** [Makefile:236: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.12.4-200.fc41.x86_64'
make: *** [Makefile:30: all] Error 2

both doesnt work, also I don really get the error

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