Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 195673 - thinkpad-acpi module does not correctly detect a Lenovo hotkey layout
Summary: thinkpad-acpi module does not correctly detect a Lenovo hotkey layout
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-13 00:54 UTC by Christopher Smith
Modified: 2008-01-14 11:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dmesg output (dmesg.txt,28.60 KB, text/plain)
2007-10-15 22:48 UTC, Christopher Smith
Details
kernel config (kconfig.txt,44.08 KB, text/plain)
2007-10-15 22:49 UTC, Christopher Smith
Details
Thinkpad keymapping detection code. (thinkpad-acpi_mappings.txt,2.13 KB, text/plain)
2007-11-13 06:19 UTC, Christopher Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Smith 2007-10-13 00:54:40 UTC
The thinkpad-acpi module does not correctly detect a Lenovo hotkey layout.  It seems that the thinkpad-acpi module in kernel 2.6.23 actually has detection code built in to set the hotkey map according to the PCI_VENDOR_ID.  There are at least two problems in the current incarnation.  The first problem is that there is no PCI_VENDOR_ID for Lenovo in include/linux/pci_ids.h.  After adding the line:

#define  PCI_VENDOR_ID_LENOVO  0x17aa

to include/linux/pci_ids.h in the hopes of getting the correct hotkey map the result was the same.  Hotkeys are still mapped to the older IBM configuration.

Reproducible: Always

Steps to Reproduce:
1. Compile kernel with thinkpad-acpi enabled on a Lenovo thinkpad
2. Create event and actions scripts in acpid configuration
3. Press FnF3

Actual Results:  
Backlight is turned off.

Expected Results:  
Battery status should be shown, or at least a custom acpi event should be allowed to be processed.
Comment 1 Maarten Bressers (RETIRED) gentoo-dev 2007-10-14 01:21:44 UTC
Can you post your 2.6.23 kernel .config and dmesg output? You might want to use CONFIG_THINKPAD_ACPI_DEBUG if you haven't already, that may give us some additional info.
Comment 2 Christopher Smith 2007-10-14 15:53:22 UTC
(In reply to comment #1)
> Can you post your 2.6.23 kernel .config and dmesg output? You might want to use
> CONFIG_THINKPAD_ACPI_DEBUG if you haven't already, that may give us some
> additional info.
> 

I did make a mistake because I was switching back and forth between kernel 2.6.22 and 2.6.23.  Apparently the PCI_ID is listed in the latest kernel's pci_ids.h file.  I will try enabling debug mode to find out more information.  Also I want to add that machine I am having issues with is a T60-1953 with intel graphics and intel wireless.
Comment 3 Christopher Smith 2007-10-15 22:48:57 UTC
Created attachment 133573 [details]
dmesg output
Comment 4 Christopher Smith 2007-10-15 22:49:42 UTC
Created attachment 133575 [details]
kernel config
Comment 5 Daniel Drake (RETIRED) gentoo-dev 2007-10-29 13:53:48 UTC
So, just to clarify, the problem is basically that pressing FnF3 turns the backlight off rather than showing battery status?

Are you 100% sure that this functionality is controlled by the thinkpad_acpi driver? i.e. if you don't include that driver in your kernel, does FnF3 do nothing? does it generate any events in that configuration?
Comment 6 Mike Pagano gentoo-dev 2007-11-12 15:06:25 UTC
Christopher, Have you had a chance to perform the tests requested in comment #5 ?
Comment 7 Christopher Smith 2007-11-13 06:17:54 UTC
The thinkpad-acpi module generates acpi events on FnF? keypresses.  The keypresses are logged and I know they are generating events.  I have been able to map the keys to scripts, one of which shows battery status.  I can even get it to work with FnF3 but it doesn't stop the hard coded event from also happening.  This is basically the problem.  Particular FnF? keypresses are hard coded to specific events.  FnF4 suspends, FnF12 hibernates, etc.  The thinkpad-acpi kernel code has two different mappings, one for the older IBM style Fn setup where FnF3 actually is supposed to be screen blanking, and the newer one for Lenovo style Fn Keys where FnF3 isn't hard coded to blank the screen.  The problem is that for some reason the mapping isn't being chosen correctly.  I don't know enough about this to know if it is purely a kernel thing or if it is also related to something in userspace but I have seen the kernel code and was able figure out that the Lenovo style mapping is present in kernel 2.6.23 but is not being selected.  I'm just not sure why.

I am going to attach the section of code in from thinkpad-acpi that maps the two different layouts so you can see what I am talking about.
Comment 8 Christopher Smith 2007-11-13 06:19:08 UTC
Created attachment 135854 [details]
Thinkpad keymapping detection code.
Comment 9 Mike Pagano gentoo-dev 2007-12-19 19:12:28 UTC
The latest git-sources contains a patch that removes the generation of the EV_KEY KEY_BRIGHTNESS_UP/DOWN input events for the default Lenovo keymap.

Can you please test with git-sources-2.6.24_rc5-r6 and post back the test results here?



Comment 10 Robert Buchholz (RETIRED) gentoo-dev 2008-01-04 15:01:59 UTC
The Fn-F3 key is supposed to have different functions on different machines. There's more info in acpi-support's thinkpad-lockorbattery.sh -- copying from that:

# Lenovo are great.  They have changed the function of the Fn-F3
# combination on the LenovoPads from KEY_LOCK => KEY_BATTERY.
# Unfortunately they didn't bother to change the DMI strings
# consistently...  so some of the new machines say 'LENOVO' and some
# still say 'IBM'.  Yay for consistency(!).
#
# (And just to top that, LENOVO have started producing non-ThinkPad
# laptop computers).

# So:
# IBM && !Series60   => Lock
# IBM && Series60    => Battery
# LENOVO && ThinkPad => Battery
Comment 11 Mike Pagano gentoo-dev 2008-01-08 15:49:32 UTC
Please reopen when you have had a chance to test with the latest dev kernel as requested in comment #9. 
Comment 12 Christopher Smith 2008-01-14 11:32:53 UTC
I am using the latest Hardened and Gentoo sources (2.6.23-r5) and the problem seems to be fixed now.