Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Use the predefined ACPI_STA_BATTERY_PRESENT ins...



details:   https://anonhg.NetBSD.org/src/rev/cd7c45a1c762
branches:  trunk
changeset: 752854:cd7c45a1c762
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Mon Mar 08 11:45:45 2010 +0000

description:
Use the predefined ACPI_STA_BATTERY_PRESENT instead of defining a local one.

diffstat:

 sys/dev/acpi/acpi_bat.c |  19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)

diffs (47 lines):

diff -r 64350a376bc3 -r cd7c45a1c762 sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c   Mon Mar 08 11:39:42 2010 +0000
+++ b/sys/dev/acpi/acpi_bat.c   Mon Mar 08 11:45:45 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_bat.c,v 1.84 2010/03/05 14:00:16 jruoho Exp $     */
+/*     $NetBSD: acpi_bat.c,v 1.85 2010/03/08 11:45:45 jruoho Exp $     */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.84 2010/03/05 14:00:16 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.85 2010/03/08 11:45:45 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -166,19 +166,6 @@
 #define ACPIBAT_ST_CRITICAL    0x00000004  /* battery is critical */
 
 /*
- * Flags for battery status from _STA return. Note that
- * this differs from the conventional evaluation of _STA:
- *
- *     "Unlike most other devices, when a battery is inserted or
- *      removed from the system, the device itself (the battery bay)
- *      is still considered to be present in the system. For most
- *      systems, the _STA for this device will always return a value
- *      with bits 0-3 set and will toggle bit 4 to indicate the actual
- *      presence of a battery. (ACPI 3.0, sec. 10.2.1, p. 320.)"
- */
-#define ACPIBAT_STA_PRESENT    0x00000010  /* battery present */
-
-/*
  * A value used when _BST or _BIF is teporarily unknown (see ibid.).
  */
 #define ACPIBAT_VAL_UNKNOWN    0xFFFFFFFF
@@ -318,7 +305,7 @@
 
        sc->sc_sensor[ACPIBAT_PRESENT].state = ENVSYS_SVALID;
 
-       if ((val & ACPIBAT_STA_PRESENT) == 0) {
+       if ((val & ACPI_STA_BATTERY_PRESENT) == 0) {
                sc->sc_sensor[ACPIBAT_PRESENT].value_cur = 0;
                return 0;
        }



Home | Main Index | Thread Index | Old Index