From owner-acpi-jp@jp.freebsd.org  Sat Dec 30 01:01:16 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id BAA53798;
	Sat, 30 Dec 2000 01:01:16 +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 BAA53793
	for <acpi-jp@jp.freebsd.org>; Sat, 30 Dec 2000 01:01:15 +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 eBTG1Ek32027
	for <acpi-jp@jp.freebsd.org>; Sat, 30 Dec 2000 01:01:14 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
To: acpi-jp@jp.freebsd.org
In-Reply-To: <20001228021603T.haro@tk.kubota.co.jp>
References: <20001227115125L.haro@tk.kubota.co.jp>
	<20001227232806E.iwasaki@jp.FreeBSD.org>
	<20001228021603T.haro@tk.kubota.co.jp>
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: <20001230010112W.iwasaki@jp.FreeBSD.org>
Date: Sat, 30 Dec 2000 01:01:12 +0900
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
X-Dispatcher: imput version 20000228(IM140)
Lines: 32
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 1012
Subject: [acpi-jp 1012] Re: Generalised power-management interface (was
 Re: Some power device driver. ) 
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

Hi,

> ::The acpi_power_fn() keeps the latest battery info. to reduce AML method
> ::execution (heavy!) until it expired.
> 
> But some applications, like xbattbar, updates every 10secs.
> So caching for 30secs seems to long.

OK, here is my latest (and maybe fainal) version of diffs at
http://people.freebsd.org/~iwasaki/acpi/power-20001229.tar.gz

you can specify it like
	sysctl -w hw.battery.info_expire=5

Also
	sysctl -w hw.battery.full_charge_time=60,60
for multiple number of batteries, or
	sysctl -w hw.battery.full_charge_time=120
for a battery installed so that acpi utilities calculate battery
remaining time when ac-line is connected.
I'm planning to improve APM code too using this MIBs.

This version includes preparation of acpi battery device driver
support other than control method battery, like smart battery.
The acpi battery abstraction layer have been added and acpi_cmbat
specific code have been reduced in acpi.c.  We'd probably better to
have acpi_battery.c for this code.

Most of calculation part in acpibatt have been moved to acpi_cmbat.c.
acpibatt and ioctls of acpi_cmbat have been simplified.

Comments welcome, thanks!
