Lenovo Thinkpad T61

= Hardware status =

= Introduction =

Packages that will need unmasking by keyword
# # media-video/nvidia-settings ~amd64 net-wireless/wireless-tools ~amd64 sys-apps/tuxonice-userui ~amd64 sys-apps/vbetool ~amd64 sys-kernel/  gentoo  -sources ~amd64 sys-kernel/git-sources ~amd64 sys-kernel/zen-sources ~amd64 sys-kernel/tuxonice-sources ~amd64 x11-drivers/nvidia-drivers ~amd64 x11-drivers/xf86-video-nv ~amd64 =media-libs/mesa-6.5.3* ~x86 x11-drivers/xf86-video-i810 ~x86
 * 1) set your ~arch as needed!
 * 1) package.keywords:
 * 1) Intel graphics

= Hardware =

Hardware specs may vary. These are the specs for model 7663-W5T (german keyboard layout):

Processor 		Intel Core 2 Duo Processor T7500 with 2,20 GHz, 4 MB L2 Cache Front Side Bus 	800 MHz RAM	 		1 GB 667 MHz DDR2 Harddisk 		5400 U/min; 120 GB Harddisk SATA with Active Protection System Optical 		DVD Multiburner Dual Layer (DVD +/-) in UltraBay Slim Display 		TFT Display; 14,1 Zoll (35,8 cm); 1440x900 GFX	 		128 MB DDR RAM; nVIDIA Quadro NVS 140M Communication 		10/100/1000 LAN, Intel Mini PCI PRO/Wireless 3945ABG Lan, 56K Int. Modem, Bluetooth Sound System 		Intel High Definition Audio Input Devices 		IBM UltraNav (Touchpad+TrackPoint) Connectors 		3x USB 2.0-Ports, VGA, Headphone, ext. microphone, RJ-11, RJ-45, Firewire (IEEE 1394) PC Card Extensions 	1 x PCMCIA Typ I oder II und 1 x SMARTCARD Dimensions (WxDxH) 	335,5 x 237 x 27,6 mm

= Configuration detail =

1440x900 Resolution
This calculation is not always accurate. It is a good starting point and you may have to do some experimenting to find the correct value.

Using the vesafb driver, the following kernel parameter is required:


 * Intel/Nvidia cards: vga=869 (run "dmesg | grep fb" you can see the mode is 1440x900x32, if vga=868 the mode will be 1440x900x8 and mplayer with "fbcon" USE flag is useless)

Starting with gentoo-sources-2.6.23 (And will probably be mainline in 2.6.24) you might want to choose uvesafb. The required kernel parameter is: video=uvesafb:1440x900-32,mtrr:3,ywrap. See Links section for references.

eyecandy
[/Fbsplash Fbsplash] and [/Qingy Qingy] will work flawlessly, however do not forget to edit /etc/directfbrc  for qingy to work:

Power Management
We recommend using the commands hibernate  and hibernate-ram   from sys-power/hibernate-script. Edit the files in /etc/hibernate  to your needs.

Suspend to disk
The following was tested on  amd64 . Working suspend to disk with x11-drivers/nvidia-drivers using sys-power/hibernate-script hibernate  command. remove nvidia from /etc/hibernate/blacklisted-modules. Driver / software versions : tuxonice-sources-2.6.23-r5, nvidia-drivers-169.07 (using custom overlay) and sys-power/hibernate-script-1.97-r4. See [/Lenovo_Thinkpad_T61/config_nalldrin nalldrin's config files] (or [/Lenovo_Thinkpad_T61/config_tante tante's kernel config] if you want to use dm-crypt for drive encryption) for full files relevant info.

Suspend to RAM
nvs 140@X11: resumes (requires more testing). Using vbetool is not required. Unloading the following modules gives less dmesg-errors (sorry, not sure which on is the culprit): thinkpad_acpi snd_hda_intel parport_pc sr_mod sg button tun e1000. vga=0 and vga=869 both work. nvs 140@Console: Suspending to ram from console has been tested to work with uvesafb framebuffer on a Thinkpad with nvidia card. This was possible with x11-drivers/nvidia-drivers-173.14.05. Also have a look at [/Talk:Lenovo_Thinkpad_T61#tuxonice tuxonice section@discussions page] Intel graphics may need to save and restore the vbemode with vbetool.

dynticks
Dynticks can only be used with x86 architecture at the moment - amd64 might get supported in the future but still has some issues.

A non-dynticks kernel had 1500 wakups minimum, a kernel with dynticks comes down to 20-40. Have in mind that there are some real "interrupter" both in user-software and drivers. Java and the nvidia closed-source drivers are two candidates. If in textmode only ehci_work is top with 10 wakeups per sec.

NOTE: Dynticks works perfectly with AMD64 arch, not sure what the optimum Timer HZ is at the moment though (could someone fill us in?) With dynticsk enabled I was able to get down to ~100 intterupts/second with 1000HZ timer.

video drivers

 * x11-drivers/nvidia-drivers : No problems with glx and multihead.


 * Eye-candy (compiz-fusion) lags hard because of nvidia's powermizer (it seems that it can be disabled, have a look at this)


 * Brightness control is possible as of version 169.07.
 * One has to do eselect opengl set nvidia first to ensure that the correct GLX module is loaded.
 * x11-drivers/ati-drivers : AMD/ATI released linux driver. No problems with glx, or desktop effects. No problems resuming from sleep/hibernation. Runs in 1400x1050 on Thinkpad T60. See http://en.gentoo-wiki.com/wiki/Fglrx for installation.
 * x11-drivers/xf86-video-nv :  amd64  does not work due to unknown card.  ~amd64  works (make sure proprietary nvidia module is not loaded).
 * x11-drivers/xf86-video-vesa : No problems resuming from sleep/hibernation. Does not run in 1440x900.
 * x11-drivers/xf86-video-i810: See this Intel GMA guide.

Multimedia keys
Working keys : volume (up/down), back, forward, audio-play, audio-stop, audio-next, audio-noprevious.

See Assigning keys to special functions to make these keys available in your favourite WM or DE.

Dockingstation
Using the Thinkpad Advanced Mini Dock seems to work without problems so far. A short overview:

Howto ...
Some of these links lead to old parts of this article that had to be moved due to oversizing:


 * [/Wireless#Useful_scripts ... auto toggle wired/wireless on cable connect]
 * [/VPN#Scripts ... start vpnc on a certain ESSID]
 * [/Laptop_Specific_Utilities#Toggle_synaptics_touchpad ... toggle synaptics touchpad]
 * [/IBM_Specific_Laptop_Guide#TrackPoint ... customize Trackpoint (scrolling)]
 * [/Twinview_Example ... setup TwinView and Xinerama]
 * [/IBM_Specific_Laptop_Guide#Multimedia_keys ... Thinkpad Fn-Keys]

= thinkpad_acpi =

This is the new name for the formerly called ibm_acpi kernel modules. It can now be found at Device Drivers ---> Misc Devices ---> ThinkPad ACPI Laptop Extras

Volume control
Mute does silence the sound but pressing Mute a second time does not unmute. Vol-up or vol-down have to be pressed to unmute. Volume up/down buttons generate keyevents so volume can be controlled via a seperate program by using ~/.Xmodmap  and  ~/.xbindkeysrc  (see [/Lenovo_Thinkpad_T61#Multimedia_keys Multimedia keys]). Interfacing /proc/acpi/ibm/volume  via echo up > /proc/acpi/ibm/volume  has no effect; you must use echo up >> /proc/acpi/ibm/volume</tt> 

<font size="-1">Tip: Audio is muted by default after startup and there is no way to unmute via alsamixer / any other app. To unmute volume_up or volume_down has to be pressed. To unmute on system startup put the following in /etc/conf.d/local.start: echo up > /proc/acpi/ibm/volume

KDE's default configuration does not recognize the volume buttons correctly, as it tries to adjust the â€œmasterâ€� output. Instead, you have to right-click on the PCM output in the main window of kmix and set up the volume keys as shortcut keys controlling the volume of the PCM output.

Brightness control
Seems hard wired. Reports status at /proc/acpi/ibm/brightness:level. Does not work under Xorg with x11-drivers/nvidia-drivers <169.07. The latest version works okay. Had success with x11-drivers/xf86-video-vesa and x11-drivers/xf86-video-vesa. No Problems with x11-drivers/xf86-video-i810 and intel graphics. Using kernel 2.6.26 and nvidia-drivers you must enable CONFIG_ACPI_VIDEO (which requires CONFIG_VIDEO_OUTPUT_CONTROL) for brightness to work. The correct events are not emitted if these are not enabled in the kernel.

Fan control
To control the cpu fan, you should compile the thinkpad_acpi of your kernel as a module and load it with fan_control=1


 * 1) modprobe thinkpad_acpi fan_control=1

Then install the package lm_sensors:


 * 1) emerge -av lm_sensors

Then you can run the script pwmconfig


 * 1) pwmconfig

which will generate a config file /etc/fancontrol interactively. Here is the fancontrol config file of my  T61 -8889-IHC:

INTERVAL=120 FCTEMPS=hwmon2/device/pwm1=hwmon2/device/temp1_input FCFANS=hwmon2/device/pwm1=hwmon2/device/fan1_input MINTEMP=hwmon2/device/pwm1=50 MAXTEMP=hwmon2/device/pwm1=70 MINSTART=hwmon2/device/pwm1=128 MINSTOP=hwmon2/device/pwm1=128 MINPWM=hwmon2/device/pwm1=0 MAXPWM=hwmon2/device/pwm1=255

Refer to the manpage of fancontrol for the detailed descriptions of these parameters. Finally, activate the fancontrol daemon:


 * 1) /etc/init.d/fancontrol start

Now your CPU fan will stop boring you if the temperature of your CPU is below 50Â°C.

hotkeys (Fn-Fx combinations)
Without thinkpad-acpi only Fn-F4 will generate button/sleep event. All other Fn-Fx combinations are inactive. Use thinkpad-acpi to [IBM_Specific_Laptop_Guide#Multimedia_keys enable the rest of the Fn-Fx key combinations].

Brightness controls (Alt F10,F11) are hard wired, but only have effect while in text-mode, or using xorg-vesa- or xorg-nv-driver. x11-drivers/nvidia-drivers-169.07 supports xorg brightness control, too. Sleep (F4) button registers in acpi. Mute is hardwired as well but no effect despite change in /proc/acpi/ibm/volume:mute  so far recognized.

Usage of acpid
There are a lot of solutions for acpid and thinkpad_acpi hotkey feature on the web mainly using files in /etc/acpi/events/  and  /etc/acpi/actions/. For example you can download the old source package from ibm-acpis sourceforge download page containing such example files (do not choose the patches, you need one of the old *.tar.gz  . Another way is to tweak  /etc/acpi/default.sh  a bit:

Fn-F7 Video output toggle
/proc/acpi/ibm/video reports <font color="#000000">status: supported</tt> but any changes have no effect.

Fn-F7 with Nvidia drivers
With x11-drivers/nvidia-drivers-173.14.09, the driver reports that it supports Fn-F7 toggle.

(II) Open ACPI successful (/var/run/acpid.socket) (II) NVIDIA(0): Setting mode "1680x1050" (II) NVIDIA(0): ACPI display change hotkey events enabled: the X server is new (II) NVIDIA(0):    enough to receive ACPI display change hotkey events.

It turns out that the nvidia driver looks for the following ACPI event in order to dynamically enable/toggle display:

video VID1 00000080 00000000

However, if we forcibly enable the hotkey mask for the F7 key, then the event that is generated is the following, which is not captured by the nvidia driver.

ibm/hotkey HKEY 00000080 00001007

Thus, to enable the Fn-F7 functionality we should ensure that the F7 key remains unmasked. On my machine, the recommended hotkey mask can be obtained using the following command

This masks the F7 key too, so to specifically not mask F7 we change the second last 'f' (1111) to 'b' (1011), where the keys are read as F8,F7,F6,F5. This can be now echoed back to the hotkey file:

The above line can be added to /etc/conf.d/local.start  so that it is run automatically on boot.

other buttons
See


 * [/IBM_Specific_Laptop_Guide#IBM_Specific_ACPI_scripts Bluetooth/F5, VideoSwitch/F7, BayEject/F9]
 * [/Laptop_Specific_Utilities#Helper_Scripts VideoSwitch/F7, UltraNav/F8 and Eject/F9]

Wireless switch on the front beneath firewire
Switch state is reported at /sys/devices/platform/thinkpad_acpi/hotkey_radio_sw

To make <font color="#000000">/etc/init.d/net.wlan0</tt>  honour the switch state add this to /etc/conf.d/net

= tp_smapi: Harddisk Active Protection System (hdaps) =

The hdaps kernel module produced by tp_smapi will work, but you need to pass the invert=1 parameter when loading the module or all input will be inverted. Stopping the disk works, but kernels PRIOR to 2.6.28 require a patch from the ones listed on ThinkWiki. Have a look at [/Talk:Lenovo_Thinkpad_T61#HDAPS Discussions Page].

For kernels 2.6.28 and newer, you may use the in-kernel hdaps module to park the disk. Enable the following in your kernel:

= Kernel Config =

Thinkpad  T61  should work with any kernel greater 2.6.22.

= Pre-Installation Notes =

livecd-2007.0-amd64 / ahci / compat
The live-cd may hang at:

Loading modules ... scanning for ahci...

There does not seem to be any suitable kernel parameter to boot the livecd with which solves the problem. Switch <font color="#000000">Config/Serial-ATA</tt> from mode to mode in BIOS. After installing, switch back to mode.

= Problems and Solutions =

x86: nvidia-drivers not working and irq complaints
On T61s with old BIOS-Version (1.09 (7LET39WW) 2007-05-14 for me) one might get an "irq xx: nobody cared" error (example output) and nvidia-module complains about not receiving interrupts (example output). All workarounds seem to make another HW-Part unusable. The solution is a BIOS update (most easy via ThinkVantage SystemUpdate) to the newest version (1.22 (7LET52WW) 2007-08-27 at the moment).

HDAPS joystick support
dmesg:

input: ThinkPad HDAPS joystick emulation as /class/input/input6 input: ThinkPad HDAPS accelerometer data as /class/input/input7

Furthermore I created the group 'joy' including my username and I also edited the udev rules for this device:

echo 'SUBSYSTEM=="input", KERNEL=="js*", MODE="0660", GROUP="joy"' >> /etc/udev/hdaps-joy.rules ln -s /etc/udev/hdaps-joy.rules /etc/udev/rules.d/z60_hdaps-joy.rules

Still, I don't get the /dev/joy device? What am I doing wrong?

xorg-1.5 and i810
If you are using xorg-1.5 and have the Intel GMA X3100 you won't get any TTM support. Follow this link for further information: http://bugs. gentoo .org/show_bug.cgi?id=237468

= Links =


 * Guide for Debian Etch on Thinkpad  T61  with huge listings of system specs
 * fgo: Setup guide Thinkpad  T61  with X3100 graphic chip
 * Guide for the predecessor with help for CDMA card and Harddisk protection
 * nvidia xorg.conf options
 * Phoronix on NVS 140M
 * nvidia announcing improvements regarding suspend/resume
 * opensuse on suspend
 * Rafael J. Wysocki's annual Suspend and hibernation status report (2007)
 * This guide is listed at the TuxMobil Linux laptop and notebook installation survey (IBM/ Lenovo ).

References:


 * VESA video mode numbers
 * Spock's uvesafb instructions