From d9781d7eb9fcb0ab6c2b086707b9f2ca2bbf6fbc Mon Sep 17 00:00:00 2001 From: sato Date: Tue, 17 Oct 2000 11:37:20 +0000 Subject: [PATCH] add new keyword "initvalue" on pwctl device. if "initvalue 0", set the port initialy "off". if "initvalue 1", set the port initialy "on". otherwise keep initial value. --- sys/arch/hpcmips/conf/files.hpcmips | 4 ++-- sys/arch/hpcmips/vr/pwctl_vrgiu.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/arch/hpcmips/conf/files.hpcmips b/sys/arch/hpcmips/conf/files.hpcmips index 8154f14c7a03..fdb44ecb4ddc 100644 --- a/sys/arch/hpcmips/conf/files.hpcmips +++ b/sys/arch/hpcmips/conf/files.hpcmips @@ -1,4 +1,4 @@ -# $NetBSD: files.hpcmips,v 1.40 2000/10/04 13:53:54 uch Exp $ +# $NetBSD: files.hpcmips,v 1.41 2000/10/17 11:37:23 sato Exp $ # maxpartitions must be first item in files.${ARCH}. maxpartitions 8 @@ -136,7 +136,7 @@ file arch/hpcmips/vr/cmu.c vrcmu needs-flag device vrisabif {[platform = -1], [isaportoffset=0], [isamemoffset=0]} # GIU attachment device gpbusif {[platform = -1], [comctrl = -1], [button0 = -1], [button1 = -1], [button2 = -1], [button3 = -1], [button4 = -1], [button5 = -1], [button6 = -1], [button7 = -1], [button8 = -1], [button9 = -1], [button10 = -1], [button11 = -1]} -device newgpbusif { [platform = -1], [id = -1], [port = -1], [active = 1], [level = -1] } +device newgpbusif { [platform = -1], [id = -1], [port = -1], [active = 1], [level = -1], [initvalue = -1] } device vrgiu: vrisabif, gpbusif, newgpbusif attach vrgiu at vrip diff --git a/sys/arch/hpcmips/vr/pwctl_vrgiu.c b/sys/arch/hpcmips/vr/pwctl_vrgiu.c index 70e36f50a75e..c786e748596b 100644 --- a/sys/arch/hpcmips/vr/pwctl_vrgiu.c +++ b/sys/arch/hpcmips/vr/pwctl_vrgiu.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwctl_vrgiu.c,v 1.4 2000/09/10 15:30:32 sato Exp $ */ +/* $NetBSD: pwctl_vrgiu.c,v 1.5 2000/10/17 11:37:20 sato Exp $ */ /*- * Copyright (c) 1999 @@ -70,6 +70,7 @@ struct pwctl_vrgiu_softc { config_hook_tag sc_hook_tag; config_hook_tag sc_hook_hardpower; int sc_save; + int sc_initvalue; }; static int pwctl_vrgiu_match __P((struct device *, struct cfdata *, @@ -121,7 +122,11 @@ pwctl_vrgiu_attach(parent, self, aux) sc->sc_id = loc[NEWGPBUSIFCF_ID]; sc->sc_on = loc[NEWGPBUSIFCF_ACTIVE] ? 1 : 0; sc->sc_off = loc[NEWGPBUSIFCF_ACTIVE] ? 0 : 1; - printf(" port=%d id=%ld on=%d", sc->sc_port, sc->sc_id, sc->sc_on); + sc->sc_initvalue = loc[NEWGPBUSIFCF_INITVALUE]; + printf(" port=%d id=%ld on=%d%s", + sc->sc_port, sc->sc_id, sc->sc_on, + sc->sc_initvalue == -1 ? "" : + sc->sc_initvalue ? " init=on" : " init=off"); if (sc->sc_port == NEWGPBUSIFCF_PORT_DEFAULT || sc->sc_id == NEWGPBUSIFCF_ID_DEFAULT) { @@ -136,6 +141,9 @@ pwctl_vrgiu_attach(parent, self, aux) pwctl_vrgiu_hardpower, sc); } + if (sc->sc_initvalue != -1) + sc->sc_gf->gf_portwrite(sc->sc_gc, sc->sc_port, + sc->sc_initvalue ? sc->sc_on : sc->sc_off); printf("\n"); }