diff --git a/Makefile b/Makefile index 7d45462..c70535a 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,28 @@ -obj-m += applespi.o -obj-m += apple-ibridge.o -obj-m += apple-ib-tb.o -obj-m += apple-ib-als.o - CFLAGS_applespi.o = -I$(src) # for tracing +CONFIG_MODULE_SIG=n +CONFIG_MODULE_SIG_ALL=n +# CONFIG_MODULE_SIG_FORCE is not set +# CONFIG_MODULE_SIG_SHA1 is not set +# CONFIG_MODULE_SIG_SHA224 is not set +# CONFIG_MODULE_SIG_SHA256 is not set +# CONFIG_MODULE_SIG_SHA384 is not set + KVERSION := $(KERNELRELEASE) ifeq ($(origin KERNELRELEASE), undefined) KVERSION := $(shell uname -r) endif + +ifneq ($(KVERSION),) + ifeq ($(shell expr $(KVERSION) \< 5.3), 1) + obj-m += applespi.o + endif +endif + +obj-m += apple-ibridge.o +obj-m += apple-ib-tb.o +obj-m += apple-ib-als.o + KDIR := /lib/modules/$(KVERSION)/build PWD := $(shell pwd) diff --git a/README.md b/README.md index 0884742..8419979 100644 --- a/README.md +++ b/README.md @@ -89,3 +89,4 @@ Some useful threads: -------------------- * https://bugzilla.kernel.org/show_bug.cgi?id=108331 * https://bugzilla.kernel.org/show_bug.cgi?id=99891 +* https://gist.github.com/almas/5f75adb61bccf604b6572f763ce63e3e (Ubuntu LTS on MacBook Pro 2017 (A1707, MBP 14,3)) diff --git a/apple-ibridge.c b/apple-ibridge.c index b6983e6..b176e32 100644 --- a/apple-ibridge.c +++ b/apple-ibridge.c @@ -843,13 +843,13 @@ static int appleib_probe(struct acpi_device *acpi) return 0; } -static int appleib_remove(struct acpi_device *acpi) +static void appleib_remove(struct acpi_device *acpi) { struct appleib_device *ib_dev = acpi_driver_data(acpi); hid_unregister_driver(&ib_dev->ib_driver); - return 0; + return; } static int appleib_suspend(struct device *dev) diff --git a/dkms.conf b/dkms.conf index 9c72046..cb98b8e 100644 --- a/dkms.conf +++ b/dkms.conf @@ -2,13 +2,23 @@ PACKAGE_NAME="applespi" PACKAGE_VERSION="0.1" CLEAN="make clean" MAKE="make" -BUILT_MODULE_NAME[0]="applespi" -BUILT_MODULE_NAME[1]="apple-ibridge" -BUILT_MODULE_NAME[2]="apple-ib-tb" -BUILT_MODULE_NAME[3]="apple-ib-als" -DEST_MODULE_LOCATION[0]="/updates" -DEST_MODULE_LOCATION[1]="/updates" -DEST_MODULE_LOCATION[2]="/updates" -DEST_MODULE_LOCATION[3]="/updates" +if [ "$(uname -r | cut -d. -f1-2)" \< "5.3" ]; then + BUILT_MODULE_NAME[0]="applespi" + BUILT_MODULE_NAME[1]="apple-ibridge" + BUILT_MODULE_NAME[2]="apple-ib-tb" + BUILT_MODULE_NAME[3]="apple-ib-als" + DEST_MODULE_LOCATION[0]="/updates" + DEST_MODULE_LOCATION[1]="/updates" + DEST_MODULE_LOCATION[2]="/updates" + DEST_MODULE_LOCATION[3]="/updates" +else + BUILT_MODULE_NAME[0]="apple-ibridge" + BUILT_MODULE_NAME[1]="apple-ib-tb" + BUILT_MODULE_NAME[2]="apple-ib-als" + DEST_MODULE_LOCATION[0]="/updates" + DEST_MODULE_LOCATION[1]="/updates" + DEST_MODULE_LOCATION[2]="/updates" +fi + AUTOINSTALL="yes" REMAKE_INITRD="yes"