レナート   PID EINS!   ﻟﻴﻨﺎﺭﺕ

Thu, 10 Aug 2006

MSI S270 Laptop Linux Kernel Driver

Earlier this year I worked on reverse engineering the brightness control of my MSI S270 laptop. Turning this work into a proper kernel driver was still left to be done. Until yesterday... The result of yesterday's work are two kernel patches I already posted for upstream inclusion.

If you want to test these drivers, download the latest kernel patches:

  1. acpi-ec-transaction.patch
  2. acpi-s270.patch

The two patches apply to kernel 2.6.17. After patching activate "MSI S270 Laptop Extras" under "Device Drivers"/"Misc devices" and recompile and install. After loading the s270 module, you now have a backlight class driver exposing its innards in /sys/class/backlight/s270bl/. For changing the screen brightness issue as root:

echo 8 > /sys/class/backlight/s270bl/brightness

This will set the screen brightness to maximum. The integer range is 0..8.

In addition to this backlight class driver we export a platform driver which allows reading the current state of the WLAN/Bluetooth subsystem. The platform drivers also allows toggling the automatic brightness control feature:

cat /sys/devices/platform/s270pf/wlan                 # Show WLAN status
cat /sys/devices/platform/s270pf/bluetooth            # Show Bluetooth status
echo 1 > /sys/devices/platform/s270pf/auto_brightness # Enable automatic brightness control

If the driver refuses to load (returning ENODEV) and you are sure you have an MSI S270 the machine is probably not recognized correctly by its DMI data. In that case you can pass force=1 to the driver which will force the driver load even when the DMI data doesn't match. YMMV. If everything works correctly please make sure to send me the output of dmidecode, so that I can add the DMI data to the list of known laptops in the driver.

There might even be a chance that this driver works on other MSI laptop models, too (such as S260). YMMV. But don't come running when the driver causes your machine to explode! MSI laptops such as the S270 or S260 are often sold as OEM hardware under different brands (such as Cytron/TCM/Medion/Tchibo MD96100 or "SAM2000"), so if your laptop looks remotely like this one and dmidecode | grep MICRO-STAR yields at least a single line, and you are adventurous than you might want to test this driver on it. And don't forget to send me your dmidecode output if it works for you!

Unfortunately HAL (at least in my version 0.5.7) doesn't support the generic backlight device class yet, which means no gnome-power-manager support for now.

Although this driver is based on reverse engineered data it should be legally safe even in the US. After I did my initial work on the S270 controls MSI supplied me with a register table of their ACPI Embedded Controller (which is what this driver interfaces with) and one of their engineers even tested my work.

Last but not least I created a mailing list for discussion of Linux on the MSI S270. Please join if you run Linux on one of these machines! I will announce future driver work for the S270 there.

posted at: 19:34 | path: /projects | permanent link to this entry | comments


It should be obvious but in case it isn't: the opinions reflected here are my own. They are not the views of my employer, or Ronald McDonald, or anyone else.

Please note that I take the liberty to delete any comments posted here that I deem inappropriate, off-topic, or insulting. And I excercise this liberty quite agressively. So yes, if you comment here, I might censor you. If you don't want to be censored you are welcome to comment on your own blog instead.


Lennart Poettering <mzoybt (at) 0pointer (dot) net>
Syndicated on Planet GNOME, Planet Fedora, planet.freedesktop.org, Planet Debian Upstream. feed RSS 0.91, RSS 2.0
Archives: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013

Valid XHTML 1.0 Strict!   Valid CSS!