Subject: acpi
To: None <netbsd-help@netbsd.org>
From: Thierry Lacoste <th.lacoste@wanadoo.fr>
List: netbsd-help
Date: 12/21/2004 15:12:17
This is a multi-part message in MIME format.

------=_NextPart_000_001A_01C4E76F.75E5B130
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I'd like to make the sleep button of my laptop work with NetBSD 2.0.

Here's an exerpt of my dmesg output concerning acpi :

acpi0 at mainbus0
acpi0: using Intel ACPI CA subsystem version 20040211
acpi0: X/RSDT: OemId <PTLTD ,  RSDT  ,06040000>, AslId < LTP,00000000>
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
acpi: activated PNP0C0F
acpiacad0 at acpi0 (ACPI0003): ACPI AC Adapter
acpibat0 at acpi0 (PNP0C0A): ACPI Battery (Control Method)
acpilid0 at acpi0 (PNP0C0D): ACPI Lid Switch
acpibut0 at acpi0 (PNP0C0E): ACPI Sleep Button
PNP0A03 at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0C0F at acpi0 not configured
PNP0200 at acpi0 not configured
npx1 at acpi0 (PNP0C04)
npx1: io 0xf0-0xfe irq 13
npx1: using exception 16
PNP0000 at acpi0 not configured
PNP0B00 at acpi0 not configured
PNP0800 at acpi0 not configured
PNP0100 at acpi0 not configured
pckbc1 at acpi0 (PNP0303): kbd port
pckbc1: io 0x60,0x64 irq 1
pckbc2 at acpi0 (SYN0302): aux port
pckbc2: irq 12
PNP0C02 at acpi0 not configured
PNP0C01 at acpi0 not configured
acpiec0 at acpi0 (PNP0C09): ACPI Embedded Controller
acpiec0: io 0x62,0x66
lpt3 at acpi0 (PNP0401-0)
lpt3: io 0x378-0x37f,0x778-0x77f irq 7 drq 1
NSC6001 at acpi0 not configured
acpitz0 at acpi0: ACPI Thermal Zone
acpitz0: unable to get polling interval; using default of 30.0s
acpitz1 at acpi0: ACPI Thermal Zone
acpitz1: unable to get polling interval; using default of 30.0s
pckbd0 at pckbc1 (kbd slot)
pckbc1: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pms0 at pckbc1 (aux slot)
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0

I run the powerd deamon with the folowing files in =
/etc/powerd/scripts/acpi/

#!/bin/sh -
#
# $NetBSD: power_button,v 1.3 2003/11/01 23:04:54 mycroft Exp $
#
# Generic script for power button events.  We simply attempt to
# shut the system down gracefully, and let the kernel handle
# the poweroff.
#
# Arguments passed by powerd(8):
#
# device event

case "${2}" in
pressed)
 /sbin/shutdown -p now "power button pressed"
 exit 0
 ;;

*)
 logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
 exit 1
 ;;
esac


#!/bin/sh -
#
# $NetBSD: reset_button,v 1.3 2003/11/01 23:04:54 mycroft Exp $
#
# Generic script for reset button events.  We simply attempt to
# reboot the system gracefully.
#
# Arguments passed by powerd(8):
#
# device event

case "${2}" in
pressed)
 /sbin/shutdown -r now "reset button pressed"
 exit 0
 ;;

*)
 logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
 exit 1
 ;;
esac


#!/bin/sh -
#
# $NetBSD: sleep_button,v 1.2 2003/10/30 17:42:23 mycroft Exp $
#
# Generic script for sleep button events.  We do nothing for now.
#
# Arguments passed by powerd(8):
#
# device event

case "${2}" in
*)
 logger -p warning "${0}: unsupported event ${2} on device ${1}"
 exit 1
 ;;
esac

Nothing happens when I press the sleep button or the power button:
no message on the console, nothing in the /var/log/messages ...

I browsed the manual pages for acpi, acpibut, powerd and others
but could not find an answer.

Dis I miss something?

Regards,
Thierry.

------=_NextPart_000_001A_01C4E76F.75E5B130
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I'd like to make the sleep button of my =
laptop work=20
</FONT><FONT face=3DArial size=3D2>with NetBSD 2.0.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here's an exerpt of my dmesg output =
concerning acpi=20
:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>acpi0 at mainbus0<BR>acpi0: using Intel =
ACPI CA=20
subsystem version 20040211<BR>acpi0: X/RSDT: OemId &lt;PTLTD ,&nbsp; =
RSDT&nbsp;=20
,06040000&gt;, AslId &lt; LTP,00000000&gt;<BR>acpi0: SCI interrupting at =
int=20
9<BR>acpi0: fixed-feature power button present<BR>ACPI Object Type =
'Processor'=20
(0x0c) at acpi0 not configured<BR>ACPI Object Type 'Processor' (0x0c) at =
acpi0=20
not configured<BR>acpi: activated PNP0C0F<BR>acpiacad0 at acpi0 =
(ACPI0003): ACPI=20
AC Adapter<BR>acpibat0 at acpi0 (PNP0C0A): ACPI Battery (Control=20
Method)<BR>acpilid0 at acpi0 (PNP0C0D): ACPI Lid Switch<BR>acpibut0 at =
acpi0=20
(PNP0C0E): ACPI Sleep Button<BR>PNP0A03 at acpi0 not =
configured<BR>PNP0C0F at=20
acpi0 not configured<BR>PNP0C0F at acpi0 not configured<BR>PNP0C0F at =
acpi0 not=20
configured<BR>PNP0C0F at acpi0 not configured<BR>PNP0200 at acpi0 not=20
configured<BR>npx1 at acpi0 (PNP0C04)<BR>npx1: io 0xf0-0xfe irq =
13<BR>npx1:=20
using exception 16<BR>PNP0000 at acpi0 not configured<BR>PNP0B00 at =
acpi0 not=20
configured<BR>PNP0800 at acpi0 not configured<BR>PNP0100 at acpi0 not=20
configured<BR>pckbc1 at acpi0 (PNP0303): kbd port<BR>pckbc1: io =
0x60,0x64 irq=20
1<BR>pckbc2 at acpi0 (SYN0302): aux port<BR>pckbc2: irq 12<BR>PNP0C02 at =
acpi0=20
not configured<BR>PNP0C01 at acpi0 not configured<BR>acpiec0 at acpi0 =
(PNP0C09):=20
ACPI Embedded Controller<BR>acpiec0: io 0x62,0x66<BR>lpt3 at acpi0=20
(PNP0401-0)<BR>lpt3: io 0x378-0x37f,0x778-0x77f irq 7 drq 1<BR>NSC6001 =
at acpi0=20
not configured<BR>acpitz0 at acpi0: ACPI Thermal Zone<BR>acpitz0: unable =
to get=20
polling interval; using default of 30.0s<BR>acpitz1 at acpi0: ACPI =
Thermal=20
Zone<BR>acpitz1: unable to get polling interval; using default of=20
30.0s<BR>pckbd0 at pckbc1 (kbd slot)<BR>pckbc1: using irq 1 for kbd=20
slot<BR>wskbd0 at pckbd0: console keyboard<BR>pms0 at pckbc1 (aux=20
slot)<BR>pckbc1: using irq 12 for aux slot<BR>wsmouse0 at pms0 mux=20
0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I run the powerd deamon with the =
folowing files in=20
/etc/powerd/scripts/acpi/</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#!/bin/sh -<BR>#<BR>#&nbsp;$NetBSD: =
power_button,v=20
1.3 2003/11/01 23:04:54 mycroft Exp $<BR>#<BR># Generic script for power =
button=20
events.&nbsp; We simply attempt to<BR># shut the system down gracefully, =
and let=20
the kernel handle<BR># the poweroff.<BR>#<BR># Arguments passed by=20
powerd(8):<BR>#<BR>#&nbsp;device event</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>case "${2}" =
in<BR>pressed)<BR>&nbsp;/sbin/shutdown=20
-p now "power button pressed"<BR>&nbsp;exit 0<BR>&nbsp;;;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>*)<BR>&nbsp;logger -p warning "${0}: =
unsupported=20
event ${2} on device ${1}" &gt;&amp;1<BR>&nbsp;exit=20
1<BR>&nbsp;;;<BR>esac<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#!/bin/sh -<BR>#<BR>#&nbsp;$NetBSD: =
reset_button,v=20
1.3 2003/11/01 23:04:54 mycroft Exp $<BR>#<BR># Generic script for reset =
button=20
events.&nbsp; We simply attempt to<BR># reboot the system =
gracefully.<BR>#<BR>#=20
Arguments passed by powerd(8):<BR>#<BR>#&nbsp;device event</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>case "${2}" =
in<BR>pressed)<BR>&nbsp;/sbin/shutdown=20
-r now "reset button pressed"<BR>&nbsp;exit 0<BR>&nbsp;;;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>*)<BR>&nbsp;logger -p warning "${0}: =
unsupported=20
event ${2} on device ${1}" &gt;&amp;1<BR>&nbsp;exit=20
1<BR>&nbsp;;;<BR>esac<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#!/bin/sh -<BR>#<BR>#&nbsp;$NetBSD: =
sleep_button,v=20
1.2 2003/10/30 17:42:23 mycroft Exp $<BR>#<BR># Generic script for sleep =
button=20
events.&nbsp; We do nothing for now.<BR>#<BR># Arguments passed by=20
powerd(8):<BR>#<BR>#&nbsp;device event</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>case "${2}" in<BR>*)<BR>&nbsp;logger -p =
warning=20
"${0}: unsupported event ${2} on device ${1}"<BR>&nbsp;exit=20
1<BR>&nbsp;;;<BR>esac<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Nothing happens when I press the sleep =
button or=20
the power button:</FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2>no message on the console, =
nothing in the=20
/var/log/messages ...</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I browsed the manual pages for acpi, =
acpibut,=20
powerd and others</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>but could not find an =
answer.</FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT size=3D2>Dis I miss =
something?</FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT size=3D2>Regards,</FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2>Thierry.</FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT =
size=3D2></FONT>&nbsp;</DIV></FONT></BODY></HTML>

------=_NextPart_000_001A_01C4E76F.75E5B130--