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 1 commit
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
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
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

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
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"