Lenovo ThinkPad T420

This article is dedicated to getting hardware specific to the Lenovo ThinkPad T420 working smoothly on Gentoo Linux.

The Thinkpad T420 comes in many varieties, this guide focuses on the newer Core i7 and i5 variants. It should also provide some guidelines for the T420s.

Installation Prep
Further optimizations can be found in the Safe Cflags page.

Getting graphics to work
The T420 comes with switchable graphics with a discrete Nvidia (Optimus) GFX card and an integrated Intel HD 3000 controller. You can select in BIOS how the graphics behave, default is to use both and switch "automatically" between cards when needed. Using the switchable mode might or might not work, see X.Org/nVidia Optimus and read about the Bumblebee Project.

This guide focuses on using Intel graphics only.

Integrated and intel
See the Intel Graphics article for more details.

Suspending to RAM and disk
Suspending to both RAM and disk seems to work with no issues with a recent kernel (Gentoo sources 3.4.4 tested) and.

Processor
The following kernel config options suit the Core i7 processor.

Wireless
The driver is provided by intel and is included in the kernel. You need to unmask the wireless card firmware and configure the correct options in the kernel.

Kernel configuration:

Then follow the Gentoo wireless guide. You may find additional info on the specific iwlwifi topic.

WWAN (USB modem)
The WWAN modem connects internally with USB:

In kernel, you will need PPP and USB modem support:

If configured properly, the modem should appear as /dev/ttyACM0.

works well for controlling the modem.

Bluetooth
Note that bluetooth is connected via USB internally, so USB must be enabled as well.

Integrated camera
The integrated camera works with the uvcvideo driver. Enable the following options in your kernel:

Touchpad
The synaptics touchpad should work without any issues. Make sure you have synaptics activated in kernel config:

The touchpad should work without any particular X configuration, but two finger scroll and tap-to-click seem to be deactivated by default. You can use the following /etc/X11/xorg.conf.d/50-twofingerscroll.conf configuration to enable them:

Laptop extras
There's a driver in the kernel for ThinkPad specific stuff, mainly for handling the ThinkPad specific button events. You'll probably want to read /usr/src/linux/Documentation/laptops/thinkpad-acpi.txt for complete information about this driver.

Compile the ACPI extras as a module if you want to have fan control. If not, you can compile it in.

Backlight control in console mode works only if you have only ACPI video for backlight control, avoid setting any other backlight control feature in the kernel.

Using hal, all these laptop buttons should be working fine. Note that for some DEs (such as Xfce) you might have to add your own mappings for most of the keys (such as volume or touchpad toggle).

See Lenovo Thinkpad T400 for information about the ThinkVantage button.

Sound
Sound works without issues. Also no problems with the power-saving feature so far.

CardBus/ExpressCard
The ThinkPad W500 has a yenta compatible CardBus bridge in it.

MMC/SD/MS/xD card reader
The SD card reader works without issues.

Fingerprint reader
The fingerprint reader can be found on the USB bus using lsusb:

The fingerprint reader should work out of the box, but you need a frontend program for authentication. is probably the easiest way for managing fingerprints and using a fingerprint to log on in both console as well as in X. Make sure you emerge with upekbsapi USE flag enabled (should be on by default if you're on desktop profile).

After emerging add to your pam.d/sys-auth:

And run fingerprint-gui in X to register fingerprints. After this, you should be prompted for a fingerprint wherever your password is required.

Fan control
The fan seems to be running at a near-constant speed (~3500 rpm), regardless of the temperature. works great for controlling the fan speed automatically depending on the temperature.

To let thinkfan control your fan, you need to compile ThinkPad ACPI Laptop Extras as a module and configure it:

This is an example file with two sensor inputs (ambient and CPU) which controls the fan in 7 steps (from switched off to ~1800-5000rpm). It may not suit your needs and be sure to check that the sensor inputs are correct!

You can run thinkfan from console to test it

When done, add thinkfan to default runlevel

Links

 * Intel GMA drivers
 * Intel WiFi Link drivers
 * Synaptics touchpad
 * Thinkwiki - Installing Gentoo on a ThinkPad T420
 * Gentoo Power Management Guide
 * Lenovo Thinkpad T400