]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aic7xxx/aic79xx_pci.c
Merge branches 'release', 'acpi_pm_device_sleep_state' and 'battery' into release
[linux-2.6-omap-h63xx.git] / drivers / scsi / aic7xxx / aic79xx_pci.c
index 8d72bbae96ad1a59a3777b662d8e47b640abc0c1..c9f79fdf913105d77046db61619c6432a4123dd6 100644 (file)
@@ -389,6 +389,35 @@ ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry)
        return error;
 }
 
+#ifdef CONFIG_PM
+void
+ahd_pci_suspend(struct ahd_softc *ahd)
+{
+       /*
+        * Save chip register configuration data for chip resets
+        * that occur during runtime and resume events.
+        */
+       ahd->suspend_state.pci_state.devconfig =
+           ahd_pci_read_config(ahd->dev_softc, DEVCONFIG, /*bytes*/4);
+       ahd->suspend_state.pci_state.command =
+           ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/1);
+       ahd->suspend_state.pci_state.csize_lattime =
+           ahd_pci_read_config(ahd->dev_softc, CSIZE_LATTIME, /*bytes*/1);
+
+}
+
+void
+ahd_pci_resume(struct ahd_softc *ahd)
+{
+       ahd_pci_write_config(ahd->dev_softc, DEVCONFIG,
+                            ahd->suspend_state.pci_state.devconfig, /*bytes*/4);
+       ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND,
+                            ahd->suspend_state.pci_state.command, /*bytes*/1);
+       ahd_pci_write_config(ahd->dev_softc, CSIZE_LATTIME,
+                            ahd->suspend_state.pci_state.csize_lattime, /*bytes*/1);
+}
+#endif
+
 /*
  * Perform some simple tests that should catch situations where
  * our registers are invalidly mapped.
@@ -950,7 +979,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
                          |  AHD_FAINT_LED_BUG;
 
                /*
-                * IO Cell paramter setup.
+                * IO Cell parameter setup.
                 */
                AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
 
@@ -966,7 +995,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
                              |  AHD_BUSFREEREV_BUG;
                ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG;
 
-               /* If the user requested the the SLOWCRC bit to be set. */
+               /* If the user requested that the SLOWCRC bit to be set. */
                if (aic79xx_slowcrc)
                        ahd->features |= AHD_AIC79XXB_SLOWCRC;
 
@@ -977,7 +1006,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
                        ahd->bugs |= AHD_INTCOLLISION_BUG|AHD_ABORT_LQI_BUG;
 
                /*
-                * IO Cell paramter setup.
+                * IO Cell parameter setup.
                 */
                AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
                AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB);