summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-14 12:33:50 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-14 12:33:50 +0000
commite16b2d8bff470be957d02471a8a2bc856d817a08 (patch)
tree4e8f65115d631bb21a17e100f4c291f640dabe6f /sys/dev
parent02a40773fc70b6a89a81f3f476dfe2fcf7bab598 (diff)
Add gpio_pin_caps() method to provide pin capabilities.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/gpio/gpio.c10
-rw-r--r--sys/dev/gpio/gpiovar.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/gpio/gpio.c b/sys/dev/gpio/gpio.c
index d28c5c9dcee..640b741a797 100644
--- a/sys/dev/gpio/gpio.c
+++ b/sys/dev/gpio/gpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpio.c,v 1.5 2006/01/05 11:52:24 grange Exp $ */
+/* $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */
/*
* Copyright (c) 2004, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -208,6 +208,14 @@ gpio_pin_ctl(void *gpio, struct gpio_pinmap *map, int pin, int flags)
}
int
+gpio_pin_caps(void *gpio, struct gpio_pinmap *map, int pin)
+{
+ struct gpio_softc *sc = gpio;
+
+ return (sc->sc_pins[map->pm_map[pin]].pin_caps);
+}
+
+int
gpio_npins(u_int32_t mask)
{
int npins, i;
diff --git a/sys/dev/gpio/gpiovar.h b/sys/dev/gpio/gpiovar.h
index 7c700088ac5..e8568fe4464 100644
--- a/sys/dev/gpio/gpiovar.h
+++ b/sys/dev/gpio/gpiovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpiovar.h,v 1.2 2006/01/05 11:52:24 grange Exp $ */
+/* $OpenBSD: gpiovar.h,v 1.3 2006/01/14 12:33:49 grange Exp $ */
/*
* Copyright (c) 2004, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -73,6 +73,7 @@ void gpio_pin_unmap(void *, struct gpio_pinmap *);
int gpio_pin_read(void *, struct gpio_pinmap *, int);
void gpio_pin_write(void *, struct gpio_pinmap *, int, int);
void gpio_pin_ctl(void *, struct gpio_pinmap *, int, int);
+int gpio_pin_caps(void *, struct gpio_pinmap *, int);
int gpio_npins(u_int32_t);