From e0bd5229f5ba90565da4b93716a52588a8f37cd7 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 7 Aug 2010 15:48:26 +0000 Subject: [PATCH] upon resume, notify all the acpiac and acpibat drivers to update their status. some laptops do not do this automatically. ok kettenis canacar --- sys/dev/acpi/acpi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index a90f2f81106..a14c2c0e359 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.205 2010/08/06 21:12:27 marco Exp $ */ +/* $OpenBSD: acpi.c,v 1.206 2010/08/07 15:48:26 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -2092,10 +2092,21 @@ acpi_thread(void *arg) } if (sc->sc_sleepmode) { + struct acpi_ac *ac; + struct acpi_bat *bat; int sleepmode = sc->sc_sleepmode; sc->sc_sleepmode = 0; acpi_sleep_state(sc, sleepmode); + + /* AC and battery information needs refreshing */ + SLIST_FOREACH(ac, &sc->sc_ac, aac_link) + aml_notify(ac->aac_softc->sc_devnode, + 0x80); + SLIST_FOREACH(bat, &sc->sc_bat, aba_link) + aml_notify(bat->aba_softc->sc_devnode, + 0x80); + continue; } } -- 2.20.1