Skip to content

agnath18K/acpi_ec

Repository files navigation

ACPI EC Driver with Multi-EC Support

A Linux kernel module providing direct access to ACPI Embedded Controller (EC), useful for MSI laptops where the in-kernel msi_ec driver doesn't support certain firmware versions.

Features

  • Direct ACPI EC register access via /dev/ec0
  • Multi-EC device support
  • Fan curve control for MSI laptops
  • Cooler Boost control
  • User-space interface via device files

Prerequisites

sudo apt install build-essential linux-headers-$(uname -r)

Installation

git clone https://github.com/agnath18K/acpi_ec.git
cd acpi_ec
sudo ./install.sh

Note: Secure Boot must be disabled as the module is unsigned.

Usage

Device Files

After installation:

  • /dev/ec0 - Primary EC
  • /dev/ec1, /dev/ec2 - Secondary ECs (if present)

Fan Curve Control (msi_fan_curve.sh)

Control fan curves on supported MSI laptops:

# Show current status
sudo ./msi_fan_curve.sh status

# Show current fan curve
sudo ./msi_fan_curve.sh curve

# Apply a profile
sudo ./msi_fan_curve.sh apply performance  # or: silent, balanced, gaming

# Backup/restore curves
sudo ./msi_fan_curve.sh backup ~/my_curve.bak
sudo ./msi_fan_curve.sh restore ~/my_curve.bak

# Live monitoring
sudo ./msi_fan_curve.sh monitor

Available profiles:

Profile Description
silent Lower fan speeds, prioritize quiet operation
balanced Mix of cooling and noise
performance Aggressive cooling, fans reach 100%
gaming Maximum cooling, fans spin up early

Basic Fan Control (msi_fan_control.sh)

Simple monitoring and Cooler Boost control:

sudo ./msi_fan_control.sh status     # Show temps and fan speeds
sudo ./msi_fan_control.sh monitor    # Live monitoring
sudo ./msi_fan_control.sh boost-on   # Enable Cooler Boost
sudo ./msi_fan_control.sh boost-off  # Disable Cooler Boost

Cooler Boost (cooler_boost.sh)

Legacy script for Cooler Boost only:

sudo ./cooler_boost.sh status
sudo ./cooler_boost.sh on
sudo ./cooler_boost.sh off

Raw EC Access

# Read from offset 0x68 (CPU temp)
sudo dd if=/dev/ec0 bs=1 count=1 skip=104 2>/dev/null | od -An -tu1

# Write 0x80 to offset 0x98 (Cooler Boost ON)
echo -ne "\x80" | sudo dd of=/dev/ec0 bs=1 count=1 seek=152 2>/dev/null

Auto-start on Boot

Copy the systemd service files:

sudo cp systemd/acpi-ec.service /etc/systemd/system/
sudo cp systemd/msi-fan-curve.service /etc/systemd/system/

# Edit msi-fan-curve.service to point to your script location
sudo systemctl daemon-reload
sudo systemctl enable acpi-ec.service
sudo systemctl enable msi-fan-curve.service

EC Register Map (GL65 Leopard - 16U8EMS2.100)

Offset Hex Description
104 0x68 CPU Temperature
112 0x70 CPU Fan %
128 0x80 GPU Temperature
136 0x88 GPU Fan %
152 0x98 Cooler Boost (0x00=OFF, 0x80=ON)
244 0xF4 Fan Mode (140=Advanced)
106-111 0x6A-0x6F CPU Temp Thresholds
114-120 0x72-0x78 CPU Fan Speeds
130-135 0x82-0x87 GPU Temp Thresholds
138-144 0x8A-0x90 GPU Fan Speeds

Note: Register addresses may vary by firmware version. The above are verified for firmware 16U8EMS2.100.

Uninstallation

sudo ./uninstall.sh

Troubleshooting

# Check if module is loaded
lsmod | grep acpi_ec

# Check kernel logs
dmesg | grep acpi_ec

# Check device permissions
ls -l /dev/ec*

License

GPL v2 - see LICENSE file.

Credits

  • Thomas Renninger (ec_sys.c)
  • Sayafdine Said (Out-of-tree port)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors