diff options
author | njl <njl@FreeBSD.org> | 2007-03-28 22:28:48 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2007-03-28 22:28:48 +0000 |
commit | 2be51a36eec133e5f36bc7c68fadc3479347a2b2 (patch) | |
tree | 7e5cc970a11901b77881a7f80902013d9bfc6e77 | |
parent | 66f5e5f2926263a961d5034c5e2aca9aabea3ac9 (diff) | |
download | FreeBSD-src-2be51a36eec133e5f36bc7c68fadc3479347a2b2.zip FreeBSD-src-2be51a36eec133e5f36bc7c68fadc3479347a2b2.tar.gz |
Re-enable the HPET timer after a resume.
Submitted by: Andrea Bittau <a.bittau@cs.ucl.ac.uk>
MFC after: 3 days
-rw-r--r-- | sys/dev/acpica/acpi_hpet.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_hpet.c b/sys/dev/acpica/acpi_hpet.c index 8bfcffc..244f79b 100644 --- a/sys/dev/acpica/acpi_hpet.c +++ b/sys/dev/acpica/acpi_hpet.c @@ -154,6 +154,18 @@ acpi_hpet_detach(device_t dev) return (EBUSY); } +static int +acpi_hpet_resume(device_t dev) +{ + struct acpi_hpet_softc *sc; + + /* Re-enable the timer after a resume to keep the clock advancing. */ + sc = device_get_softc(dev); + bus_write_4(sc->mem_res, HPET_OFFSET_ENABLE, 1); + + return (0); +} + /* Print some basic latency/rate information to assist in debugging. */ static void acpi_hpet_test(struct acpi_hpet_softc *sc) @@ -188,6 +200,7 @@ static device_method_t acpi_hpet_methods[] = { DEVMETHOD(device_probe, acpi_hpet_probe), DEVMETHOD(device_attach, acpi_hpet_attach), DEVMETHOD(device_detach, acpi_hpet_detach), + DEVMETHOD(device_resume, acpi_hpet_resume), {0, 0} }; |