IBM Thinkpad G40 & Debian Linux

The 'G' range is a strange annex of the thinkpad line, and doesn't
have most of the normal features (e.g. Ultrabays, Thinklights), nor
does it use the standard thinkpad power supply. It is also huge since
it has a desktop P4 and a lot of copper. Despite this it's a
reasonably quiet laptop which can last a few hours away from power.

Update to the latest BIOS, of course. Then press some buttons. I
dunno.

Like other IBM's, there's the recovery area to disable ( IMO it's not
that useful, if you don't trust yourself enough that you get the BIOS
to hide a backup windows installation then you probably shouldn't be
using Linux).

Warning: It seems the VGA connector on the laptop is prone to
breaking off, this inhibits use of dualheading somewhat. Whilst nosing
on ebay for spares, it seems I'm not the only one to suffer this. It
doesn't appear to be easily repairable, either.

Xorg

Current versions of the "intel" driver (2:2.3.2-2+lenny6) work pretty
much flawlessly, can rotate screens, shut the lid (which hasn't been
possible for some time). Config looks like:

ACPI works fairly well out of the tin. Make sure you have compiled
"IBM ThinkPad Laptop Extras" and add the following to
/etc/modprobe.d/g40hardware:

options thinkpad-acpi experimental=1

The laptop exposes:-

AC Adapter / Battery information

Lid & power buttons

1 Thermal Zone

Processor throttling & C states 1+2

Video control (although I haven't used it)

The thinkpad-acpi driver gives you:-

brightness controlIBM Hotkey support (that can be modded to include Access IBM keys)

A lot of thinkpad-acpi won't do much, e.g. the volume control will
flip bits, but this has no affect on the sound (presumably they didn't
bother wiring the sound chip into whatever the volume controls set),
the video options also don't do anything. Maybe I play with these at
some point.

Sleep States

This tells ACPI to run the video BIOS after a resume. It will work
fine without, but you need to switch VT's and back again before you
can see your mouse cursor.

DSDT Hacks: Extra keys

The DSDT I have modified to include ACPI hotkey support for more keys.
This is a similar process for any thinkpad.

Install the iasl compiler, copy /proc/acpi/dsdt and decompile it.

Look at the source code. Search for "_Q"

You should see a whole load of Method (_Q03, 0, NotSerialized).
Each one of these is triggered when the Embedded controller receives
an event. Through trial and error, I found these events were triggered
by some keys:

Adding a call to MHKQ in each of these blocks means that
thinkpad_acpi will get told about them. My patch is here.

Recompile the DSDT using iasl -tc into a hex file, and configure the
kernel to compile this into it's source code. You could also use the
initrd patch, but the new initramfs stuff is a bit cumbersome if
that's the only thing you use it for.

CPUFreq

Even if it's predominantly a desktop, this is a good-thing™ to keep
heat (and therefore noise) down. I wanted to just use one of the
kernel governors and not play around that much. Compile in support for
"Intel Pentium 4 clock modulation", and whatever governors you want.
Although you can't select ondemand or conservative for the default
govenor, you can install sysfs-tools and add to /etc/sysfs.conf: