summaryrefslogtreecommitdiff
path: root/sys/dev/gpio
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-18 21:47:09 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-18 21:47:09 +0000
commitcda8555cd2832d9efaed207126f42de7e4f1dac5 (patch)
tree4a0225e9ebc60575b5fb98e0eed3f85b4fbdf2f0 /sys/dev/gpio
parent9249b6eba6dc280fabd58a9e18a8e10bf82e72a6 (diff)
Check that SDA pin is able to read input.
Diffstat (limited to 'sys/dev/gpio')
-rw-r--r--sys/dev/gpio/gpioiic.c6
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) {