From 79d33058a7333761d3598b63725418b356edb96e Mon Sep 17 00:00:00 2001 From: remko Date: Wed, 12 Mar 2008 18:23:39 +0000 Subject: Add resume support to the agp_i810 family. Submitted by: "Robert Noland" Reviewed by: anholt Approved by: anholt, imp (mentor) MFC after: 1 week --- sys/dev/agp/agp_i810.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sys/dev/agp') diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index 7014feb..cda1dc3 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -612,6 +612,21 @@ agp_i810_detach(device_t dev) return 0; } +static int +agp_i810_resume(device_t dev) +{ + struct agp_i810_softc *sc; + sc = device_get_softc(dev); + + AGP_SET_APERTURE(dev, sc->initial_aperture); + + /* Install the GATT. */ + bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, + sc->gatt->ag_physical | 1); + + return (bus_generic_resume(dev)); +} + /** * Sets the PCI resource size of the aperture on i830-class and below chipsets, * while returning failure on later chipsets when an actual change is @@ -976,6 +991,8 @@ static device_method_t agp_i810_methods[] = { DEVMETHOD(device_probe, agp_i810_probe), DEVMETHOD(device_attach, agp_i810_attach), DEVMETHOD(device_detach, agp_i810_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, agp_i810_resume), /* AGP interface */ DEVMETHOD(agp_get_aperture, agp_generic_get_aperture), -- cgit v1.1