From f566db3fa89597cc4c4897a090469bae98ccbd7d Mon Sep 17 00:00:00 2001 From: Owen Williams Date: Mon, 4 Nov 2024 22:37:41 -0500 Subject: [PATCH 1/2] Update for kernel 6.12: Switch to the new Intel CPU defines. Kernel 6.12 changed the Intel CPU define names and removed the X86_MATCH_VENDOR_FAM_MODEL; update tuxedo_keyboard.c to match. --- src/tuxedo_keyboard.c | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/src/tuxedo_keyboard.c b/src/tuxedo_keyboard.c index cc5110c..36e3af7 100644 --- a/src/tuxedo_keyboard.c +++ b/src/tuxedo_keyboard.c @@ -25,6 +25,7 @@ #include #include #include +#include MODULE_AUTHOR("TUXEDO Computers GmbH "); MODULE_DESCRIPTION("TUXEDO Computers keyboard & keyboard backlight Driver"); @@ -171,6 +172,13 @@ EXPORT_SYMBOL(tuxedo_keyboard_remove_driver); #define INTEL_FAM6_RAPTORLAKE_P 0xBA #define INTEL_FAM6_RAPTORLAKE_S 0xBF +// ALDERLAKE_N doesn't seem to be present in the current kernel header at all +#define INTEL_ALDERLAKE_N INTEL_FAM6_ALDERLAKE_N + +// Compatibility defines: kernel 6.12 renamed the Intel CPU model defines, see e.g. +// https://github.com/torvalds/linux/commit/6568fc18c2f62 and +// https://github.com/torvalds/linux/commit/13ad4848dde0f83a27d433f7e11722924de1d506 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) static const struct x86_cpu_id skip_tuxedo_dmi_string_check_match[] __initconst = { X86_MATCH_INTEL_FAM6_MODEL(CORE_YONAH, NULL), X86_MATCH_INTEL_FAM6_MODEL(CORE2_MEROM, NULL), @@ -261,6 +269,98 @@ static const struct x86_cpu_id skip_tuxedo_dmi_string_check_match[] __initconst X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 0x50, NULL), // Zen 3 Cezanne { } }; +#else +static const struct x86_cpu_id skip_tuxedo_dmi_string_check_match[] __initconst = { + X86_MATCH_VFM(INTEL_CORE_YONAH, NULL), + X86_MATCH_VFM(INTEL_CORE2_MEROM, NULL), + X86_MATCH_VFM(INTEL_CORE2_MEROM_L, NULL), + X86_MATCH_VFM(INTEL_CORE2_PENRYN, NULL), + X86_MATCH_VFM(INTEL_CORE2_DUNNINGTON, NULL), + X86_MATCH_VFM(INTEL_NEHALEM, NULL), + X86_MATCH_VFM(INTEL_NEHALEM_G, NULL), + X86_MATCH_VFM(INTEL_NEHALEM_EP, NULL), + X86_MATCH_VFM(INTEL_NEHALEM_EX, NULL), + X86_MATCH_VFM(INTEL_WESTMERE, NULL), + X86_MATCH_VFM(INTEL_WESTMERE_EP, NULL), + X86_MATCH_VFM(INTEL_WESTMERE_EX, NULL), + X86_MATCH_VFM(INTEL_SANDYBRIDGE, NULL), + X86_MATCH_VFM(INTEL_SANDYBRIDGE_X, NULL), + X86_MATCH_VFM(INTEL_IVYBRIDGE, NULL), + X86_MATCH_VFM(INTEL_IVYBRIDGE_X, NULL), + X86_MATCH_VFM(INTEL_HASWELL, NULL), + X86_MATCH_VFM(INTEL_HASWELL_X, NULL), + X86_MATCH_VFM(INTEL_HASWELL_L, NULL), + X86_MATCH_VFM(INTEL_HASWELL_G, NULL), + X86_MATCH_VFM(INTEL_BROADWELL, NULL), + X86_MATCH_VFM(INTEL_BROADWELL_G, NULL), + X86_MATCH_VFM(INTEL_BROADWELL_X, NULL), + X86_MATCH_VFM(INTEL_BROADWELL_D, NULL), + X86_MATCH_VFM(INTEL_SKYLAKE_L, NULL), + X86_MATCH_VFM(INTEL_SKYLAKE, NULL), + X86_MATCH_VFM(INTEL_SKYLAKE_X, NULL), + X86_MATCH_VFM(INTEL_KABYLAKE_L, NULL), + X86_MATCH_VFM(INTEL_KABYLAKE, NULL), + X86_MATCH_VFM(INTEL_COMETLAKE, NULL), + X86_MATCH_VFM(INTEL_COMETLAKE_L, NULL), + X86_MATCH_VFM(INTEL_CANNONLAKE_L, NULL), + X86_MATCH_VFM(INTEL_ICELAKE_X, NULL), + X86_MATCH_VFM(INTEL_ICELAKE_D, NULL), + X86_MATCH_VFM(INTEL_ICELAKE, NULL), + X86_MATCH_VFM(INTEL_ICELAKE_L, NULL), + X86_MATCH_VFM(INTEL_ICELAKE_NNPI, NULL), + X86_MATCH_VFM(INTEL_LAKEFIELD, NULL), + X86_MATCH_VFM(INTEL_ROCKETLAKE, NULL), + X86_MATCH_VFM(INTEL_TIGERLAKE_L, NULL), + X86_MATCH_VFM(INTEL_TIGERLAKE, NULL), + X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, NULL), // 12th Gen Xeon + //X86_MATCH_VFM(INTEL_EMERALDRAPIDS_X, NULL), // 13th Gen Xeon + X86_MATCH_VFM(INTEL_ALDERLAKE, NULL), // 12th Gen + X86_MATCH_VFM(INTEL_ALDERLAKE_L, NULL), // 12th Gen + X86_MATCH_VFM(INTEL_ALDERLAKE_N, NULL), // 12th Gen Atom + X86_MATCH_VFM(INTEL_RAPTORLAKE, NULL), // 13th Gen + X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL), // 13th Gen + X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL), // 13th Gen + X86_MATCH_VFM(INTEL_ATOM_BONNELL, NULL), + X86_MATCH_VFM(INTEL_ATOM_BONNELL_MID, NULL), + X86_MATCH_VFM(INTEL_ATOM_SALTWELL, NULL), + X86_MATCH_VFM(INTEL_ATOM_SALTWELL_MID, NULL), + X86_MATCH_VFM(INTEL_ATOM_SALTWELL_TABLET, NULL), + X86_MATCH_VFM(INTEL_ATOM_SILVERMONT, NULL), + X86_MATCH_VFM(INTEL_ATOM_SILVERMONT_D, NULL), + X86_MATCH_VFM(INTEL_ATOM_SILVERMONT_MID, NULL), + X86_MATCH_VFM(INTEL_ATOM_AIRMONT, NULL), + X86_MATCH_VFM(INTEL_ATOM_AIRMONT_MID, NULL), + X86_MATCH_VFM(INTEL_ATOM_AIRMONT_NP, NULL), + X86_MATCH_VFM(INTEL_ATOM_GOLDMONT, NULL), + X86_MATCH_VFM(INTEL_ATOM_GOLDMONT_D, NULL), + X86_MATCH_VFM(INTEL_ATOM_GOLDMONT_PLUS, NULL), + X86_MATCH_VFM(INTEL_ATOM_TREMONT_D, NULL), + X86_MATCH_VFM(INTEL_ATOM_TREMONT, NULL), + X86_MATCH_VFM(INTEL_ATOM_TREMONT_L, NULL), + X86_MATCH_VFM(INTEL_XEON_PHI_KNL, NULL), + X86_MATCH_VFM(INTEL_XEON_PHI_KNM, NULL), + X86_MATCH_VENDOR_FAM_MODEL(INTEL, 5, INTEL_FAM5_QUARK_X1000, NULL), + X86_MATCH_VENDOR_FAM(AMD, 5, NULL), + X86_MATCH_VENDOR_FAM(AMD, 6, NULL), + X86_MATCH_VENDOR_FAM(AMD, 15, NULL), + X86_MATCH_VENDOR_FAM(AMD, 16, NULL), + X86_MATCH_VENDOR_FAM(AMD, 17, NULL), + X86_MATCH_VENDOR_FAM(AMD, 18, NULL), + X86_MATCH_VENDOR_FAM(AMD, 19, NULL), + X86_MATCH_VENDOR_FAM(AMD, 20, NULL), + X86_MATCH_VENDOR_FAM(AMD, 21, NULL), + X86_MATCH_VENDOR_FAM(AMD, 22, NULL), + X86_MATCH_VENDOR_FAM(AMD, 23, NULL), // Zen, Zen+, Zen 2 + X86_MATCH_VENDOR_FAM(AMD, 24, NULL), // Zen + X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 0x01, NULL), // Zen 3 Epyc + X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 0x08, NULL), // Zen 3 Threadripper + X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 0x21, NULL), // Zen 3 Vermeer + X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 0x40, NULL), // Zen 3+ Rembrandt + X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 0x44, NULL), // Zen 3+ Rembrandt + X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 0x50, NULL), // Zen 3 Cezanne + { } +}; +#endif static const struct x86_cpu_id force_tuxedo_dmi_string_check_match[] __initconst = { { } From 4afa25ab96db4273a843e39b0069abd62f3f84c9 Mon Sep 17 00:00:00 2001 From: Owen Williams Date: Mon, 4 Nov 2024 23:02:22 -0500 Subject: [PATCH 2/2] Fix missing-prototypes warnings/errors. --- src/clevo_acpi.c | 4 ++-- src/clevo_wmi.c | 2 +- src/tuxedo_io/tuxedo_io.c | 2 +- src/tuxedo_keyboard_common.h | 2 +- src/uniwill_wmi.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/clevo_acpi.c b/src/clevo_acpi.c index 2a79a23..9ea9624 100644 --- a/src/clevo_acpi.c +++ b/src/clevo_acpi.c @@ -79,7 +79,7 @@ static int clevo_acpi_evaluate(struct acpi_device *device, u8 cmd, u32 arg, unio return status; } -int clevo_acpi_interface_method_call(u8 cmd, u32 arg, union acpi_object **result_value) +static int clevo_acpi_interface_method_call(u8 cmd, u32 arg, union acpi_object **result_value) { int status = 0; @@ -137,7 +137,7 @@ static void clevo_acpi_remove(struct acpi_device *device) #endif } -void clevo_acpi_notify(struct acpi_device *device, u32 event) +static void clevo_acpi_notify(struct acpi_device *device, u32 event) { u32 event_value; union acpi_object *out_obj; diff --git a/src/clevo_wmi.c b/src/clevo_wmi.c index 8b412be..4fb14ee 100644 --- a/src/clevo_wmi.c +++ b/src/clevo_wmi.c @@ -55,7 +55,7 @@ static int clevo_wmi_evaluate(u32 wmi_method_id, u32 wmi_arg, union acpi_object return return_status; } -int clevo_wmi_interface_method_call(u8 cmd, u32 arg, union acpi_object **result_value) +static int clevo_wmi_interface_method_call(u8 cmd, u32 arg, union acpi_object **result_value) { return clevo_wmi_evaluate(cmd, arg, result_value); } diff --git a/src/tuxedo_io/tuxedo_io.c b/src/tuxedo_io/tuxedo_io.c index 38c3337..fca1bcd 100644 --- a/src/tuxedo_io/tuxedo_io.c +++ b/src/tuxedo_io/tuxedo_io.c @@ -112,7 +112,7 @@ static int tdp_max_gmxpxxx[] = { 0x82, 0x82, 0xc8 }; static int *tdp_min_defs = NULL; static int *tdp_max_defs = NULL; -void uw_id_tdp(void) +static void uw_id_tdp(void) { if (uw_feats->model == UW_MODEL_PH4TUX) { tdp_min_defs = tdp_min_ph4tux; diff --git a/src/tuxedo_keyboard_common.h b/src/tuxedo_keyboard_common.h index aae510b..3253832 100644 --- a/src/tuxedo_keyboard_common.h +++ b/src/tuxedo_keyboard_common.h @@ -61,7 +61,7 @@ void tuxedo_keyboard_remove_driver(struct tuxedo_keyboard_driver *tk_driver); /** * Basically a copy of the existing report event but doesn't report unknown events */ -bool sparse_keymap_report_known_event(struct input_dev *dev, unsigned int code, +inline bool sparse_keymap_report_known_event(struct input_dev *dev, unsigned int code, unsigned int value, bool autorelease) { const struct key_entry *ke = diff --git a/src/uniwill_wmi.c b/src/uniwill_wmi.c index 009e199..9e903fc 100644 --- a/src/uniwill_wmi.c +++ b/src/uniwill_wmi.c @@ -249,7 +249,7 @@ static int uw_ec_write_addr_direct(u8 addr_low, u8 addr_high, u8 data_low, u8 da return result; } -int uw_wmi_read_ec_ram(u16 addr, u8 *data) +static int uw_wmi_read_ec_ram(u16 addr, u8 *data) { int result; u8 addr_low, addr_high; @@ -271,7 +271,7 @@ int uw_wmi_read_ec_ram(u16 addr, u8 *data) return result; } -int uw_wmi_write_ec_ram(u16 addr, u8 data) +static int uw_wmi_write_ec_ram(u16 addr, u8 data) { int result; u8 addr_low, addr_high, data_low, data_high;