Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/allwinner Print the port name when gpio(4) atta...



details:   https://anonhg.NetBSD.org/src/rev/c810358e48df
branches:  trunk
changeset: 340796:c810358e48df
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Oct 02 14:06:02 2015 +0000

description:
Print the port name when gpio(4) attaches, makes it much easier to find
what port is connected to what gpio instance:
gpio0 at awingpio0: 18 pins
gpio0: port B
gpio1 at awingpio0: 25 pins
gpio1: port C
gpio2 at awingpio0: 28 pins
gpio2: port D
gpio3 at awingpio0: 12 pins
gpio3: port E
gpio4 at awingpio0: 12 pins
gpio4: port G
gpio5 at awingpio0: 28 pins
gpio5: port H
gpio6 at awingpio0: 22 pins
gpio6: port I

diffstat:

 sys/arch/arm/allwinner/awin_gpio.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r f827cfad274e -r c810358e48df sys/arch/arm/allwinner/awin_gpio.c
--- a/sys/arch/arm/allwinner/awin_gpio.c        Fri Oct 02 09:05:33 2015 +0000
+++ b/sys/arch/arm/allwinner/awin_gpio.c        Fri Oct 02 14:06:02 2015 +0000
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_gpio.c,v 1.18 2015/04/20 01:33:22 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_gpio.c,v 1.19 2015/10/02 14:06:02 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -298,6 +298,7 @@
        for (u_int i = 0; i < __arraycount(pin_groups); i++) {
                struct awin_gpio_pin_group * const grp = &pin_groups[i];
                uint32_t mask = grp->grp_pin_mask & ~grp->grp_pin_inuse_mask;
+               device_t gpio;
 
                /* 
                 * If this group has no bits to provide, skip it.
@@ -323,7 +324,8 @@
                }
 
                gba.gba_npins = pin - gba.gba_pins;
-               config_found_ia(self, "gpiobus", &gba, gpiobus_print);
+               gpio = config_found_ia(self, "gpiobus", &gba, gpiobus_print);
+               aprint_normal_dev(gpio, "port %c\n", 'A' + i);
        }
 }
 #endif /* NGPIO > 0 */



Home | Main Index | Thread Index | Old Index