2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2009 Oleksandr Tymoshenko <gonzo@freebsd.org>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
32 #include <sys/param.h>
33 #include <sys/systm.h>
39 #include <sys/kernel.h>
40 #include <sys/malloc.h>
41 #include <sys/module.h>
43 #include <dev/gpio/gpiobusvar.h>
45 #include "gpiobus_if.h"
49 #define dprintf printf
51 #define dprintf(x, arg...)
54 static void gpiobus_print_pins(struct gpiobus_ivar *, char *, size_t);
55 static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int);
56 static int gpiobus_probe(device_t);
57 static int gpiobus_attach(device_t);
58 static int gpiobus_detach(device_t);
59 static int gpiobus_suspend(device_t);
60 static int gpiobus_resume(device_t);
61 static void gpiobus_probe_nomatch(device_t, device_t);
62 static int gpiobus_print_child(device_t, device_t);
63 static int gpiobus_child_location_str(device_t, device_t, char *, size_t);
64 static int gpiobus_child_pnpinfo_str(device_t, device_t, char *, size_t);
65 static device_t gpiobus_add_child(device_t, u_int, const char *, int);
66 static void gpiobus_hinted_child(device_t, const char *, int);
71 static int gpiobus_acquire_bus(device_t, device_t, int);
72 static void gpiobus_release_bus(device_t, device_t);
73 static int gpiobus_pin_setflags(device_t, device_t, uint32_t, uint32_t);
74 static int gpiobus_pin_getflags(device_t, device_t, uint32_t, uint32_t*);
75 static int gpiobus_pin_getcaps(device_t, device_t, uint32_t, uint32_t*);
76 static int gpiobus_pin_set(device_t, device_t, uint32_t, unsigned int);
77 static int gpiobus_pin_get(device_t, device_t, uint32_t, unsigned int*);
78 static int gpiobus_pin_toggle(device_t, device_t, uint32_t);
81 * XXX -> Move me to better place - gpio_subr.c?
82 * Also, this function must be changed when interrupt configuration
83 * data will be moved into struct resource.
88 gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
89 gpio_pin_t pin, uint32_t intr_mode)
92 struct intr_map_data_gpio *gpio_data;
95 gpio_data = (struct intr_map_data_gpio *)intr_alloc_map_data(
96 INTR_MAP_DATA_GPIO, sizeof(*gpio_data), M_WAITOK | M_ZERO);
97 gpio_data->gpio_pin_num = pin->pin;
98 gpio_data->gpio_pin_flags = pin->flags;
99 gpio_data->gpio_intr_mode = intr_mode;
101 irq = intr_map_irq(pin->dev, 0, (struct intr_map_data *)gpio_data);
102 res = bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, irq, irq, 1,
105 intr_free_intr_map_data((struct intr_map_data *)gpio_data);
108 rman_set_virtual(res, gpio_data);
113 gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
114 gpio_pin_t pin, uint32_t intr_mode)
122 gpio_check_flags(uint32_t caps, uint32_t flags)
125 /* Filter unwanted flags. */
128 /* Cannot mix input/output together. */
129 if (flags & GPIO_PIN_INPUT && flags & GPIO_PIN_OUTPUT)
131 /* Cannot mix pull-up/pull-down together. */
132 if (flags & GPIO_PIN_PULLUP && flags & GPIO_PIN_PULLDOWN)
139 gpiobus_print_pins(struct gpiobus_ivar *devi, char *buf, size_t buflen)
142 int i, range_start, range_stop, need_coma;
144 if (devi->npins == 0)
148 range_start = range_stop = devi->pins[0];
149 for (i = 1; i < devi->npins; i++) {
150 if (devi->pins[i] != (range_stop + 1)) {
152 strlcat(buf, ",", buflen);
153 memset(tmp, 0, sizeof(tmp));
154 if (range_start != range_stop)
155 snprintf(tmp, sizeof(tmp) - 1, "%d-%d",
156 range_start, range_stop);
158 snprintf(tmp, sizeof(tmp) - 1, "%d",
160 strlcat(buf, tmp, buflen);
162 range_start = range_stop = devi->pins[i];
170 strlcat(buf, ",", buflen);
171 memset(tmp, 0, sizeof(tmp));
172 if (range_start != range_stop)
173 snprintf(tmp, sizeof(tmp) - 1, "%d-%d",
174 range_start, range_stop);
176 snprintf(tmp, sizeof(tmp) - 1, "%d",
178 strlcat(buf, tmp, buflen);
182 gpiobus_attach_bus(device_t dev)
186 busdev = device_add_child(dev, "gpiobus", -1);
189 if (device_add_child(dev, "gpioc", -1) == NULL) {
190 device_delete_child(dev, busdev);
194 ofw_gpiobus_register_provider(dev);
196 bus_generic_attach(dev);
202 gpiobus_detach_bus(device_t dev)
207 ofw_gpiobus_unregister_provider(dev);
209 err = bus_generic_detach(dev);
213 return (device_delete_children(dev));
217 gpiobus_init_softc(device_t dev)
219 struct gpiobus_softc *sc;
221 sc = GPIOBUS_SOFTC(dev);
223 sc->sc_dev = device_get_parent(dev);
224 sc->sc_intr_rman.rm_type = RMAN_ARRAY;
225 sc->sc_intr_rman.rm_descr = "GPIO Interrupts";
226 if (rman_init(&sc->sc_intr_rman) != 0 ||
227 rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0)
228 panic("%s: failed to set up rman.", __func__);
230 if (GPIO_PIN_MAX(sc->sc_dev, &sc->sc_npins) != 0)
233 KASSERT(sc->sc_npins >= 0, ("GPIO device with no pins"));
235 /* Pins = GPIO_PIN_MAX() + 1 */
238 sc->sc_pins = malloc(sizeof(*sc->sc_pins) * sc->sc_npins, M_DEVBUF,
240 if (sc->sc_pins == NULL)
243 /* Initialize the bus lock. */
244 GPIOBUS_LOCK_INIT(sc);
250 gpiobus_alloc_ivars(struct gpiobus_ivar *devi)
253 /* Allocate pins and flags memory. */
254 devi->pins = malloc(sizeof(uint32_t) * devi->npins, M_DEVBUF,
256 if (devi->pins == NULL)
258 devi->flags = malloc(sizeof(uint32_t) * devi->npins, M_DEVBUF,
260 if (devi->flags == NULL) {
261 free(devi->pins, M_DEVBUF);
269 gpiobus_free_ivars(struct gpiobus_ivar *devi)
273 free(devi->flags, M_DEVBUF);
277 free(devi->pins, M_DEVBUF);
283 gpiobus_acquire_pin(device_t bus, uint32_t pin)
285 struct gpiobus_softc *sc;
287 sc = device_get_softc(bus);
288 /* Consistency check. */
289 if (pin >= sc->sc_npins) {
291 "invalid pin %d, max: %d\n", pin, sc->sc_npins - 1);
294 /* Mark pin as mapped and give warning if it's already mapped. */
295 if (sc->sc_pins[pin].mapped) {
296 device_printf(bus, "warning: pin %d is already mapped\n", pin);
299 sc->sc_pins[pin].mapped = 1;
304 /* Release mapped pin */
306 gpiobus_release_pin(device_t bus, uint32_t pin)
308 struct gpiobus_softc *sc;
310 sc = device_get_softc(bus);
311 /* Consistency check. */
312 if (pin >= sc->sc_npins) {
314 "gpiobus_acquire_pin: invalid pin %d, max=%d\n",
315 pin, sc->sc_npins - 1);
319 if (!sc->sc_pins[pin].mapped) {
320 device_printf(bus, "gpiobus_acquire_pin: pin %d is not mapped\n", pin);
323 sc->sc_pins[pin].mapped = 0;
329 gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask)
331 struct gpiobus_ivar *devi = GPIOBUS_IVAR(child);
335 for (i = 0; i < 32; i++) {
340 device_printf(child, "empty pin mask\n");
344 if (gpiobus_alloc_ivars(devi) != 0) {
345 device_printf(child, "cannot allocate device ivars\n");
349 for (i = 0; i < 32; i++) {
350 if ((mask & (1 << i)) == 0)
352 /* Reserve the GPIO pin. */
353 if (gpiobus_acquire_pin(sc->sc_busdev, i) != 0) {
354 gpiobus_free_ivars(devi);
357 devi->pins[npins++] = i;
358 /* Use the child name as pin name. */
359 GPIOBUS_PIN_SETNAME(sc->sc_busdev, i,
360 device_get_nameunit(child));
367 gpiobus_probe(device_t dev)
369 device_set_desc(dev, "GPIO bus");
371 return (BUS_PROBE_GENERIC);
375 gpiobus_attach(device_t dev)
379 err = gpiobus_init_softc(dev);
384 * Get parent's pins and mark them as unmapped
386 bus_generic_probe(dev);
387 bus_enumerate_hinted_children(dev);
389 return (bus_generic_attach(dev));
393 * Since this is not a self-enumerating bus, and since we always add
394 * children in attach, we have to always delete children here.
397 gpiobus_detach(device_t dev)
399 struct gpiobus_softc *sc;
400 struct gpiobus_ivar *devi;
404 sc = GPIOBUS_SOFTC(dev);
405 KASSERT(mtx_initialized(&sc->sc_mtx),
406 ("gpiobus mutex not initialized"));
407 GPIOBUS_LOCK_DESTROY(sc);
409 if ((err = bus_generic_detach(dev)) != 0)
412 if ((err = device_get_children(dev, &devlist, &ndevs)) != 0)
414 for (i = 0; i < ndevs; i++) {
415 devi = GPIOBUS_IVAR(devlist[i]);
416 gpiobus_free_ivars(devi);
417 resource_list_free(&devi->rl);
418 free(devi, M_DEVBUF);
419 device_delete_child(dev, devlist[i]);
421 free(devlist, M_TEMP);
422 rman_fini(&sc->sc_intr_rman);
424 for (i = 0; i < sc->sc_npins; i++) {
425 if (sc->sc_pins[i].name != NULL)
426 free(sc->sc_pins[i].name, M_DEVBUF);
427 sc->sc_pins[i].name = NULL;
429 free(sc->sc_pins, M_DEVBUF);
437 gpiobus_suspend(device_t dev)
440 return (bus_generic_suspend(dev));
444 gpiobus_resume(device_t dev)
447 return (bus_generic_resume(dev));
451 gpiobus_probe_nomatch(device_t dev, device_t child)
454 struct gpiobus_ivar *devi;
456 devi = GPIOBUS_IVAR(child);
457 memset(pins, 0, sizeof(pins));
458 gpiobus_print_pins(devi, pins, sizeof(pins));
460 device_printf(dev, "<unknown device> at pins %s", pins);
462 device_printf(dev, "<unknown device> at pin %s", pins);
463 resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd");
468 gpiobus_print_child(device_t dev, device_t child)
472 struct gpiobus_ivar *devi;
474 devi = GPIOBUS_IVAR(child);
475 memset(pins, 0, sizeof(pins));
476 retval += bus_print_child_header(dev, child);
477 if (devi->npins > 0) {
479 retval += printf(" at pins ");
481 retval += printf(" at pin ");
482 gpiobus_print_pins(devi, pins, sizeof(pins));
483 retval += printf("%s", pins);
485 resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd");
486 retval += bus_print_child_footer(dev, child);
492 gpiobus_child_location_str(device_t bus, device_t child, char *buf,
495 struct gpiobus_ivar *devi;
497 devi = GPIOBUS_IVAR(child);
499 strlcpy(buf, "pins=", buflen);
501 strlcpy(buf, "pin=", buflen);
502 gpiobus_print_pins(devi, buf, buflen);
508 gpiobus_child_pnpinfo_str(device_t bus, device_t child, char *buf,
517 gpiobus_add_child(device_t dev, u_int order, const char *name, int unit)
520 struct gpiobus_ivar *devi;
522 child = device_add_child_ordered(dev, order, name, unit);
525 devi = malloc(sizeof(struct gpiobus_ivar), M_DEVBUF, M_NOWAIT | M_ZERO);
527 device_delete_child(dev, child);
530 resource_list_init(&devi->rl);
531 device_set_ivars(child, devi);
537 gpiobus_hinted_child(device_t bus, const char *dname, int dunit)
539 struct gpiobus_softc *sc = GPIOBUS_SOFTC(bus);
540 struct gpiobus_ivar *devi;
544 child = BUS_ADD_CHILD(bus, 0, dname, dunit);
545 devi = GPIOBUS_IVAR(child);
546 resource_int_value(dname, dunit, "pins", &pins);
547 if (gpiobus_parse_pins(sc, child, pins)) {
548 resource_list_free(&devi->rl);
549 free(devi, M_DEVBUF);
550 device_delete_child(bus, child);
552 if (resource_int_value(dname, dunit, "irq", &irq) == 0) {
553 if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0)
555 "warning: bus_set_resource() failed\n");
560 gpiobus_set_resource(device_t dev, device_t child, int type, int rid,
561 rman_res_t start, rman_res_t count)
563 struct gpiobus_ivar *devi;
564 struct resource_list_entry *rle;
566 dprintf("%s: entry (%p, %p, %d, %d, %p, %ld)\n",
567 __func__, dev, child, type, rid, (void *)(intptr_t)start, count);
568 devi = GPIOBUS_IVAR(child);
569 rle = resource_list_add(&devi->rl, type, rid, start,
570 start + count - 1, count);
577 static struct resource *
578 gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
579 rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
581 struct gpiobus_softc *sc;
583 struct resource_list *rl;
584 struct resource_list_entry *rle;
587 if (type != SYS_RES_IRQ)
589 isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1);
592 rl = BUS_GET_RESOURCE_LIST(bus, child);
595 rle = resource_list_find(rl, type, *rid);
598 if (rle->res != NULL)
599 panic("%s: resource entry is busy", __func__);
604 sc = device_get_softc(bus);
605 rv = rman_reserve_resource(&sc->sc_intr_rman, start, end, count, flags,
609 rman_set_rid(rv, *rid);
610 if ((flags & RF_ACTIVE) != 0 &&
611 bus_activate_resource(child, type, *rid, rv) != 0) {
612 rman_release_resource(rv);
620 gpiobus_release_resource(device_t bus __unused, device_t child, int type,
621 int rid, struct resource *r)
625 if (rman_get_flags(r) & RF_ACTIVE) {
626 error = bus_deactivate_resource(child, type, rid, r);
631 return (rman_release_resource(r));
634 static struct resource_list *
635 gpiobus_get_resource_list(device_t bus __unused, device_t child)
637 struct gpiobus_ivar *ivar;
639 ivar = GPIOBUS_IVAR(child);
645 gpiobus_acquire_bus(device_t busdev, device_t child, int how)
647 struct gpiobus_softc *sc;
649 sc = device_get_softc(busdev);
650 GPIOBUS_ASSERT_UNLOCKED(sc);
652 if (sc->sc_owner != NULL) {
653 if (sc->sc_owner == child)
654 panic("%s: %s still owns the bus.",
655 device_get_nameunit(busdev),
656 device_get_nameunit(child));
657 if (how == GPIOBUS_DONTWAIT) {
659 return (EWOULDBLOCK);
661 while (sc->sc_owner != NULL)
662 mtx_sleep(sc, &sc->sc_mtx, 0, "gpiobuswait", 0);
664 sc->sc_owner = child;
671 gpiobus_release_bus(device_t busdev, device_t child)
673 struct gpiobus_softc *sc;
675 sc = device_get_softc(busdev);
676 GPIOBUS_ASSERT_UNLOCKED(sc);
678 if (sc->sc_owner == NULL)
679 panic("%s: %s releasing unowned bus.",
680 device_get_nameunit(busdev),
681 device_get_nameunit(child));
682 if (sc->sc_owner != child)
683 panic("%s: %s trying to release bus owned by %s",
684 device_get_nameunit(busdev),
685 device_get_nameunit(child),
686 device_get_nameunit(sc->sc_owner));
693 gpiobus_pin_setflags(device_t dev, device_t child, uint32_t pin,
696 struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
697 struct gpiobus_ivar *devi = GPIOBUS_IVAR(child);
700 if (pin >= devi->npins)
702 if (GPIO_PIN_GETCAPS(sc->sc_dev, devi->pins[pin], &caps) != 0)
704 if (gpio_check_flags(caps, flags) != 0)
707 return (GPIO_PIN_SETFLAGS(sc->sc_dev, devi->pins[pin], flags));
711 gpiobus_pin_getflags(device_t dev, device_t child, uint32_t pin,
714 struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
715 struct gpiobus_ivar *devi = GPIOBUS_IVAR(child);
717 if (pin >= devi->npins)
720 return GPIO_PIN_GETFLAGS(sc->sc_dev, devi->pins[pin], flags);
724 gpiobus_pin_getcaps(device_t dev, device_t child, uint32_t pin,
727 struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
728 struct gpiobus_ivar *devi = GPIOBUS_IVAR(child);
730 if (pin >= devi->npins)
733 return GPIO_PIN_GETCAPS(sc->sc_dev, devi->pins[pin], caps);
737 gpiobus_pin_set(device_t dev, device_t child, uint32_t pin,
740 struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
741 struct gpiobus_ivar *devi = GPIOBUS_IVAR(child);
743 if (pin >= devi->npins)
746 return GPIO_PIN_SET(sc->sc_dev, devi->pins[pin], value);
750 gpiobus_pin_get(device_t dev, device_t child, uint32_t pin,
753 struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
754 struct gpiobus_ivar *devi = GPIOBUS_IVAR(child);
756 if (pin >= devi->npins)
759 return GPIO_PIN_GET(sc->sc_dev, devi->pins[pin], value);
763 gpiobus_pin_toggle(device_t dev, device_t child, uint32_t pin)
765 struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
766 struct gpiobus_ivar *devi = GPIOBUS_IVAR(child);
768 if (pin >= devi->npins)
771 return GPIO_PIN_TOGGLE(sc->sc_dev, devi->pins[pin]);
775 gpiobus_pin_getname(device_t dev, uint32_t pin, char *name)
777 struct gpiobus_softc *sc;
779 sc = GPIOBUS_SOFTC(dev);
780 if (pin > sc->sc_npins)
782 /* Did we have a name for this pin ? */
783 if (sc->sc_pins[pin].name != NULL) {
784 memcpy(name, sc->sc_pins[pin].name, GPIOMAXNAME);
788 /* Return the default pin name. */
789 return (GPIO_PIN_GETNAME(device_get_parent(dev), pin, name));
793 gpiobus_pin_setname(device_t dev, uint32_t pin, const char *name)
795 struct gpiobus_softc *sc;
797 sc = GPIOBUS_SOFTC(dev);
798 if (pin > sc->sc_npins)
802 /* Save the pin name. */
803 if (sc->sc_pins[pin].name == NULL)
804 sc->sc_pins[pin].name = malloc(GPIOMAXNAME, M_DEVBUF,
806 strlcpy(sc->sc_pins[pin].name, name, GPIOMAXNAME);
811 static device_method_t gpiobus_methods[] = {
812 /* Device interface */
813 DEVMETHOD(device_probe, gpiobus_probe),
814 DEVMETHOD(device_attach, gpiobus_attach),
815 DEVMETHOD(device_detach, gpiobus_detach),
816 DEVMETHOD(device_shutdown, bus_generic_shutdown),
817 DEVMETHOD(device_suspend, gpiobus_suspend),
818 DEVMETHOD(device_resume, gpiobus_resume),
821 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
822 DEVMETHOD(bus_config_intr, bus_generic_config_intr),
823 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
824 DEVMETHOD(bus_set_resource, gpiobus_set_resource),
825 DEVMETHOD(bus_alloc_resource, gpiobus_alloc_resource),
826 DEVMETHOD(bus_release_resource, gpiobus_release_resource),
827 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
828 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
829 DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list),
830 DEVMETHOD(bus_add_child, gpiobus_add_child),
831 DEVMETHOD(bus_probe_nomatch, gpiobus_probe_nomatch),
832 DEVMETHOD(bus_print_child, gpiobus_print_child),
833 DEVMETHOD(bus_child_pnpinfo_str, gpiobus_child_pnpinfo_str),
834 DEVMETHOD(bus_child_location_str, gpiobus_child_location_str),
835 DEVMETHOD(bus_hinted_child, gpiobus_hinted_child),
838 DEVMETHOD(gpiobus_acquire_bus, gpiobus_acquire_bus),
839 DEVMETHOD(gpiobus_release_bus, gpiobus_release_bus),
840 DEVMETHOD(gpiobus_pin_getflags, gpiobus_pin_getflags),
841 DEVMETHOD(gpiobus_pin_getcaps, gpiobus_pin_getcaps),
842 DEVMETHOD(gpiobus_pin_setflags, gpiobus_pin_setflags),
843 DEVMETHOD(gpiobus_pin_get, gpiobus_pin_get),
844 DEVMETHOD(gpiobus_pin_set, gpiobus_pin_set),
845 DEVMETHOD(gpiobus_pin_toggle, gpiobus_pin_toggle),
846 DEVMETHOD(gpiobus_pin_getname, gpiobus_pin_getname),
847 DEVMETHOD(gpiobus_pin_setname, gpiobus_pin_setname),
852 driver_t gpiobus_driver = {
855 sizeof(struct gpiobus_softc)
858 devclass_t gpiobus_devclass;
860 EARLY_DRIVER_MODULE(gpiobus, gpio, gpiobus_driver, gpiobus_devclass, 0, 0,
861 BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
862 MODULE_VERSION(gpiobus, 1);