From owner-acpi-jp@jp.freebsd.org  Sat Jan 13 03:02:51 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id DAA46002;
	Sat, 13 Jan 2001 03:02:51 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id DAA45993;
	Sat, 13 Jan 2001 03:02:48 +0900 (JST)
	(envelope-from jhb@FreeBSD.org)
Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241])
	by meow.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f0CI1g133215;
	Fri, 12 Jan 2001 10:01:42 -0800 (PST)
	(envelope-from jhb@FreeBSD.org)
Message-ID: <XFMail.010112100223.jhb@FreeBSD.org>
X-Mailer: XFMail 1.4.0 on FreeBSD
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
In-Reply-To: <20010112232818G.iwasaki@jp.FreeBSD.org>
Date: Fri, 12 Jan 2001 10:02:23 -0800 (PST)
From: John Baldwin <jhb@FreeBSD.org>
To: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
Cc: acpi-jp@jp.FreeBSD.org
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 1032
Subject: [acpi-jp 1032] Re: Sysctls to control sleep states
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: jhb@FreeBSD.org


On 12-Jan-01 Mitsuru IWASAKI wrote:
> 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

Ok.  I'll whip up a generic sysctl handler for sleep states that uses arg1 of
the sysctl node as the state to adjust.  I'll try to update the patchset to use
that later on today.

> Thanks

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
