Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/gpio make implementation match gpio(4) man entry. do...
details: https://anonhg.NetBSD.org/src/rev/6078c4c288e1
branches: trunk
changeset: 330215:6078c4c288e1
user: kardel <kardel%NetBSD.org@localhost>
date: Sun Jun 29 09:32:24 2014 +0000
description:
make implementation match gpio(4) man entry. do no change configuration
if no flags are being set (allows non-destructive inquiry via GPIOSET again).
diffstat:
sys/dev/gpio/gpio.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r 6a567a87d1d4 -r 6078c4c288e1 sys/dev/gpio/gpio.c
--- a/sys/dev/gpio/gpio.c Sun Jun 29 09:27:58 2014 +0000
+++ b/sys/dev/gpio/gpio.c Sun Jun 29 09:32:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.55 2014/05/23 13:57:04 msaitoh Exp $ */
+/* $NetBSD: gpio.c,v 1.56 2014/06/29 09:32:24 kardel Exp $ */
/* $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */
/*
@@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.55 2014/05/23 13:57:04 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.56 2014/06/29 09:32:24 kardel Exp $");
/*
* General Purpose Input/Output framework.
@@ -699,12 +699,14 @@
/* check that the controller supports all requested flags */
if ((flags & sc->sc_pins[pin].pin_caps) != flags)
return ENODEV;
- flags = set->gp_flags | GPIO_PIN_SET;
+ flags = set->gp_flags;
set->gp_caps = sc->sc_pins[pin].pin_caps;
/* return old value */
set->gp_flags = sc->sc_pins[pin].pin_flags;
+
if (flags > 0) {
+ flags |= GPIO_PIN_SET;
gpiobus_pin_ctl(gc, pin, flags);
/* update current value */
sc->sc_pins[pin].pin_flags = flags;
Home |
Main Index |
Thread Index |
Old Index