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
This commit is contained in:
parent
6586253a61
commit
b0e7e61135
@ -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;
|
||||
acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
|
||||
if (acpi_sc == NULL)
|
||||
goto out;
|
||||
|
||||
/* If this is the initialization pass, skip the notification. */
|
||||
if (old_status == -1)
|
||||
goto out;
|
||||
ACPI_VPRINT(sc->lid_dev, acpi_sc, "Lid %s\n",
|
||||
sc->lid_status ? "opened" : "closed");
|
||||
|
||||
/* 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_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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user