summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/man/man4/gpio.46
-rw-r--r--sys/sys/gpio.h4
-rw-r--r--usr.sbin/gpioctl/gpioctl.86
-rw-r--r--usr.sbin/gpioctl/gpioctl.c4
4 files changed, 16 insertions, 4 deletions
diff --git a/share/man/man4/gpio.4 b/share/man/man4/gpio.4
index f7be8c07d4d..7811f68da89 100644
--- a/share/man/man4/gpio.4
+++ b/share/man/man4/gpio.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gpio.4,v 1.10 2007/11/17 10:10:26 mbalmer Exp $
+.\" $OpenBSD: gpio.4,v 1.11 2007/11/17 16:55:05 mbalmer Exp $
.\"
.\" Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
.\"
@@ -135,6 +135,10 @@ output disabled
internal pull-up enabled
.It Dv GPIO_PIN_PULLDOWN
internal pull-down enabled
+.It Dv GPIO_PIN_INVIN
+invert input
+.It Dv GPIO_PIN_INVOUT
+invert output
.El
.Pp
Note that the
diff --git a/sys/sys/gpio.h b/sys/sys/gpio.h
index 1024a4940dc..ce40a149961 100644
--- a/sys/sys/gpio.h
+++ b/sys/sys/gpio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpio.h,v 1.2 2007/11/17 09:05:23 mbalmer Exp $ */
+/* $OpenBSD: gpio.h,v 1.3 2007/11/17 16:55:05 mbalmer Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -31,6 +31,8 @@
#define GPIO_PIN_TRISTATE 0x0020 /* output disabled */
#define GPIO_PIN_PULLUP 0x0040 /* internal pull-up enabled */
#define GPIO_PIN_PULLDOWN 0x0080 /* internal pull-down enabled */
+#define GPIO_PIN_INVIN 0x0100 /* invert input */
+#define GPIO_PIN_INVOUT 0x0200 /* invert output */
/* GPIO controller description */
struct gpio_info {
diff --git a/usr.sbin/gpioctl/gpioctl.8 b/usr.sbin/gpioctl/gpioctl.8
index 118e4c79d6d..193e1e7bc6c 100644
--- a/usr.sbin/gpioctl/gpioctl.8
+++ b/usr.sbin/gpioctl/gpioctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gpioctl.8,v 1.11 2007/11/17 10:19:20 jmc Exp $
+.\" $OpenBSD: gpioctl.8,v 1.12 2007/11/17 16:55:05 mbalmer Exp $
.\"
.\" Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
.\"
@@ -102,6 +102,10 @@ tri-state (output disabled)
internal pull-up enabled
.It pd
internal pull-down enabled
+.It iin
+invert input
+.It iout
+invert output
.El
.Pp
Note that not all the flags can be supported by the particular
diff --git a/usr.sbin/gpioctl/gpioctl.c b/usr.sbin/gpioctl/gpioctl.c
index 2ac2d330e17..3b92c6f3f51 100644
--- a/usr.sbin/gpioctl/gpioctl.c
+++ b/usr.sbin/gpioctl/gpioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpioctl.c,v 1.6 2007/11/17 09:05:23 mbalmer Exp $ */
+/* $OpenBSD: gpioctl.c,v 1.7 2007/11/17 16:55:05 mbalmer Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -56,6 +56,8 @@ const struct bitstr {
{ GPIO_PIN_TRISTATE, "tri" },
{ GPIO_PIN_PULLUP, "pu" },
{ GPIO_PIN_PULLDOWN, "pd" },
+ { GPIO_PIN_INVIN, "iin" },
+ { GPIO_PIN_INVOUT, "iout" },
{ 0, NULL },
};