[ltp] power button on X60s

Martin Lorenz linux-thinkpad@linux-thinkpad.org
Wed, 6 Sep 2006 11:40:36 +0200


On Wed, Sep 06, 2006 at 11:10:34AM +0200, Tino Keitel wrote:
> On Wed, Sep 06, 2006 at 08:02:07 +0200, Martin Lorenz wrote:
> > Hallo to all!
> > 
> > I've got another one:
> > 
> > The power button on my X60s (1702-55G) dosen't do anything...
> > well, it does a hard power off, when pressed more than 4 secs. that one is
> > OK, but I thought it should generate an ACPI event when pressed shorter.
> > 
> > I don't see any in my acpid log.
> > it simply does nothing.
> > 
> > is this normal behaviour? is it configurable?
> 
> Both. You see ACPI events only when you start acpid in debug mode.
> Furthermore, the action for the power button is configurable, e.g. to
> shut down the system or to trigger a suspend to disk.

usually acpid logs all events together with output from the handler scripts 
to /var/log/acpid 
but not so for pressing the power button

when I press e.g. the hibernate key (Fn+F12) I see this:
[Wed Sep  6 11:27:51 2006] received event "ibm/hotkey HKEY 00000080
0000100c"
[Wed Sep  6 11:27:51 2006] notifying client 3355[0:0]
[Wed Sep  6 11:27:51 2006] notifying client 3400[107:111]
[Wed Sep  6 11:27:51 2006] executing action "/etc/acpi/hibernatebtn.sh"
[Wed Sep  6 11:27:51 2006] BEGIN HANDLER MESSAGES
[Wed Sep  6 11:27:52 2006] END HANDLER MESSAGES
[Wed Sep  6 11:27:52 2006] action exited with status 0
[Wed Sep  6 11:27:52 2006] completed event "ibm/hotkey HKEY 00000080
0000100c"

/etc/acpi/hibernatebtn.sh does a 
acpi_fakekey $KEY_SUSPEND
so actually does nothing, but I can see it in the log



I have a powerbtn.sh script (provided by the acpid package) which reads as
follows:

#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.

# If powersaved is running, let it process the acpi event
if pidof powersaved; then
    exit 0
fi

if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
then
    dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit
0
else
    /sbin/shutdown -h now "Power button pressed"
fi

there is no powersaved running
and no [k]desktop
so from my understanding it must go into the shutdown part

I have the feeling, that the power key must be disabled somewhere else

as I write this lines I got the idea, that it could be in
/proc/acpi/ibm/hotkey....
$ cat /proc/acpi/ibm/hotkey
status:         enabled
mask:           0xff9f
commands:       enable, disable, reset, <mask>

<kernel-src>Documentation/ibm-acpi.txt
gives this bit of information:

        key     bit     behavior when set       behavior when unset

        Fn-F3                   always generates ACPI event
        Fn-F4                   always generates ACPI event
        Fn-F5   0010    generate ACPI event     enable/disable Bluetooth
        Fn-F7   0040    generate ACPI event     switch LCD and external display
        Fn-F8   0080    generate ACPI event     expand screen or none
        Fn-F9   0100    generate ACPI event     none
        Fn-F12                  always generates ACPI event

I also have a hotkey on F2 (lock) and on Home, End, Up, Down, Left, Right
and PgUp which are not listed here

tried to change the mask to 0xffff but it diden't change anything

is there further documentation somewhere, that I haven't found yet?

gruss
  mlo
--
Dipl.-Ing. Martin Lorenz

            They that can give up essential liberty 
	    to obtain a little temporary safety 
	    deserve neither liberty nor safety.
                                   Benjamin Franklin

please encrypt your mail to me
GnuPG key-ID: F1AAD37D
get it here:
http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xF1AAD37D

ICQ UIN: 33588107