diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8126eab --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*] +indent_style = tab +indent_size = 8 +tab_width = 8 diff --git a/.gitignore b/.gitignore index b2d5fa9..d073fc8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ /msi-ec.mod.c /Module.symvers /modules.order -.vscode \ No newline at end of file +.vscode +.cache +compile_commands.json diff --git a/msi-ec.c b/msi-ec.c index ea975e9..6da67ff 100644 --- a/msi-ec.c +++ b/msi-ec.c @@ -1316,6 +1316,85 @@ static struct msi_ec_conf CONF15 __initdata = { }, }; +/* MSI Modern 15 A5M */ +static const char *ALLOWED_FW_16[] __initconst = { + "155LEMS1.105", + "155LEMS1.106", + NULL +}; + +static struct msi_ec_conf CONF16 __initdata = { + .allowed_fw = ALLOWED_FW_16, + .charge_control = { + .address = 0xef, + .offset_start = 0x8a, + .offset_end = 0x80, + .range_min = 0x8a, + .range_max = 0xe4, + }, + .webcam = { + .address = 0x2e, + .block_address = 0x2f, + .bit = 1, + }, + .fn_win_swap = { + .address = 0xbf, + .bit = 4, + }, + .cooler_boost = { + .address = 0x98, + .bit = 7, + }, + .shift_mode = { + .address = 0xf2, + .modes = { + { SM_ECO_NAME, 0xc2 }, + { SM_COMFORT_NAME, 0xc1 }, + { SM_SPORT_NAME, 0xc0 }, + MSI_EC_MODE_NULL + }, + }, + .super_battery = { + .address = MSI_EC_ADDR_UNKNOWN, // 0xed + .mask = 0x0f, // a5, a4, a2 + }, + .fan_mode = { + .address = 0xf4, + .modes = { + { FM_AUTO_NAME, 0x0d }, + { FM_SILENT_NAME, 0x1d }, + { FM_ADVANCED_NAME, 0x8d }, + MSI_EC_MODE_NULL + }, + }, + .cpu = { + .rt_temp_address = 0x68, + .rt_fan_speed_address = 0x71, + .rt_fan_speed_base_min = 0x19, + .rt_fan_speed_base_max = 0x37, + .bs_fan_speed_address = MSI_EC_ADDR_UNSUPP, + .bs_fan_speed_base_min = 0x00, + .bs_fan_speed_base_max = 0x0f, + }, + .gpu = { + .rt_temp_address = MSI_EC_ADDR_UNKNOWN, + .rt_fan_speed_address = MSI_EC_ADDR_UNKNOWN, + }, + .leds = { + .micmute_led_address = 0x2b, + .mute_led_address = 0x2c, + .bit = 2, + }, + .kbd_bl = { + .bl_mode_address = MSI_EC_ADDR_UNKNOWN, + .bl_modes = { 0x00, 0x08 }, + .max_mode = 1, + .bl_state_address = 0xf3, + .state_base_value = 0x80, + .max_state = 3, + }, +}; + static struct msi_ec_conf *CONFIGURATIONS[] __initdata = { &CONF0, &CONF1, @@ -1333,6 +1412,7 @@ static struct msi_ec_conf *CONFIGURATIONS[] __initdata = { &CONF13, &CONF14, &CONF15, + &CONF16, NULL };