@ -0,0 +1,32 @@ | |||
modname := clevo-xsm-wmi | |||
obj-m := $(modname).o | |||
KVERSION := $(shell uname -r) | |||
KDIR := /lib/modules/$(KVERSION)/build | |||
PWD := "$$(pwd)" | |||
ifdef DEBUG | |||
CFLAGS_$(obj-m) := -DDEBUG | |||
endif | |||
default: | |||
$(MAKE) -C $(KDIR) M=$(PWD) modules | |||
clean: | |||
$(MAKE) O=$(PWD) -C $(KDIR) M=$(PWD) clean | |||
load: | |||
-rmmod $(modname) | |||
insmod $(modname).ko | |||
install: | |||
mkdir -p /lib/modules/$(KVERSION)/misc/$(modname) | |||
install -m 0755 -o root -g root $(modname).ko /lib/modules/$(KVERSION)/kernel/drivers/input/keyboard/$(modname) | |||
depmod -a | |||
uninstall: | |||
rm /lib/modules/$(KVERSION)/kernel/drivers/input/keyboard/$(modname)/$(modname).ko | |||
rmdir /lib/modules/$(KVERSION)/kernel/drivers/input/keyboard/$(modname) | |||
rmdir /lib/modules/$(KVERSION)/kernel/drivers/input/keyboard | |||
depmod -a | |||
@ -0,0 +1,52 @@ | |||
# Maintainer: Marc ROZANC <marc@rozanc.fr> | |||
# Contributor: Pekka Helenius <fincer89@hotmail.com> | |||
_pkgbase='clevo-xsm-wmi' | |||
_modname=$_pkgbase | |||
pkgname="${_pkgbase}-dkms" | |||
pkgver='1.1' | |||
_pkgtag='6bfe9fe44e04' | |||
pkgrel=6 | |||
pkgdesc='A reverse engineering driver for the Clevo SM series backlight keyboard (DKMS version)' | |||
arch=('i686' 'x86_64') | |||
license=('GPL') | |||
url='https://bitbucket.org/tuxedocomputers/clevo-xsm-wmi' | |||
options=(!emptydirs) | |||
conflicts=("$_pkgbase" 'tuxedo-wmi' 'tuxedo-wmi-dkms') | |||
provides=("$_pkgbase") | |||
depends=('dkms' 'gcc' 'make' 'linux-headers') | |||
source=("clevo-xsm-wmi-${pkgver}.src.tar.gz::https://bitbucket.org/tuxedocomputers/clevo-xsm-wmi/get/v${pkgver}.tar.gz" | |||
"dkms.conf" | |||
"Makefile" | |||
"linux_4_14.diff" | |||
patch_n950tp6-support.patch | |||
patch_add-orange.patch) | |||
sha256sums=('630ff6dbfa90c8a9285badf75b60579b2a9495e85862b62ef77a3654535e4b72' | |||
'0cdf0213692a71d69f54730d1856d9f1e7b3d363d9b2a66a5d6bb363e8d8212f' | |||
'fb20847bde676a305fda41b865b46aff52ae9de60e1262d6e9725a71d72b806b' | |||
'8aac7728933f6dd8796853b389049829fb46a3042ff423ee087ca0f86a3196a0' | |||
'5cd43e09f262db1732422c874774869114362586febe00bb6341a5e8932059c9' | |||
'4e2833df06f88efae08043fee711c9bba80b769a7f51f860a729afaab0d0fa51') | |||
install='clevo-xsm-wmi-dkms.install' | |||
prepare() { | |||
cd "${srcdir}/tuxedocomputers-clevo-xsm-wmi-${_pkgtag}" | |||
patch -i "${srcdir}/linux_4_14.diff" -p1 | |||
patch -Np1 -i ../patch_n950tp6-support.patch | |||
patch -Np1 -i ../patch_add-orange.patch | |||
} | |||
package() { | |||
cd "${srcdir}/tuxedocomputers-clevo-xsm-wmi-${_pkgtag}/module" | |||
# Copy sources (including Makefile) | |||
install -dm755 "${pkgdir}/usr/src/${_modname}-${pkgver}/" | |||
install -Dm644 "${srcdir}/Makefile" "${srcdir}/dkms.conf" "clevo-xsm-wmi.c" "${pkgdir}/usr/src/${_modname}-${pkgver}/" | |||
# Copy license | |||
install -Dm644 "/usr/share/licenses/common/GPL2/license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" | |||
# Module loading | |||
install -Dm644 /dev/null "$pkgdir/usr/lib/modules-load.d/$pkgname.conf" | |||
echo "clevo-xsm-wmi" > "$pkgdir/usr/lib/modules-load.d/$pkgname.conf" | |||
} |
@ -0,0 +1,11 @@ | |||
#!/bin/bash | |||
# arg 1: the new package version | |||
# arg 2: the old package version | |||
post_upgrade() { | |||
if (( $(vercmp $2 8.0-2) < 0 )); then | |||
echo '==> Since version 8.0-2 kernel modules are loaded at boot by systemd-modules-load.' | |||
echo '==> Read modules-load.d man page to disable them.' | |||
fi | |||
} | |||
@ -0,0 +1,8 @@ | |||
PACKAGE_NAME="clevo-xsm-wmi" | |||
PACKAGE_VERSION="#MODULE_VERSION#" | |||
AUTOINSTALL="yes" | |||
CLEAN="make clean" | |||
MAKE[0]="make KVERSION=$kernelver" | |||
BUILT_MODULE_NAME[0]="clevo-xsm-wmi" | |||
DEST_MODULE_LOCATION[0]="/kernel/drivers/input/keyboard" | |||
@ -0,0 +1,13 @@ | |||
diff --git a/module/clevo-xsm-wmi.c b/module/clevo-xsm-wmi.c | |||
index 162577b..2e7406a 100644 | |||
--- a/module/clevo-xsm-wmi.c | |||
+++ b/module/clevo-xsm-wmi.c | |||
@@ -431,7 +431,7 @@ static int clevo_xsm_wmi_evaluate_wmbb_method(u32 method_id, u32 arg, | |||
CLEVO_XSM_DEBUG("%0#4x IN : %0#6x\n", method_id, arg); | |||
- status = wmi_evaluate_method(CLEVO_GET_GUID, 0x01, | |||
+ status = wmi_evaluate_method(CLEVO_GET_GUID, 0x00, | |||
method_id, &in, &out); | |||
if (unlikely(ACPI_FAILURE(status))) |
@ -0,0 +1,25 @@ | |||
--- a/module/clevo-xsm-wmi.c | |||
+++ b/module/clevo-xsm-wmi.c | |||
@@ -66,7 +66,8 @@ | |||
#define COLORS { C(black, 0x000000), C(blue, 0x0000FF), \ | |||
C(red, 0xFF0000), C(magenta, 0xFF00FF), \ | |||
C(green, 0x00FF00), C(cyan, 0x00FFFF), \ | |||
- C(yellow, 0xFFFF00), C(white, 0xFFFFFF), } | |||
+ C(yellow, 0xFFFF00), C(white, 0xFFFFFF), \ | |||
+ C(orange, 0xFF7F00), } | |||
#undef C | |||
#define C(n, v) KB_COLOR_##n | |||
--- a/utility/mainwindow.h | |||
+++ b/utility/mainwindow.h | |||
@@ -20,8 +20,8 @@ | |||
#ifndef MAINWINDOW_H | |||
#define MAINWINDOW_H | |||
-#define COLORS { C(black), C(blue), C(red), C(magenta), C(green), C(cyan), C(yellow), C(white) } | |||
-#define COLORS_AMOUNT 8 | |||
+#define COLORS { C(black), C(blue), C(red), C(magenta), C(green), C(cyan), C(yellow), C(orange), C(white) } | |||
+#define COLORS_AMOUNT 9 | |||
#include <QFile> | |||
#include <QTextStream> |
@ -0,0 +1,17 @@ | |||
--- a/module/clevo-xsm-wmi.c | |||
+++ b/module/clevo-xsm-wmi.c | |||
@@ -1488,6 +1488,14 @@ | |||
.driver_data = &kb_8_color_ops, | |||
}, | |||
{ | |||
+ .ident = "Clevo N950TP", | |||
+ .matches = { | |||
+ DMI_MATCH(DMI_PRODUCT_NAME, "N95TP6"), | |||
+ }, | |||
+ .callback = clevo_xsm_dmi_matched, | |||
+ .driver_data = &kb_full_color_ops, | |||
+ }, | |||
+ { | |||
/* terminating NULL entry */ | |||
}, | |||
}; |