suspend save/restore for SIS3112; tested by mlarkin
authorderaadt <deraadt@openbsd.org>
Wed, 28 Jul 2010 15:50:19 +0000 (15:50 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 28 Jul 2010 15:50:19 +0000 (15:50 +0000)
sys/dev/pci/pciide.c

index 9d40cb2..0393508 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pciide.c,v 1.311 2010/07/23 07:47:13 jsg Exp $        */
+/*     $OpenBSD: pciide.c,v 1.312 2010/07/28 15:50:19 deraadt Exp $    */
 /*     $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $     */
 
 /*
@@ -1426,6 +1426,11 @@ pciide_activate(struct device *self, int act)
                            sc->sc_tag, ICH5_SATA_PI);
                        sc->sc_save2[2] = pciide_pci_read(sc->sc_pc,
                            sc->sc_tag, ICH_SATA_PCS);
+               } else if (sc->sc_pp->chip_map == sii3112_chip_map) {
+                       sc->sc_save[0] = pci_conf_read(sc->sc_pc,
+                           sc->sc_tag, SII3112_SCS_CMD);
+                       sc->sc_save[1] = pci_conf_read(sc->sc_pc,
+                           sc->sc_tag, SII3112_PCI_CFGCTL);
                }
                break;
        case DVACT_RESUME:
@@ -1452,6 +1457,13 @@ pciide_activate(struct device *self, int act)
                        /* nothing more to restore */
                } else if (sc->sc_pp->chip_map == ixp_chip_map) {
                        /* nothing to restore (0x40 - 0x56) */
+               } else if (sc->sc_pp->chip_map == sii3112_chip_map) {
+                       pci_conf_write(sc->sc_pc, sc->sc_tag,
+                           SII3112_SCS_CMD, sc->sc_save[0]);
+                       delay(50 * 1000);
+                       pci_conf_write(sc->sc_pc, sc->sc_tag,
+                           SII3112_PCI_CFGCTL, sc->sc_save[1]);
+                       delay(50 * 1000);
                } else {
                        printf("%s: restore for unknown chip map %x\n",
                            sc->sc_wdcdev.sc_dev.dv_xname,