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 ACPICA's standard notify values from <actyp...



details:   https://anonhg.NetBSD.org/src/rev/f2c444a71f0a
branches:  trunk
changeset: 754308:f2c444a71f0a
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Apr 27 05:57:43 2010 +0000

description:
Use ACPICA's standard notify values from <actypes.h> and move the
device-specific notify constants to the device-specific files.

diffstat:

 sys/dev/acpi/acpi_acad.c   |  18 ++++++++++--------
 sys/dev/acpi/acpi_bat.c    |  15 +++++++++------
 sys/dev/acpi/acpi_button.c |   9 +++++----
 sys/dev/acpi/acpi_lid.c    |   8 +++++---
 sys/dev/acpi/acpi_tz.c     |  14 +++++++++-----
 sys/dev/acpi/acpireg.h     |  44 +-------------------------------------------
 6 files changed, 39 insertions(+), 69 deletions(-)

diffs (277 lines):

diff -r 9856c78b03b2 -r f2c444a71f0a sys/dev/acpi/acpi_acad.c
--- a/sys/dev/acpi/acpi_acad.c  Tue Apr 27 05:34:15 2010 +0000
+++ b/sys/dev/acpi/acpi_acad.c  Tue Apr 27 05:57:43 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_acad.c,v 1.43 2010/04/15 07:02:24 jruoho Exp $    */
+/*     $NetBSD: acpi_acad.c,v 1.44 2010/04/27 05:57:43 jruoho Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.43 2010/04/15 07:02:24 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.44 2010/04/27 05:57:43 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -54,6 +54,9 @@
 #define _COMPONENT              ACPI_ACAD_COMPONENT
 ACPI_MODULE_NAME                ("acpi_acad")
 
+#define ACPI_NOTIFY_ACAD        0x80
+#define ACPI_NOTIFY_ACAD_2      0x81 /* XXX. */
+
 struct acpiacad_softc {
        struct acpi_devnode     *sc_node;
        struct sysmon_envsys    *sc_sme;
@@ -242,14 +245,13 @@
         *  --rpaulo%NetBSD.org@localhost
         */
        /*
-        * XXX Sony VAIO VGN-N250E sends BatteryInformationChanged on AC
-        * adapter status change.
+        * XXX Sony VAIO VGN-N250E sends 0x81 on AC adapter status change.
         *  --jmcneill%NetBSD.org@localhost
         */
-       case ACPI_NOTIFY_BusCheck:
-       case ACPI_NOTIFY_DeviceCheck:
-       case ACPI_NOTIFY_PowerSourceStatusChanged:
-       case ACPI_NOTIFY_BatteryInformationChanged:
+       case ACPI_NOTIFY_ACAD:
+       case ACPI_NOTIFY_ACAD_2:
+       case ACPI_NOTIFY_BUS_CHECK:
+       case ACPI_NOTIFY_DEVICE_CHECK:
                (void)AcpiOsExecute(handler, acpiacad_get_status, dv);
                break;
 
diff -r 9856c78b03b2 -r f2c444a71f0a sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c   Tue Apr 27 05:34:15 2010 +0000
+++ b/sys/dev/acpi/acpi_bat.c   Tue Apr 27 05:57:43 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_bat.c,v 1.101 2010/04/16 01:52:54 christos Exp $  */
+/*     $NetBSD: acpi_bat.c,v 1.102 2010/04/27 05:57:43 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.101 2010/04/16 01:52:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.102 2010/04/27 05:57:43 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -92,6 +92,9 @@
 #define _COMPONENT              ACPI_BAT_COMPONENT
 ACPI_MODULE_NAME                ("acpi_bat")
 
+#define        ACPI_NOTIFY_BAT_STATUS   0x80
+#define        ACPI_NOTIFY_BAT_INFO     0x81
+
 /*
  * Sensor indexes.
  */
@@ -661,15 +664,15 @@
 
        switch (notify) {
 
-       case ACPI_NOTIFY_BusCheck:
+       case ACPI_NOTIFY_BUS_CHECK:
                break;
 
-       case ACPI_NOTIFY_DeviceCheck:
-       case ACPI_NOTIFY_BatteryInformationChanged:
+       case ACPI_NOTIFY_BAT_INFO:
+       case ACPI_NOTIFY_DEVICE_CHECK:
                (void)AcpiOsExecute(handler, acpibat_update_info, dv);
                break;
 
-       case ACPI_NOTIFY_BatteryStatusChanged:
+       case ACPI_NOTIFY_BAT_STATUS:
                (void)AcpiOsExecute(handler, acpibat_update_status, dv);
                break;
 
diff -r 9856c78b03b2 -r f2c444a71f0a sys/dev/acpi/acpi_button.c
--- a/sys/dev/acpi/acpi_button.c        Tue Apr 27 05:34:15 2010 +0000
+++ b/sys/dev/acpi/acpi_button.c        Tue Apr 27 05:57:43 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_button.c,v 1.35 2010/04/15 07:02:24 jruoho Exp $  */
+/*     $NetBSD: acpi_button.c,v 1.36 2010/04/27 05:57:43 jruoho Exp $  */
 
 /*
  * Copyright 2001, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_button.c,v 1.35 2010/04/15 07:02:24 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_button.c,v 1.36 2010/04/27 05:57:43 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -53,6 +53,8 @@
 #define _COMPONENT              ACPI_BUTTON_COMPONENT
 ACPI_MODULE_NAME                ("acpi_button")
 
+#define ACPI_NOTIFY_BUTTON      0x80
+
 struct acpibut_softc {
        struct acpi_devnode     *sc_node;
        struct sysmon_pswitch    sc_smpsw;
@@ -177,8 +179,7 @@
 
        switch (notify) {
 
-     /* case ACPI_NOTIFY_S0SleepButtonPressed: */
-       case ACPI_NOTIFY_S0PowerButtonPressed:
+       case ACPI_NOTIFY_BUTTON:
                (void)AcpiOsExecute(handler, acpibut_pressed_event, dv);
                break;
 
diff -r 9856c78b03b2 -r f2c444a71f0a sys/dev/acpi/acpi_lid.c
--- a/sys/dev/acpi/acpi_lid.c   Tue Apr 27 05:34:15 2010 +0000
+++ b/sys/dev/acpi/acpi_lid.c   Tue Apr 27 05:57:43 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_lid.c,v 1.39 2010/04/15 07:02:24 jruoho Exp $     */
+/*     $NetBSD: acpi_lid.c,v 1.40 2010/04/27 05:57:43 jruoho Exp $     */
 
 /*
  * Copyright 2001, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_lid.c,v 1.39 2010/04/15 07:02:24 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_lid.c,v 1.40 2010/04/27 05:57:43 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -53,6 +53,8 @@
 #define _COMPONENT              ACPI_LID_COMPONENT
 ACPI_MODULE_NAME                ("acpi_lid")
 
+#define ACPI_NOTIFY_LID                 0x80
+
 struct acpilid_softc {
        struct acpi_devnode     *sc_node;
        struct sysmon_pswitch    sc_smpsw;
@@ -159,7 +161,7 @@
 
        switch (notify) {
 
-       case ACPI_NOTIFY_LidStatusChanged:
+       case ACPI_NOTIFY_LID:
                (void)AcpiOsExecute(handler, acpilid_status_changed, dv);
                break;
 
diff -r 9856c78b03b2 -r f2c444a71f0a sys/dev/acpi/acpi_tz.c
--- a/sys/dev/acpi/acpi_tz.c    Tue Apr 27 05:34:15 2010 +0000
+++ b/sys/dev/acpi/acpi_tz.c    Tue Apr 27 05:57:43 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_tz.c,v 1.70 2010/04/24 19:16:10 jruoho Exp $ */
+/* $NetBSD: acpi_tz.c,v 1.71 2010/04/27 05:57:43 jruoho Exp $ */
 
 /*
  * Copyright (c) 2003 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.70 2010/04/24 19:16:10 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.71 2010/04/27 05:57:43 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -45,6 +45,10 @@
 #define _COMPONENT             ACPI_TZ_COMPONENT
 ACPI_MODULE_NAME               ("acpi_tz")
 
+#define ACPI_NOTIFY_TZ_ZONE    0x80
+#define ACPI_NOTIFY_TZ_TRIP    0x81
+#define ACPI_NOTIFY_TZ_DEVLIST 0x82
+
 #define ATZ_F_CRITICAL         0x01    /* zone critical */
 #define ATZ_F_HOT              0x02    /* zone hot */
 #define ATZ_F_PASSIVE          0x04    /* zone passive cooling */
@@ -581,12 +585,12 @@
 
        switch (notify) {
 
-       case ACPI_NOTIFY_ThermalZoneStatusChanged:
+       case ACPI_NOTIFY_TZ_ZONE:
                func = acpitz_get_status;
                break;
 
-       case ACPI_NOTIFY_ThermalZoneTripPointsChanged:
-       case ACPI_NOTIFY_DeviceListsChanged:
+       case ACPI_NOTIFY_TZ_TRIP:
+       case ACPI_NOTIFY_TZ_DEVLIST:
                func = acpitz_get_zone_quiet;
                break;
 
diff -r 9856c78b03b2 -r f2c444a71f0a sys/dev/acpi/acpireg.h
--- a/sys/dev/acpi/acpireg.h    Tue Apr 27 05:34:15 2010 +0000
+++ b/sys/dev/acpi/acpireg.h    Tue Apr 27 05:57:43 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpireg.h,v 1.8 2010/04/27 05:34:14 jruoho Exp $       */
+/*     $NetBSD: acpireg.h,v 1.9 2010/04/27 05:57:43 jruoho Exp $       */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -39,53 +39,11 @@
 #define _SYS_DEV_ACPI_ACPIREG_H
 
 /*
- * XXX: Use the native types from <actypes.h>.
- *
- *     Move the device-specific constants to
- *     the device-specific files.
- */
-#define        ACPI_NOTIFY_BusCheck            0x00
-#define        ACPI_NOTIFY_DeviceCheck         0x01
-#define        ACPI_NOTIFY_DeviceWake          0x02
-#define        ACPI_NOTIFY_EjectRequest        0x03
-#define        ACPI_NOTIFY_DeviceCheckLight    0x04
-#define        ACPI_NOTIFY_FrquencyMismatch    0x05
-#define        ACPI_NOTIFY_BusModeMismatch     0x06
-#define        ACPI_NOTIFY_PowerFault          0x07
-                               /*      0x08 - 0x7f     reserved */
-
-/* Control Method Battery Device Notification Types */
-#define        ACPI_NOTIFY_BatteryStatusChanged        0x80
-#define        ACPI_NOTIFY_BatteryInformationChanged   0x81
-
-/* Power Source Object Notification Types */
-#define        ACPI_NOTIFY_PowerSourceStatusChanged    0x80
-
-/* Thermal Zone Object Notication Types */
-#define        ACPI_NOTIFY_ThermalZoneStatusChanged    0x80
-#define        ACPI_NOTIFY_ThermalZoneTripPointsChanged 0x81
-#define        ACPI_NOTIFY_DeviceListsChanged          0x82
-
-/* Control Method Power Button Notification Types */
-#define        ACPI_NOTIFY_S0PowerButtonPressed        0x80
-
-/* Control Method Sleep Button Notification Types */
-#define        ACPI_NOTIFY_S0SleepButtonPressed        0x80
-
-/* Control Method Lid Notification Types */
-#define        ACPI_NOTIFY_LidStatusChanged            0x80
-
-/* Processor Device Notification Values */
-#define        ACPI_NOTIFY_PerformancePresentCapabilitiesChanged 0x80
-#define        ACPI_NOTIFY_CStatesChanged              0x81
-
-/*
  * A common device status mask.
  */
 #define ACPI_STA_OK            (ACPI_STA_DEVICE_PRESENT        |       \
                                 ACPI_STA_DEVICE_ENABLED        |       \
                                 ACPI_STA_DEVICE_FUNCTIONING)
-
 /*
  * PCI functions.
  */



Home | Main Index | Thread Index | Old Index