summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-02-12 06:42:27 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-02-12 06:42:27 +0000
commitde1f5fb538c0d9aede1f8b74e8e3033d81cc8eb8 (patch)
tree0bbe2912d64799ce7f95701f1c49e10540d548d7 /sys/arch/hppa/dev
parent8d8c991cf0d879846a6732ca48f7952c9bd0a879 (diff)
support 712's programmable power switch, no interrupt yet
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r--sys/arch/hppa/dev/lasi.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/sys/arch/hppa/dev/lasi.c b/sys/arch/hppa/dev/lasi.c
index 8c3ed56d7e3..e42a7ce7438 100644
--- a/sys/arch/hppa/dev/lasi.c
+++ b/sys/arch/hppa/dev/lasi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lasi.c,v 1.6 2002/02/05 06:50:23 mickey Exp $ */
+/* $OpenBSD: lasi.c,v 1.7 2002/02/12 06:42:26 mickey Exp $ */
/*
* Copyright (c) 1998-2002 Michael Shalayeff
@@ -47,6 +47,8 @@
struct lasi_hwr {
u_int32_t lasi_power;
+#define LASI_BLINK 0x01
+#define LASI_ON 0x02
u_int32_t lasi_error;
u_int32_t lasi_version;
u_int32_t lasi_reset;
@@ -86,6 +88,7 @@ void lasi_intr_establish __P((void *v, u_int32_t mask));
void lasi_intr_disestablish __P((void *v, u_int32_t mask));
u_int32_t lasi_intr_check __P((void *v));
void lasi_intr_ack __P((void *v, u_int32_t mask));
+void lasi_cold_hook __P((int on));
int
@@ -150,8 +153,12 @@ lasiattach(parent, self, aux)
sc->ga.ga_ca = *ca; /* clone from us */
if (sc->sc_dev.dv_unit)
config_defer(self, lasi_gsc_attach);
- else
+ else {
+ extern void (*cold_hook) __P((int));
+
lasi_gsc_attach(self);
+ cold_hook = lasi_cold_hook;
+ }
}
void
@@ -166,6 +173,28 @@ lasi_gsc_attach(self)
}
void
+lasi_cold_hook(on)
+ int on;
+{
+ register struct lasi_softc *sc = lasi_cd.cd_devs[0];
+
+ if (!sc)
+ return;
+
+ switch (on) {
+ case HPPA_COLD_COLD:
+ sc->sc_hw->lasi_power = LASI_BLINK;
+ break;
+ case HPPA_COLD_HOT:
+ sc->sc_hw->lasi_power = 0;
+ break;
+ case HPPA_COLD_OFF:
+ sc->sc_hw->lasi_power = LASI_BLINK;
+ break;
+ }
+}
+
+void
lasi_intr_establish(v, mask)
void *v;
u_int32_t mask;