Subject: CVS commit: src
To: None <source-changes@NetBSD.org>
From: Juan Romero Pardines <xtraeme@netbsd.org>
List: source-changes
Date: 11/03/2007 23:05:23
Module Name:	src
Committed By:	xtraeme
Date:		Sat Nov  3 23:05:23 UTC 2007

Modified Files:
	src/sys/dev/acpi: acpi_bat.c
	src/sys/dev/sysmon: sysmon_envsys.c sysmon_envsys_events.c
	    sysmon_envsys_tables.c sysmon_envsysvar.h
	src/sys/sys: envsys.h
	src/usr.sbin/envstat: envstat.c

Log Message:
- Rename ENVSYS_BATTERY_STATE units to ENVSYS_BATTERY_CAPACITY and
  introduce ENVSYS_BATTERY_CHARGE, which is the same than an Indicator and
  it's used to know if the battery is currently charging or discharging.

- Require two sensors at least for SME_CLASS_BATTERY to make the low-power
  condition work: a ENVSYS_BATTERY_CAPACITY plus ENVSYS_BATTERY_CHARGE.

- Simplify sme_event_check_lowpower() and make it check the required
  sensors in the SME_CLASS_ACADAPTER and SME_CLASS_BATTERY classes.
  If the acadapter is not ready, trust the state returned by the battery
  device.

Based on suggestion from joerg@.


To generate a diff of this commit:
cvs rdiff -r1.60 -r1.61 src/sys/dev/acpi/acpi_bat.c
cvs rdiff -r1.70 -r1.71 src/sys/dev/sysmon/sysmon_envsys.c
cvs rdiff -r1.43 -r1.44 src/sys/dev/sysmon/sysmon_envsys_events.c
cvs rdiff -r1.2 -r1.3 src/sys/dev/sysmon/sysmon_envsys_tables.c
cvs rdiff -r1.22 -r1.23 src/sys/dev/sysmon/sysmon_envsysvar.h
cvs rdiff -r1.17 -r1.18 src/sys/sys/envsys.h
cvs rdiff -r1.56 -r1.57 src/usr.sbin/envstat/envstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.