Kernel Driver

Lennart Poettering reverse engineered driver support for a few "special features" of MSI laptops and wrote a Linux driver for it:

  • LCD brightness control
  • Status of the WLAN and Bluetooth subsystem

The driver has been merged into Linus' tree and is available in Linux 2.6.19.

This driver currently supports only the S270 model. Porting this driver to other MSI models is welcome!

The driver was also tested on an S420 and was found to work on it as well, though for now it requires the force=1 flag since the driver doesn't know about the S420 compatibility.

Userspace Utility

s270ctrl is a userspace implementation of the driver mentioned above. We do not recommend to use this driver for anything but testing because due to its userspace nature is unable to make sure that hardware accesses are not interrupted by or do not interrupt hardware accesses by the Linux kernel. Especially if you have applications running that repeatedly poll the ACPI Embedded Controller (EC), such as temperature or battery state monitors, usage of s270ctrl is not safe. YMMV.

Hardware documentation

This is all documentation provided by MSI right now, valid for MSI S270:

Speed issues

From kernel 2.6.20 changing brightness is quite slow.

# time cat /sys/devices/platform/msi-laptop-pf/lcd_level
8

real    0m1.005s
user    0m0.000s
sys     0m0.004s

# time echo 7 > /sys/devices/platform/msi-laptop-pf/lcd_level

real    0m1.499s
user    0m0.000s
sys     0m0.000s 

This behaviour is explained on the mailing list by the excellent Lennart Poettering:

It's like this: communication with the ACPI embedded controller can be
done either interrupt-based or polling-based. The embedded controller
is responsible for all that small housekeeping stuff that needs to be
done on a laptop: battery management, fan management, brightness
management, power plug management and other stuff. Since 2.6.18 the
interrupt-based mode is the default (same as passing
ec_intr=1). Before that the polling mode was used by
default. Interrupt-based mode is cleaner in some way. However, for
those special commands the MSI EC knows that we use for brightness
control it doesn't trigger interrupts. Thus, when issueing those
commands we have to temporarily switch to polling mode and than back
to interrupt mode. 

If you are running kernel 2.6.20 or 2.6.21, this is resolved by passing ec_intr=0 kernel parameter. This bug is reportedly fixed in kernel 2.6.22. See relevant git commit.