ACPI on an IBM ThinkPad R40 under Ubuntu Breezy.

The last thing on my list to check on my recently Ubuntu-ised laptop was ACPI support, specifically the Fn+FX keys. Under Debian I had spent some time playing with the ACPI functions on my IBM ThinkPad R40, working out the signals each key sent and tying them in with shell scripts to do things. I had Suspend-to-disk and Suspend-to-RAM working absolutely fine. I even found that two unmarked keys, Fn+F8 and Fn+F9, had ACPI events associated with them. This means that I could trigger any command I wanted from these keys.

I had kept the /etc/acpi directory from my Etch install for comparison. Triggers for ACPI keys are kept in /etc/acpi/events and Ubuntu Breezy has a stock of triggers for Asus, IBM, Panasonic, Sony and Toshiba laptops, as well as generic AC, battery, power button and lid button events. But it’s the IBM-specifc triggers that I’m interested in. The following details the default settings.

Fn+F3 is the lock screen combination. I never bothered with this under Etch, but it works out of the box with Breezy. Fn+F4 is the Suspend-to-RAM button. This didn’t do anything by default on Breezy. Fn+F5 is a “wireless” control combination. According to the IBM ACPI tools it only controls bluetooth, not 802.11 cards. As I don’t have bluetooth, this represents a rather pointless button for me. Under Etch I had mapped the key combination to a script that probed /sys/bus/pci/drivers/ipw2100 and used that to enable or disable the wireless card. The Ubuntu guys have done something similar and have a script that works through /sys/class/net/ which works just as well and is more transportable across different wireless network devices. Good stuff.

Fn+F7 is the video mode toggle button, which under Windows usually switches mode between TFT panel, external CRT/projector or both. Under Linux this doesn’t seem to do anything, in fact the supplied Ubuntu trigger is marked as a place holder only. You can echo stuff to /proc/acpi/ibm/video but it doesn’t actually make any difference. Fn+F12 is the Suspend-to-disk button. Under Ubuntu the suspend aspect worked fine, it just crashed on resume. It gets part way through the boot process after suspending and reboots. The reboot takes it back to a clean login. echo -n disk > /sys/power/state worked only intermittently. Even disabling the splash screen on boot didn’t help, a tip gained elsewhere on the net. So I’m going to leave Suspend-to-disk alone until Dapper is released when I’ll try it again.

In order to get Suspend-to-RAM working, I poked around in the various scripts that are called. Some settings for ACPI behaviour are held in /etc/default/acpi-support. Uncommenting the ACPI_SLEEP=true line activated the Suspend-to-RAM feature, which then worked from the key combination.

I also copied the triggers for the Fn+F8 and Fn+F9 keys into the /etc/apci/events directory so I can latter map them to scripts if I want. The event triggers for anyone interested are:

event=ibm/hotkey HKEY 00000080 00001008
event=ibm/hotkey HKEY 00000080 00001009
Be Sociable, Share!
    Pin It

    Comments are closed.