From 4fd793f8f3643c8978c16c8709d45a09ed898d64 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Thu, 26 Dec 2024 23:10:54 +0500 Subject: [PATCH 1/2] Fix build on linux 6.12 (closed #1) --- hid-sony-fix-dkms.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hid-sony-fix-dkms.c b/hid-sony-fix-dkms.c index c970c2d..1dc7f48 100644 --- a/hid-sony-fix-dkms.c +++ b/hid-sony-fix-dkms.c @@ -40,7 +40,13 @@ #include #include #include +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,12,0) #include +#else +#include +#endif #include "hid-ids.h" @@ -937,8 +943,12 @@ static int ds4_mapping(struct hid_device *hdev, struct hid_input *hi, return 0; } -static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc, - unsigned int *rsize) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,12,0) +static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *rsize) +#else +static const __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) +#endif + { struct sony_sc *sc = hid_get_drvdata(hdev); From ac45a5ff8623666807d4d3d25d1c95b9118db6e4 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Sun, 29 Dec 2024 13:02:08 +0500 Subject: [PATCH 2/2] Added post install and post remove to blacklist hid-sony --- dkms.conf | 3 +++ dkms.post_install | 4 ++++ dkms.post_remove | 4 ++++ etc-modprobe.d/hid-sony-blacklist.conf | 1 + 4 files changed, 12 insertions(+) create mode 100755 dkms.post_install create mode 100755 dkms.post_remove create mode 100644 etc-modprobe.d/hid-sony-blacklist.conf diff --git a/dkms.conf b/dkms.conf index ea995a0..0c75a8f 100644 --- a/dkms.conf +++ b/dkms.conf @@ -5,3 +5,6 @@ CLEAN="make clean" BUILT_MODULE_NAME[0]="hid-sony-fix-dkms" DEST_MODULE_LOCATION[0]="/kernel/drivers/hid" AUTOINSTALL="yes" + +POST_INSTALL="dkms.post_install" +POST_REMOVE="dkms.post_remove" diff --git a/dkms.post_install b/dkms.post_install new file mode 100755 index 0000000..8668388 --- /dev/null +++ b/dkms.post_install @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Installing modalias database..." +install -D -m 0644 -t /etc/modprobe.d etc-modprobe.d/hid-sony-blacklist.conf diff --git a/dkms.post_remove b/dkms.post_remove new file mode 100755 index 0000000..5410938 --- /dev/null +++ b/dkms.post_remove @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Uninstalling modalias database..." +rm -f /etc/modprobe.d/hid-sony-blacklist.conf diff --git a/etc-modprobe.d/hid-sony-blacklist.conf b/etc-modprobe.d/hid-sony-blacklist.conf new file mode 100644 index 0000000..e6910aa --- /dev/null +++ b/etc-modprobe.d/hid-sony-blacklist.conf @@ -0,0 +1 @@ +blacklist hid_sony