From: Stroopwafe1 <48443491+Stroopwafe1@users.noreply.github.com>
Date: Mon, 25 Nov 2024 08:15:40 +0100
Subject: Update to Linux 6.12

Description: Update to Linux 6.12
Author: Stroopwafe1 <48443491+Stroopwafe1@users.noreply.github.com>
Forwarded: not-needed
Origin: https://github.com/DIGImend/digimend-kernel-drivers/pull/707
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1089494

Original patch doesn't case 6.11, so tweak for 6.11 a bit.


Signed-off-by: Kentaro Hayashi <kenhys@xdump.org>
---
 hid-kye.c            | 6 ++++++
 hid-polostar.c       | 6 ++++++
 hid-uclogic-core.c   | 6 ++++++
 hid-uclogic-params.c | 5 +++++
 hid-uclogic-rdesc.c  | 5 +++++
 hid-viewsonic.c      | 6 ++++++
 6 files changed, 34 insertions(+)

diff --git a/hid-kye.c b/hid-kye.c
index 5fde67f..f4f07bb 100644
--- a/hid-kye.c
+++ b/hid-kye.c
@@ -17,6 +17,7 @@
 #include <linux/device.h>
 #include <linux/hid.h>
 #include <linux/module.h>
+#include <linux/version.h>
 
 #include "hid-ids.h"
 
@@ -579,8 +580,13 @@ static __u8 *kye_consumer_control_fixup(struct hid_device *hdev, __u8 *rdesc,
 	return rdesc;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
 static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int *rsize)
+#else
+static const __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+		unsigned int *rsize)
+#endif
 {
 	switch (hdev->product) {
 	case USB_DEVICE_ID_KYE_ERGO_525V:
diff --git a/hid-polostar.c b/hid-polostar.c
index ecbe02c..df51069 100644
--- a/hid-polostar.c
+++ b/hid-polostar.c
@@ -16,6 +16,7 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/usb.h>
+#include <linux/version.h>
 
 #include "hid-ids.h"
 
@@ -149,8 +150,13 @@ static __u8 pt1001_rdesc_fixed[] = {
 	0xC0,               /*  End Collection                          */
 };
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
 static __u8 *polostar_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 				   unsigned int *rsize)
+#else
+static const __u8 *polostar_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+				   unsigned int *rsize)
+#endif
 {
 	struct usb_interface *iface = to_usb_interface(hdev->dev.parent);
 	__u8 iface_num = iface->cur_altsetting->desc.bInterfaceNumber;
diff --git a/hid-uclogic-core.c b/hid-uclogic-core.c
index 3b3e226..5fefd57 100644
--- a/hid-uclogic-core.c
+++ b/hid-uclogic-core.c
@@ -17,6 +17,7 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/timer.h>
+#include <linux/version.h>
 #include "usbhid/usbhid.h"
 #include "hid-uclogic-params.h"
 
@@ -53,8 +54,13 @@ static void uclogic_inrange_timeout(struct timer_list *t)
 	input_sync(input);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
 static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 					unsigned int *rsize)
+#else
+static const __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+					unsigned int *rsize)
+#endif
 {
 	struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
 
diff --git a/hid-uclogic-params.c b/hid-uclogic-params.c
index a139323..2b38379 100644
--- a/hid-uclogic-params.c
+++ b/hid-uclogic-params.c
@@ -19,7 +19,12 @@
 #include "hid-ids.h"
 #include <linux/ctype.h>
 #include <linux/string.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
 #include <asm/unaligned.h>
+#else
+#include <linux/unaligned.h>
+#endif
 
 #include <linux/version.h>
 
diff --git a/hid-uclogic-rdesc.c b/hid-uclogic-rdesc.c
index c26bfb1..dda733a 100644
--- a/hid-uclogic-rdesc.c
+++ b/hid-uclogic-rdesc.c
@@ -16,7 +16,12 @@
 
 #include "hid-uclogic-rdesc.h"
 #include <linux/slab.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
 #include <asm/unaligned.h>
+#else
+#include <linux/unaligned.h>
+#endif
 
 /* Fixed WP4030U report descriptor */
 __u8 uclogic_rdesc_wp4030u_fixed_arr[] = {
diff --git a/hid-viewsonic.c b/hid-viewsonic.c
index d887ac1..0d526c3 100644
--- a/hid-viewsonic.c
+++ b/hid-viewsonic.c
@@ -16,6 +16,7 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/usb.h>
+#include <linux/version.h>
 
 #include "hid-ids.h"
 
@@ -71,8 +72,13 @@ static __u8 pd1011_rdesc_fixed[] = {
 	0xC0                    /*  End Collection                      */
 };
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
 static __u8 *viewsonic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 				    unsigned int *rsize)
+#else
+static const __u8 *viewsonic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+				    unsigned int *rsize)
+#endif
 {
 	switch (hdev->product) {
 	case USB_DEVICE_ID_VIEWSONIC_PD1011:
