-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSI Modern 15 A5M support from 6.4 kernel #57
Comments
Same problem here, kernel 6.4. |
Thanks for the reply, I've tried since my last text both Fedora and NixOS in addition to my daily endeavourOS install, I can't even see anything in the designated folders after msi-ec install.... |
Same problem, still kernel 6.4. E155LAMS.114. |
DISCLAIMER: I'm not responsible for any broken hardware and other damage! Reading EC is safe Do you have Windows installed? You can use RWEverything to get EC values in real time. Also check config for C5M (14JKEMS1) model and use it as reference (at least its the same generation and family If you sure enough that configs are same, add your EC version to list |
Hi! The reason why not all laptops are supported yet is that they all have different EC configurations, not documented anywhere. In order to support a laptop we need some feedback from its users. Get the latest version of the driver from this repo, build it ( Run Like @glpnk said, if you have windows you can use RWEverything to see what EC addresses are modified when you toggle different settings in the MSI Centre It won't damage your hardware, it only reads from the EC. Just don't write random stuff into random addresses using |
I think the issue is that there is no msi-ec folder in the platform folder after using kernel 6.4 and up: I tested again with kernel 6.5 on Fedora 38 and it's the same thing. (Secure boot is disabled btw) |
I found issue #4, this laptop isn't supported yet. @catemiko attached a file with some tested addresses, I'm going to add them in my branch so you can test them An EC dump and EC FW version would still be appreciated (see my first comment) |
In my case my laptop is supported and the folder is still not created |
I created a PR adding support for |
Okay, let me check the comment you left in that discussion |
Ok, left a comment there. |
Just a little update here: the issue was that the kernel version of the driver doesn't create an msi-ec sysfs directory because it only supports charge thresholds yet, so it has nothing to put in that folder |
Tried
|
@catemiko |
Oh, I know why it didn't work. It loads the in-tree kernel module, you should load the github version by running |
Ok, now I have a possibility to run windows + RWeverything + MSI Center PRO, i've already pressed on EC button (in RWE...) and on every change in center app i pressed f2 to export config. What should i look at? With diffuse (flatpak app) i have at least 7 lines changed, so i don't know what i can check to be 100% sure. |
In RWE you need to Save (button 1) current dump and load (with load or Compare (2) button) it for comparison, than press Compare button (2) second time and changed values will be highlighted red:
If values are red but static you forgot to click Compare button second time UPD: add this guide to wiki |
What exactly I need to find? Battery and Shift? #66 isn't resolving PR #66 patchstatic const char *ALLOWED_FW_12[] __initconst = {
"155LEMS1.106", // MSI Modern 15 A5M
NULL
};
static struct msi_ec_conf CONF12 __initdata = {
.allowed_fw = ALLOWED_FW_12,
.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 = MSI_EC_ADDR_UNKNOWN,
.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, // may be supported
.mask = 0x0f,
},
.fan_mode = {
.address = 0xf4,
.modes = {
{ FM_AUTO_NAME, 0x0c },
{ FM_BASIC_NAME, 0x4c },
{ FM_ADVANCED_NAME, 0x8c },
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_UNKNOWN,
.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,
},
}; From your screenshot and patch:
|
Battery thresholds: right. You can see 0xEF changing "Shift Mode": got it right
"Super Battery":
Fan mode:
|
catemiko's fan modes end with the C digit, and ushinnary's end with a D. I think only the higher 4 bits matter |
Yeah I've tested, both working and not conflicting Super battery is weird with 3 possible values. From some MSI app research - you can programmatically disable battery charge. Also from my experiments - you also can trigger charge when power supply is unplugged |
@ushinnary does FN swap exists in MSI app? Also do you have ability to fine tune cooler speed in app? Led addresses right? Because from values it seems to be enabled (0x2B=8C bit 2 is set, do you have micmute led lit?) Also F3 address is keyboard light about which I forgot |
Yes, it does. Should i make a screenshot with it changing too? |
I have also a win key disable option |
catemiko's constants from #4#ifndef __MSI_EC_CONSTANTS__
#define __MSI_EC_CONSTANTS__
#define MSI_DRIVER_NAME "msi-ec"
+ #define MSI_EC_WEBCAM_ADDRESS 0x2e
- #define MSI_EC_WEBCAM_ON 0x4a
- #define MSI_EC_WEBCAM_OFF 0x48
(Not tested) #define MSI_EC_FN_WIN_ADDRESS 0xbf
(Not tested) #define MSI_EC_FN_KEY_LEFT 0x40
(Not tested) #define MSI_EC_FN_KEY_RIGHT 0x50
(Not tested) #define MSI_EC_WIN_KEY_LEFT 0x50
(Not tested) #define MSI_EC_WIN_KEY_RIGHT 0x40
+ #define MSI_EC_BATTERY_MODE_ADDRESS 0xef
+ #define MSI_EC_BATTERY_MODE_MAX_CHARGE 0xe4
+ #define MSI_EC_BATTERY_MODE_MEDIUM_CHARGE 0xd0
+ #define MSI_EC_BATTERY_MODE_MIN_CHARGE 0xbc
+ #define MSI_EC_COOLER_BOOST_ADDRESS 0x98
+ #define MSI_EC_COOLER_BOOST_ON 0x82
+ #define MSI_EC_COOLER_BOOST_OFF 0x02
(Not tested) #define MSI_EC_SHIFT_MODE_ADDRESS 0xf2
(Not tested, not present in MSI Center Pro) #define MSI_EC_SHIFT_MODE_TURBO 0xc4
+ (High Performance) #define MSI_EC_SHIFT_MODE_SPORT 0xc0
+ (Balanced) #define MSI_EC_SHIFT_MODE_COMFORT 0xc1
+ (Super Battery) #define MSI_EC_SHIFT_MODE_ECO 0xc2
(Not tested) #define MSI_EC_SHIFT_MODE_OFF 0x80
+ #define MSI_EC_FW_VERSION_ADDRESS 0xa0
+ #define MSI_EC_FW_VERSION_LENGTH 12
+ #define MSI_EC_FW_DATE_ADDRESS 0xac
+ #define MSI_EC_FW_DATE_LENGTH 8
+ #define MSI_EC_FW_TIME_ADDRESS 0xb4
+ #define MSI_EC_FW_TIME_LENGTH 8
(Has zeroes, not tested) #define MSI_EC_CHARGE_CONTROL_ADDRESS 0xef
(Has zeroes, not tested) #define MSI_EC_CHARGE_CONTROL_OFFSET_START 0x8a
(Has zeroes, not tested) #define MSI_EC_CHARGE_CONTROL_OFFSET_END 0x80
(Has zeroes, not tested) #define MSI_EC_CHARGE_CONTROL_RANGE_MIN 0x8a
(Has zeroes, not tested) #define MSI_EC_CHARGE_CONTROL_RANGE_MAX 0xe4
+ #define MSI_EC_CPU_REALTIME_TEMPERATURE_ADDRESS 0x68
+ (2 bytes?) #define MSI_EC_CPU_REALTIME_FAN_SPEED_ADDRESS 0x71
(Not tested) #define MSI_EC_CPU_REALTIME_FAN_SPEED_BASE_MIN 0x19
(Not tested) #define MSI_EC_CPU_REALTIME_FAN_SPEED_BASE_MAX 0x37
(Not tested) #define MSI_EC_CPU_BASIC_FAN_SPEED_ADDRESS 0x89
(Not tested) #define MSI_EC_CPU_BASIC_FAN_SPEED_BASE_MIN 0x00
(Not tested) #define MSI_EC_CPU_BASIC_FAN_SPEED_BASE_MAX 0x0f
(Not tested) #define MSI_EC_GPU_REALTIME_TEMPERATURE_ADDRESS 0x80
(Not tested) #define MSI_EC_GPU_REALTIME_FAN_SPEED_ADDRESS 0x89
+ #define MSI_EC_FAN_MODE_ADDRESS 0xf4
(Has address 0x0c) #define MSI_EC_FAN_MODE_AUTO 0x0d
(Has address 0x4c) #define MSI_EC_FAN_MODE_BASIC 0x4d
(Has address 0x8c) #define MSI_EC_FAN_MODE_ADVANCED 0x8d
+ #define MSI_EC_LED_MICMUTE_ADDRESS 0x2b
+ #define MSI_EC_LED_MUTE_ADDRESS 0x2c
+ #define MSI_EC_LED_STATE_MASK 0x4
+ #define MSI_EC_LED_STATE_OFF 0x80
+ #define MSI_EC_LED_STATE_ON 0x84
+ #define MSI_EC_KBD_BL_ADDRESS 0xf3
+ #define MSI_EC_KBD_BL_STATE_MASK 0x3
+ #define MSI_EC_KBD_BL_STATE_OFF 0x80
+ #define MSI_EC_KBD_BL_STATE_ON 0x81
+ #define MSI_EC_KBD_BL_STATE_HALF 0x82
+ #define MSI_EC_KBD_BL_STATE_FULL 0x83
static int MSI_EC_KBD_BL_STATE[4] = {
MSI_EC_KBD_BL_STATE_OFF,
MSI_EC_KBD_BL_STATE_ON,
MSI_EC_KBD_BL_STATE_HALF,
MSI_EC_KBD_BL_STATE_FULL};
+ #define MSI_EC_CAMERA_ADDRESS 0x2e
+ #define MSI_EC_CAMERA_HARD_ADDRESS 0x2f /* hotkey has no effect if this address disables the cam*/
+ #define MSI_EC_CAMERA_STATE_MASK 0x2
(Has value 0x09) #define MSI_EC_CAMERA_STATE_OFF 0x80
(Has value 0x0b) #define MSI_EC_CAMERA_STATE_ON 0x84
#endif // __MSI_EC_CONSTANTS__ Needs testing:
|
@glpnk means the LEDs on the mute and mic mute keyboard keys. You need to toggle them and see what happens in the EC ([0x2b] [0x2c] and [0x2d] addresses specifically) |
Leds require proper soundcard driver installation which successful not every time |
Oh i see, i have to press fn + F* to see the red light and make screenshots of rwe with changes, got it :) |
Hi everyone ! I've been away from my computer recently, and I've just noticed that some progress has been made on our device in order to get the I'm not sure how can I help from here, but i'm willing to help things going forward ! Feel free to guide me. |
ok, here the those screenshots that have changes, idk why rwe shows me same values on some lines but others on reboot... Later I will post others (want to be sure in them) |
So I was right with "0x2B=8C bit 2 is set, do you have micmute led lit?" Checklist:
UPD: ESC (FN lock) is unnecessary
Yeah it's known |
[0x98] is highlighted red but has the same value as before, does it actually change when you switch cooler boost? Also you left out the last row where the fan mode parameter is located |
9F you mean? can't see 98 red value for fan high perf cooler boost |
I'd like to know what's the status of the msi-ec driver compatibility project on our Modern 15 A5M laptop? |
@benitozh |
Hope everything is correct |
Just updated my screenshots, didn't notice that previous was quite the same. Should be good now |
#66 has been merged! |
Thanks for your work and dedication @teackot ! EDIT : It might be useful to mention A5M variant in the tested laptops list. Anyway, that's not urgent. |
Closing for now since no more info is needed yet |
Greetings everyone,
I've been using my own laptop daily for personal use, an MSI Modern 15 A5M, since last year, with YoyPa's ISW-Modern installed in order to have basic automated fan control on my laptop. I'm running on Endeavour OS.
Recently, I tried to install the AUR package msi-ec-git, in order to benefit from a more advanced version of the ISW-Modern package, which is rather limited in terms of functionality. Unfortunately, this never worked on my laptop, so I decided to wait for msi-ec to be merged with the linux 6.4 kernel.
Now that version 6.4 of the linux kernel has been released, I tried to see if it now worked on my laptop. Unfortunately, when I go to /sys/devices/platform/, there is no "msi-ec" folder. I tried to install the package from the tutorial explained on the main page of the project, but still no correspondant folder seems to exists (even in hidden folders).
I'm wondering if anyone involved in this project could gently help me in order to get this module working on my laptop. Right now, ISW-Modern doens't seems to function at all with kernel 6.4.
Any tips would be greatly appreciated, i'm still new to Linux even though i've been making a distro tour since two years now that made me learn a few things
The text was updated successfully, but these errors were encountered: