diff options
author | 2006-01-05 15:32:46 +0000 | |
---|---|---|
committer | 2006-01-05 15:32:46 +0000 | |
commit | e7398ebe0b784879305916dddb79ffe3b7bea70c (patch) | |
tree | 51dffe26a21e94ec56f4f58ec28f4b61f159b13c | |
parent | I got the time scale wrong with the previous commit. Now the advertised (diff) | |
download | wireguard-openbsd-e7398ebe0b784879305916dddb79ffe3b7bea70c.tar.xz wireguard-openbsd-e7398ebe0b784879305916dddb79ffe3b7bea70c.zip |
Don't change pins state on attach.
-rw-r--r-- | sys/arch/i386/pci/gscpcib.c | 10 | ||||
-rw-r--r-- | sys/dev/isa/nsclpcsio_isa.c | 10 |
2 files changed, 8 insertions, 12 deletions
diff --git a/sys/arch/i386/pci/gscpcib.c b/sys/arch/i386/pci/gscpcib.c index 2d33423c6f2..23816855dd5 100644 --- a/sys/arch/i386/pci/gscpcib.c +++ b/sys/arch/i386/pci/gscpcib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gscpcib.c,v 1.3 2004/10/05 19:02:33 grange Exp $ */ +/* $OpenBSD: gscpcib.c,v 1.4 2006/01/05 15:32:46 grange Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -111,11 +111,9 @@ gscpcib_attach(struct device *parent, struct device *self, void *aux) GPIO_PIN_PUSHPULL | GPIO_PIN_TRISTATE | GPIO_PIN_PULLUP; - /* safe defaults */ - sc->sc_gpio_pins[i].pin_flags = GPIO_PIN_TRISTATE; - sc->sc_gpio_pins[i].pin_state = GPIO_PIN_LOW; - gscpcib_gpio_pin_ctl(sc, i, sc->sc_gpio_pins[i].pin_flags); - gscpcib_gpio_pin_write(sc, i, sc->sc_gpio_pins[i].pin_state); + /* Read initial state */ + sc->sc_gpio_pins[i].pin_state = gscpcib_gpio_pin_read(sc, i) ? + GPIO_PIN_HIGH : GPIO_PIN_LOW; } /* Create controller tag */ diff --git a/sys/dev/isa/nsclpcsio_isa.c b/sys/dev/isa/nsclpcsio_isa.c index 4fcf0519223..13fbf064cae 100644 --- a/sys/dev/isa/nsclpcsio_isa.c +++ b/sys/dev/isa/nsclpcsio_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsclpcsio_isa.c,v 1.5 2004/11/17 16:53:05 mickey Exp $ */ +/* $OpenBSD: nsclpcsio_isa.c,v 1.6 2006/01/05 15:32:46 grange Exp $ */ /* $NetBSD: nsclpcsio_isa.c,v 1.5 2002/10/22 16:18:26 drochner Exp $ */ /* @@ -520,11 +520,9 @@ nsclpcsio_gpio_init(struct nsclpcsio_softc *sc) GPIO_PIN_PUSHPULL | GPIO_PIN_TRISTATE | GPIO_PIN_PULLUP; - /* safe defaults */ - sc->sc_gpio_pins[i].pin_flags = GPIO_PIN_TRISTATE; - sc->sc_gpio_pins[i].pin_state = GPIO_PIN_LOW; - nsclpcsio_gpio_pin_ctl(sc, i, sc->sc_gpio_pins[i].pin_flags); - nsclpcsio_gpio_pin_write(sc, i, sc->sc_gpio_pins[i].pin_state); + /* Read initial state */ + sc->sc_gpio_pins[i].pin_state = nsclpcsio_gpio_pin_read(sc, + i) ? GPIO_PIN_HIGH : GPIO_PIN_LOW; } /* Create controller tag */ |