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.
This commit is contained in:
sato 2000-10-17 11:37:20 +00:00
parent 8130f0ec5d
commit d9781d7eb9
2 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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");
}