summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/pfour.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-24 10:16:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-24 10:16:50 +0000
commit2d52ee0dde490079425bf1980fcd8e8d600c2073 (patch)
tree8d1300b445e69ef0267326200c00830745038d2b /sys/arch/sparc/dev/pfour.c
parent978548ddeb7b97fe47229240a9efd7dda0b2a408 (diff)
pfour bwtwo blanking control
Diffstat (limited to 'sys/arch/sparc/dev/pfour.c')
-rw-r--r--sys/arch/sparc/dev/pfour.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/sys/arch/sparc/dev/pfour.c b/sys/arch/sparc/dev/pfour.c
index 78c3ccb722d..48d555b3773 100644
--- a/sys/arch/sparc/dev/pfour.c
+++ b/sys/arch/sparc/dev/pfour.c
@@ -50,10 +50,9 @@
#include <sparc/sparc/vaddrs.h>
#include <sparc/dev/pfourreg.h>
-volatile int *pfour_vaddr; /* pfour register */
-
struct pfour_softc {
struct device sc_dev; /* base device */
+ volatile u_long *sc_vaddr; /* pfour register */
int nothing;
};
@@ -106,7 +105,7 @@ pfourattach(parent, self, args)
return;
}
- pfour_vaddr = mapiodev((caddr_t)(ca->ca_ra.ra_paddr + PFOUR_REG),
+ sc->sc_vaddr = mapiodev((caddr_t)(ca->ca_ra.ra_paddr + PFOUR_REG),
NBPG, ca->ca_bustype);
printf(": cardtype 0x%02x\n", PFOUR_FBTYPE(val));
@@ -140,8 +139,11 @@ pfourattach(parent, self, args)
void
pfour_reset()
{
- *pfour_vaddr = PFOUR_REG_VIDEO | PFOUR_REG_RESET;
- *pfour_vaddr = PFOUR_REG_VIDEO;
+ struct pfour_softc *sc = pfourcd.cd_devs[0];
+
+ *sc->sc_vaddr = PFOUR_REG_VIDEO | PFOUR_REG_RESET;
+ delay(1);
+ *sc->sc_vaddr = PFOUR_REG_VIDEO;
}
int
@@ -187,3 +189,23 @@ pfour_videosize(reg, xp, yp)
}
return (0);
}
+
+void
+pfourenable(on)
+ int on;
+{
+ struct pfour_softc *sc = pfourcd.cd_devs[0];
+
+ if (on)
+ *sc->sc_vaddr |= PFOUR_REG_VIDEO;
+ else
+ *sc->sc_vaddr &= ~PFOUR_REG_VIDEO;
+}
+
+int
+pfourstatus()
+{
+ struct pfour_softc *sc = pfourcd.cd_devs[0];
+
+ return (*sc->sc_vaddr & PFOUR_REG_VIDEO);
+}