diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-09-30 10:35:43 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-09-30 10:35:43 +0000 |
commit | c2b12403de593768483bd8ac4e8bd13102e42359 (patch) | |
tree | d453d610850c12cfb45d1e0ace43b0315ed30a07 /sys/dev/usb/uow.c | |
parent | c7884bf71ffd680acf030288ddc66841c5a019b8 (diff) |
Reset device on attach.
Diffstat (limited to 'sys/dev/usb/uow.c')
-rw-r--r-- | sys/dev/usb/uow.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c index 1d287ab7dff..f82ebb1a41d 100644 --- a/sys/dev/usb/uow.c +++ b/sys/dev/usb/uow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uow.c,v 1.8 2006/09/30 10:26:17 grange Exp $ */ +/* $OpenBSD: uow.c,v 1.9 2006/09/30 10:35:42 grange Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org> @@ -81,6 +81,7 @@ Static int uow_cmd(struct uow_softc *, int, int, int); Static void uow_intr(usbd_xfer_handle, usbd_private_handle, usbd_status); Static int uow_read(struct uow_softc *, void *, int); Static int uow_write(struct uow_softc *, const void *, int); +Static int uow_reset(struct uow_softc *); USB_MATCH(uow) { @@ -188,6 +189,9 @@ USB_ATTACH(uow) memset(sc->sc_fifo, 0xff, sizeof(sc->sc_fifo)); + /* Reset device */ + uow_reset(sc); + /* Attach 1-Wire bus */ sc->sc_ow_bus.bus_cookie = sc; sc->sc_ow_bus.bus_reset = uow_ow_reset; @@ -430,3 +434,9 @@ uow_write(struct uow_softc *sc, const void *buf, int len) return (0); } + +Static int +uow_reset(struct uow_softc *sc) +{ + return (uow_ctlcmd(sc, DS2490_CTL_RESET_DEVICE, 0)); +} |