From 4b35e0dbbc23c545996c320743211cd22950c539 Mon Sep 17 00:00:00 2001 From: ston Date: Sun, 28 Apr 2024 13:20:37 +0800 Subject: [PATCH] kernel-driver: add Legion 5 15IMH6 Signed-off-by: ston --- kernel_module/legion-laptop.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/kernel_module/legion-laptop.c b/kernel_module/legion-laptop.c index 1e3723b..d720622 100644 --- a/kernel_module/legion-laptop.c +++ b/kernel_module/legion-laptop.c @@ -547,6 +547,25 @@ static const struct model_config model_kwcn = { .ramio_size = 0x600 }; +static const struct model_config model_g8cn = { + .registers = &ec_register_offsets_v0, + .check_embedded_controller_id = true, + .embedded_controller_id = 0x5507, + .memoryio_physical_ec_start = 0xC400, + .memoryio_size = 0x300, + .has_minifancurve = true, + .has_custom_powermode = true, + .access_method_powermode = ACCESS_METHOD_WMI, + .access_method_keyboard = ACCESS_METHOD_WMI, + .access_method_fanspeed = ACCESS_METHOD_WMI3, + .access_method_temperature = ACCESS_METHOD_WMI3, + .access_method_fancurve = ACCESS_METHOD_WMI3, + .access_method_fanfullspeed = ACCESS_METHOD_WMI, + .acpi_check_dev = true, + .ramio_physical_start = 0xFE0B0400, + .ramio_size = 0x600 +}; + static const struct model_config model_m0cn = { .registers = &ec_register_offsets_v0, .check_embedded_controller_id = true, @@ -1099,6 +1118,15 @@ static const struct dmi_system_id optimistic_allowlist[] = { }, .driver_data = (void *)&model_kwcn }, + { + // e.g. Legion 5 15IMH6 + .ident = "G8CN", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_BIOS_VERSION, "G8CN"), + }, + .driver_data = (void *)&model_g8cn + }, { // e.g. Legion Pro 5 2023 or R9000P .ident = "LPCN",