[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Sat Jan 21 22:36:09 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/8c31edde67e0
changeset: 289:8c31edde67e0
user:      ray at terran.dlink.ua
date:      Sun Jan 22 00:32:48 2012 +0200
description:
Update gpio to current GPIO framework state.

diffstat:

 head/sys/mips/cavium/octeon_gpio.c |  23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diffs (56 lines):

diff -r 4dd7771967e0 -r 8c31edde67e0 head/sys/mips/cavium/octeon_gpio.c
--- a/head/sys/mips/cavium/octeon_gpio.c	Sun Jan 22 00:24:11 2012 +0200
+++ b/head/sys/mips/cavium/octeon_gpio.c	Sun Jan 22 00:32:48 2012 +0200
@@ -63,15 +63,6 @@
 };
 
 /*
- * on CAP100 GPIO 7 is "Factory defaults" button
- *
- */
-static struct octeon_gpio_pin octeon_gpio_pins[] = {
-	{ "F/D", 7,  GPIO_PIN_INPUT},
-	{ NULL, 0, 0},
-};
-
-/*
  * Helpers
  */
 static void octeon_gpio_pin_configure(struct octeon_gpio_softc *sc, 
@@ -375,7 +366,6 @@
 octeon_gpio_attach(device_t dev)
 {
 	struct octeon_gpio_softc *sc = device_get_softc(dev);
-	struct octeon_gpio_pin *pinp;
 	cvmx_gpio_bit_cfgx_t gpio_cfgx;
 	
 	int i;
@@ -408,16 +398,12 @@
 	sc->dev = dev;
 	/* Configure all pins as input */
 	/* disable interrupts for all pins */
-	pinp = octeon_gpio_pins;
-	i = 0;
-	while (pinp->name) {
-		strncpy(sc->gpio_pins[i].gp_name, pinp->name, GPIOMAXNAME);
-		sc->gpio_pins[i].gp_pin = pinp->pin;
+	for (i = 0; i < OCTEON_GPIO_PINS; i++) {
+		sprintf(sc->gpio_pins[i].gp_name, "pin%d", i);
+		sc->gpio_pins[i].gp_pin = i;
 		sc->gpio_pins[i].gp_caps = DEFAULT_CAPS;
 		sc->gpio_pins[i].gp_flags = 0;
-		octeon_gpio_pin_configure(sc, &sc->gpio_pins[i], pinp->flags);
-		pinp++;
-		i++;
+		octeon_gpio_pin_configure(sc, &sc->gpio_pins[i], 0);
 	}
 
 	sc->gpio_npins = i;
@@ -442,7 +428,6 @@
 		}
 	}
 
-	device_add_child(dev, "gpioc", device_get_unit(dev));
 	device_add_child(dev, "gpiobus", device_get_unit(dev));
 	return (bus_generic_attach(dev));
 }


More information about the Zrouter-src-freebsd mailing list