From owner-acpi-jp@jp.freebsd.org  Fri Jan 12 23:28:21 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id XAA34838;
	Fri, 12 Jan 2001 23:28:21 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (daemon@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id XAA34832
	for <acpi-jp@jp.freebsd.org>; Fri, 12 Jan 2001 23:28:21 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92])
	by tasogare.imasy.or.jp (8.11.1+3.4W/3.7W-tasogare/smtpfeed 1.07) with ESMTP id f0CESJk47819;
	Fri, 12 Jan 2001 23:28:19 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
To: acpi-jp@jp.freebsd.org, jhb@FreeBSD.org
In-Reply-To: <XFMail.010111182644.jhb@FreeBSD.org>
References: <XFMail.010111182644.jhb@FreeBSD.org>
X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <20010112232818G.iwasaki@jp.FreeBSD.org>
Date: Fri, 12 Jan 2001 23:28:18 +0900
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
X-Dispatcher: imput version 20000228(IM140)
Lines: 26
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 1031
Subject: [acpi-jp 1031] Re: Sysctls to control sleep states
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

Hi, John! and welcome to acpi-jp :-)

> other times I do wish for it to suspend.  The easiest method of making this
> configurable seemed to be to make the sleep state used on a sleep event to be
> configured via sysctl.  This will allow a userland tool to set the default
> states as well.  The result is this:
> 
> > sysctl hw.acpi0
> hw.acpi0.power_button_state: 6
> hw.acpi0.sleep_button_state: 1
> hw.acpi0.lid_switch_state: 1

Cool!  I have similar patch here which uses ioctl via acpiconf, but
I prefer your patch.

> Right now the states are just the integer constants.  If S[0-5] had defined
> names, I would prefer to use those, but I didn't find any official names for
> them unfortunately.  Since ACPI_STATE_S5 is actually 6, it might make more
> sense to use a function to map 0 to ACPI_STATE_S0, 2 to S2, 5 to S5, etc.  We
> could even use the strings "S0", "S1", etc.  Whatever you all prefer can be
> done with ease.

I vote for strings (e.g. S0, S1, S2, S3, S4, S4B and S5).
# currently we don't support S2-S4B though :-p

Thanks
