Date: Tue, 27 Mar 2007 13:10:10 +0100 From: Andrea Bittau <a.bittau@cs.ucl.ac.uk> To: freebsd-acpi@freebsd.org Cc: phk@freebsd.org Subject: add resume support for hpet Message-ID: <20070327121010.GA1697@shorty.sorbonet.org>
next in thread | raw e-mail | index | archive | help
When resuming, the timer needs to be reactivated. Some boxes use hpet for their time of day and if hpet doesn't resume, the time of day never changes, screwing up the whole box. I'm not sure if this is the correct way to do thing [do you need re-calibration?] but it seems to work for me. --- Index: acpi_hpet.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_hpet.c,v retrieving revision 1.5 diff -u -p -r1.5 acpi_hpet.c --- acpi_hpet.c 11 Aug 2006 17:12:16 -0000 1.5 +++ acpi_hpet.c 27 Mar 2007 12:06:07 -0000 @@ -154,6 +154,17 @@ acpi_hpet_detach(device_t dev) return (EBUSY); } +static int +acpi_hpet_resume(device_t dev) +{ + struct acpi_hpet_softc *sc; + + 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 +199,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} };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070327121010.GA1697>