Author: ganbold (doc committer)
Date: Tue Feb 19 02:01:35 2013
New Revision: 246955
URL: http://svnweb.freebsd.org/changeset/base/246955

Log:
  Define gpio constants rather than using enum.
  Fix pull-up and pull-down values of gpio.
  According to A10 user manual possible pull register
  values are 00 Pull-up/down disable, 01 Pull-up, 10 Pull-down.
  
  Approved by: gonzo@

Modified:
  head/sys/arm/allwinner/a10_gpio.c

Modified: head/sys/arm/allwinner/a10_gpio.c
==============================================================================
--- head/sys/arm/allwinner/a10_gpio.c   Mon Feb 18 23:58:05 2013        
(r246954)
+++ head/sys/arm/allwinner/a10_gpio.c   Tue Feb 19 02:01:35 2013        
(r246955)
@@ -66,6 +66,13 @@ __FBSDID("$FreeBSD$");
 #define        A10_GPIO_DEFAULT_CAPS   (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT |     
\
     GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN)
 
+#define A10_GPIO_NONE          0
+#define A10_GPIO_PULLUP                1
+#define A10_GPIO_PULLDOWN      2
+
+#define A10_GPIO_INPUT         0
+#define A10_GPIO_OUTPUT                1
+
 struct a10_gpio_softc {
        device_t                sc_dev;
        struct mtx              sc_mtx;
@@ -78,17 +85,6 @@ struct a10_gpio_softc {
        struct gpio_pin         sc_gpio_pins[A10_GPIO_PINS];
 };
 
-enum a10_gpio_fsel {
-       A10_GPIO_INPUT,
-       A10_GPIO_OUTPUT,
-};
-
-enum a10_gpio_pud {
-       A10_GPIO_NONE,
-       A10_GPIO_PULLDOWN,
-       A10_GPIO_PULLUP,
-};
-
 #define        A10_GPIO_LOCK(_sc)              mtx_lock(&_sc->sc_mtx)
 #define        A10_GPIO_UNLOCK(_sc)            mtx_unlock(&_sc->sc_mtx)
 #define        A10_GPIO_LOCK_ASSERT(_sc)       mtx_assert(&_sc->sc_mtx, 
MA_OWNED)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to