summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-08-25 20:09:15 +0000
committernjl <njl@FreeBSD.org>2004-08-25 20:09:15 +0000
commit39d813bc6fc046769e8fe54ce21f9d1e1bddd663 (patch)
tree5e5e5a04ab045ab5e4e88a58cd902cc5b5057ece /sys/dev/acpica
parent3b8f16badac04207a5a6dbe2f82cbe609dc5515b (diff)
downloadFreeBSD-src-39d813bc6fc046769e8fe54ce21f9d1e1bddd663.zip
FreeBSD-src-39d813bc6fc046769e8fe54ce21f9d1e1bddd663.tar.gz
Remove code to initialize the lid state at boot. It interfered with lid
operation for some users with pure GPE lid switches (vs. embedded controller.) Tested by: Anish Mistry <mistry.7_at_osu.edu> MFC after: 3 days
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_lid.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/sys/dev/acpica/acpi_lid.c b/sys/dev/acpica/acpi_lid.c
index 324d1c7..50421c6 100644
--- a/sys/dev/acpica/acpi_lid.c
+++ b/sys/dev/acpica/acpi_lid.c
@@ -103,7 +103,6 @@ acpi_lid_attach(device_t dev)
sc = device_get_softc(dev);
sc->lid_dev = dev;
sc->lid_handle = acpi_get_handle(dev);
- sc->lid_status = -1;
/*
* If a system does not get lid events, it may make sense to change
@@ -117,10 +116,6 @@ acpi_lid_attach(device_t dev)
acpi_wake_init(dev, ACPI_GPE_TYPE_WAKE_RUN);
acpi_wake_set_enable(dev, 1);
- /* Attempt to get the initial lid switch state. */
- AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_lid_notify_status_changed,
- sc);
-
return (0);
}
@@ -142,42 +137,34 @@ acpi_lid_notify_status_changed(void *arg)
struct acpi_lid_softc *sc;
struct acpi_softc *acpi_sc;
ACPI_STATUS status;
- int lid_status, old_status;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
sc = (struct acpi_lid_softc *)arg;
+ ACPI_SERIAL_BEGIN(lid);
/*
* Evaluate _LID and check the return value, update lid status.
* Zero: The lid is closed
* Non-zero: The lid is open
*/
- status = acpi_GetInteger(sc->lid_handle, "_LID", &lid_status);
+ status = acpi_GetInteger(sc->lid_handle, "_LID", &sc->lid_status);
if (ACPI_FAILURE(status))
- return_VOID;
+ goto out;
- ACPI_SERIAL_BEGIN(lid);
- if (lid_status != sc->lid_status) {
- old_status = sc->lid_status;
- sc->lid_status = lid_status;
-
- /* If this is the initialization pass, skip the notification. */
- if (old_status == -1)
- goto out;
-
- /* Since the status has changed, notify the system. */
- acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
- if (acpi_sc == NULL)
- goto out;
- ACPI_VPRINT(sc->lid_dev, acpi_sc, "Lid %s\n",
- lid_status ? "opened" : "closed");
- acpi_UserNotify("Lid", sc->lid_handle, lid_status);
- if (lid_status == 0)
- EVENTHANDLER_INVOKE(acpi_sleep_event, acpi_sc->acpi_lid_switch_sx);
- else
- EVENTHANDLER_INVOKE(acpi_wakeup_event, acpi_sc->acpi_lid_switch_sx);
- }
+ acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
+ if (acpi_sc == NULL)
+ goto out;
+
+ ACPI_VPRINT(sc->lid_dev, acpi_sc, "Lid %s\n",
+ sc->lid_status ? "opened" : "closed");
+
+ acpi_UserNotify("Lid", sc->lid_handle, sc->lid_status);
+
+ if (sc->lid_status == 0)
+ EVENTHANDLER_INVOKE(acpi_sleep_event, acpi_sc->acpi_lid_switch_sx);
+ else
+ EVENTHANDLER_INVOKE(acpi_wakeup_event, acpi_sc->acpi_lid_switch_sx);
out:
ACPI_SERIAL_END(lid);
OpenPOWER on IntegriCloud