diff options
| author | 2006-01-18 21:47:08 +0000 | |
|---|---|---|
| committer | 2006-01-18 21:47:08 +0000 | |
| commit | 1e79c56e46d034531aeadb81fbb6e33a609e2293 (patch) | |
| tree | 5d62d71c63a7be934767a6fcc1cd301f649845c4 | |
| parent | initial Tx/Rx bits. not working yet. (diff) | |
| download | wireguard-openbsd-1e79c56e46d034531aeadb81fbb6e33a609e2293.tar.xz wireguard-openbsd-1e79c56e46d034531aeadb81fbb6e33a609e2293.zip | |
Check that SDA pin is able to read input.
| -rw-r--r-- | sys/dev/gpio/gpioiic.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/gpio/gpioiic.c b/sys/dev/gpio/gpioiic.c index 955f66d05b9..080fe6ea662 100644 --- a/sys/dev/gpio/gpioiic.c +++ b/sys/dev/gpio/gpioiic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpioiic.c,v 1.4 2006/01/17 22:57:47 grange Exp $ */ +/* $OpenBSD: gpioiic.c,v 1.5 2006/01/18 21:47:08 grange Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org> @@ -122,6 +122,10 @@ gpioiic_attach(struct device *parent, struct device *self, void *aux) printf(": SDA pin is unable to drive output\n"); goto fail; } + if (!(caps & GPIO_PIN_INPUT)) { + printf(": SDA pin is unable to read input\n"); + goto fail; + } printf(": SDA[%d]", sc->sc_map.pm_map[GPIOIIC_PIN_SDA]); sc->sc_sda = GPIO_PIN_OUTPUT; if (caps & GPIO_PIN_OPENDRAIN) { |
