[ltp] Re: Bluetooth button not working after installing Debian 2.6.29 kernel

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Fri, 17 Apr 2009 11:33:42 -0300


On Fri, 17 Apr 2009, Bjørn Mork wrote:
> Henrique de Moraes Holschuh <hmh@hmh.eng.br> writes:
> > Hmm, let me check the latest acpid in Debian...  Hey, it has been updated,
> > my info was outdated.  Check acpid -n.  It now listens over netlink.
> 
> Thanks for the pointer.  I've now finally looked at it, and using this
> patch on top of the Debian acpid restores previous functionality for me,
> using a default Debian linux-image-2.6.29-1-amd64 kernel (version
> 2.6.29-2):
> 
> 
> --- a/input_layer.c	2009-04-17 15:27:40.000000000 +0200
> +++ b/input_layer.c	2009-04-17 15:48:45.000000000 +0200
> @@ -57,7 +57,16 @@
>  	{{{0,0}, EV_KEY, KEY_SUSPEND, 1}, 
>   		"button/suspend SUSP 00000080 00000000"},
>  	{{{0,0}, EV_SW, SW_LID, 1}, "button/lid LID close"},
> -	{{{0,0}, EV_SW, SW_LID, 0}, "button/lid LID open"}
> +	{{{0,0}, EV_SW, SW_LID, 0}, "button/lid LID open"},
> +
> +	/* Additional Lenovo Thinkpad keys */
> +	{{{0,0}, EV_KEY, KEY_BATTERY, 1}, "ibm/hotkey HKEY 00000080 00001003"},
> +	{{{0,0}, EV_KEY, KEY_RADIO, 1}, "ibm/hotkey HKEY 00000080 00001005"},
> +	{{{0,0}, EV_KEY, KEY_SWITCHVIDEOMODE, 1}, 
> +	        "ibm/hotkey HKEY 00000080 00001007"},
> +	{{{0,0}, EV_KEY, KEY_F22, 1}, "ibm/hotkey HKEY 00000080 00001008"},
> +	{{{0,0}, EV_KEY, KEY_F24, 1}, "ibm/hotkey HKEY 00000080 00001009"},
> +	{{{0,0}, EV_KEY, KEY_ZOOM, 1}, "ibm/hotkey HKEY 00000080 00001014"},
>  };

Is thet a table that makes acpid issue input events from acpi events?  You
should never need that, thinkpad-acpi already issues input events, at most
you need to use a simple HAL .fdi file to set, e.g., KEY_BATTERY on fn+f3.

And BTW, KEY_RADIO is to select your AM/FM tuner in a remote control, it is
not related to any sort of data link radios.  There is no generic "data
radio" input event, only specific ones like KEY_BLUETOOTH, KEY_WIFI, etc.

> Any reasons why this shouldn't be added to acpid?  Any additional keys
> which should be included at the same time?

acpid is not going to receive ACPI ibm/hotkey events by default. If it is
receiving them in your box, that's because you have some legacy support
active for acpi in Kconfig, and the events are going over procfs.  The
thinkpad-acpi driver won't issue them over netlink.

Those hotkey events are input events, they will be sent to the input layer
(thinkpad-acpi input device) excusively when the legacy reporting over
procfs is gone.

The proper fix is to teach HAL to do stuff when it receives a certain input
event.  But if you just need to get input events, that's something the
driver already generates, so you should not need acpid at all, and the
problem is elsewhere...

The typical problem is that X evdev ignores events above 255, so you need to
remap the thinkpad-acpi input device (typically using HAL .fdi files) to
have KEY_* codes that are below 255 only.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh