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.
This commit is contained in:
Owen Williams 2024-11-04 22:37:41 -05:00
parent 1da421c5fc
commit f566db3fa8

View file

@ -25,6 +25,7 @@
#include <asm/cpu_device_id.h> #include <asm/cpu_device_id.h>
#include <asm/intel-family.h> #include <asm/intel-family.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/version.h>
MODULE_AUTHOR("TUXEDO Computers GmbH <tux@tuxedocomputers.com>"); MODULE_AUTHOR("TUXEDO Computers GmbH <tux@tuxedocomputers.com>");
MODULE_DESCRIPTION("TUXEDO Computers keyboard & keyboard backlight Driver"); 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_P 0xBA
#define INTEL_FAM6_RAPTORLAKE_S 0xBF #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 = { 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(CORE_YONAH, NULL),
X86_MATCH_INTEL_FAM6_MODEL(CORE2_MEROM, 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 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 = { static const struct x86_cpu_id force_tuxedo_dmi_string_check_match[] __initconst = {
{ } { }