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

Added support kernel version newer than > 5.3 #1

Open
wants to merge 3 commits into
base: touchbar-driver-hid-driver
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
4 changes: 2 additions & 2 deletions apple-ibridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 18 additions & 8 deletions dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"