This driver might not work on other laptops produced by MSI. Use it at your own risk, we are not responsible for any damage suffered.
Also, and until future enhancements, no DMI data is used to identify your laptop model. In the meantime, check the msi-ec.c file before using.
Check if your device is supported before attempting to install and use the driver. The list of supported devices can be found here.
Can't find your device in the list? Check the contribution guides and open a new issue.
Eager to support the project? Your help is always welcome to keep the project alive and going!
sudo apt install build-essential linux-headers-amd64
sudo apt install build-essential linux-headers-generic
sudo dnf install kernel-devel
sudo pacman -S --needed base-devel linux-headers
git clone https://github.com/BeardOverflow/msi-ec && cd msi-ec
which dkms
sudo make dkms-install
sudo make dkms-uninstall
make
sudo make install
sudo make uninstall
yay -S msi-ec-git
The driver is packaged on nixos-unstable
under the name
linuxKernel.packages.<kernel>.msi-ec
.
# In your config
{
# ...
boot.kernelPackages = pkgs.linuxPackages_latest // {
# Replace linux_6_6 by your actual kernel
msi-ec = linuxKernel.packages.linux_6_6.msi-ec;
};
boot.kernelModules = [
# ...
"msi-ec"
# ...
];
}
Features already merged in kernel 6.4 and up:
Still not merged:
This driver exports a few files in its own platform device, msi-ec, and is available to userspace under:
/sys/devices/platform/msi-ec/webcam
/sys/devices/platform/msi-ec/webcam_block
/sys/devices/platform/msi-ec/fn_key
/sys/devices/platform/msi-ec/win_key
/sys/devices/platform/msi-ec/battery_mode
/sys/devices/platform/msi-ec/cooler_boost
/sys/devices/platform/msi-ec/available_shift_modes
/sys/devices/platform/msi-ec/shift_mode
/sys/devices/platform/msi-ec/available_shift_modes
. Some of the possible values:
/sys/devices/platform/msi-ec/super_battery
/sys/devices/platform/msi-ec/available_fan_modes
/sys/devices/platform/msi-ec/fan_mode
/sys/devices/platform/msi-ec/available_fan_modes
. Some of the possible values:
/sys/devices/platform/msi-ec/fw_version
/sys/devices/platform/msi-ec/fw_release_date
/sys/devices/platform/msi-ec/cpu/realtime_temperature
/sys/devices/platform/msi-ec/cpu/realtime_fan_speed
/sys/devices/platform/msi-ec/cpu/basic_fan_speed
/sys/devices/platform/msi-ec/gpu/realtime_temperature
/sys/devices/platform/msi-ec/gpu/realtime_fan_speed
In addition to these platform device attributes the driver registers itself in the Linux power_supply subsystem (Documentation/ABI/testing/sysfs-class-power) and is available to userspace under:
/sys/class/power_supply/<supply_name>/charge_control_start_threshold
/sys/class/power_supply/<supply_name>/charge_control_end_threshold
Led subsystem allows us to control the leds on the laptop including the keyboard backlight
/sys/class/leds/platform::<led_name>/brightness
/sys/class/leds/msiacpi::kbd_backlight/brightness
You can use module parameters to get direct read-write access to the EC or force-load a configuration for a specific firmware.
Be very careful, since writing into the unknown addresses of the EC memory may be dangerous! If you did something wrong, please, reset the EC using the reset button on the bottom of your laptop.
debug
, boolSet this parameter to true
to enable debug attributes, located at /sys/devices/platform/msi-ec/debug/
,
even if your EC is not supported yet.
Normal attributes will still be accessible if your firmware is supported.
You can use make load-debug
command to load the module in the debug mode after building it from source.
name | permissions | description |
---|---|---|
fw_version | RO | returns your EC firmware version |
ec_dump | RO | returns an EC memory dump in the form of a table |
ec_get | RW | receives an EC memory address in the hexadecimal format on write; returns a value stored in the EC memory at this address on read |
ec_set | WO | receives an address-value pair in the following format: aa=vv , where aa and vv are address and value in the hexadecimal format; then writes the value into the EC memory |
firmware
, stringSet this parameter to a supported EC firmware version to use its configuration and test if it is compatible with your EC. Please verify that the attributes return the correct data before attempting to write into them!