2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2017 The FreeBSD Foundation
7 * This software was developed by Landon Fuller under sponsorship from
8 * the FreeBSD Foundation.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 #include <sys/cdefs.h>
35 __FBSDID("$FreeBSD$");
37 #include <sys/param.h>
38 #include <sys/kernel.h>
41 #include <sys/limits.h>
42 #include <sys/module.h>
44 #include <machine/_inttypes.h>
45 #include <machine/bus.h>
47 #include <machine/resource.h>
49 #include <dev/bhnd/bhnd.h>
50 #include <dev/gpio/gpiobusvar.h>
54 #include "bhnd_nvram_map.h"
57 #include "chipc_gpiovar.h"
60 * ChipCommon GPIO driver
63 static int chipc_gpio_check_flags(
64 struct chipc_gpio_softc *sc,
65 uint32_t pin_num, uint32_t flags,
66 chipc_gpio_pin_mode *mode);
67 static int chipc_gpio_pin_update(
68 struct chipc_gpio_softc *sc,
69 struct chipc_gpio_update *update,
70 uint32_t pin_num, uint32_t flags);
71 static int chipc_gpio_commit_update(
72 struct chipc_gpio_softc *sc,
73 struct chipc_gpio_update *update);
74 static chipc_gpio_pin_mode chipc_gpio_pin_get_mode(
75 struct chipc_gpio_softc *sc,
80 static u_long chipc_gpio_debug = 0;
81 TUNABLE_ULONG("hw.bhnd_chipc.gpio_debug", &chipc_gpio_debug);
84 /** Allow userspace GPIO access on bridged network (e.g. wi-fi)
86 CC_GPIO_DEBUG_ADAPTER_GPIOC = 1 << 0,
89 #define CC_GPIO_DEBUG(_type) (CC_GPIO_DEBUG_ ## _type & chipc_gpio_debug)
91 static struct bhnd_device_quirk chipc_gpio_quirks[];
93 /* Supported parent core device identifiers */
94 static const struct bhnd_device chipc_gpio_devices[] = {
95 BHND_DEVICE(BCM, CC, "Broadcom ChipCommon GPIO", chipc_gpio_quirks),
99 /* Device quirks table */
100 static struct bhnd_device_quirk chipc_gpio_quirks[] = {
101 BHND_CORE_QUIRK (HWREV_LTE(10), CC_GPIO_QUIRK_NO_EVENTS),
102 BHND_CORE_QUIRK (HWREV_LTE(15), CC_GPIO_QUIRK_NO_DCTIMER),
103 BHND_CORE_QUIRK (HWREV_LTE(19), CC_GPIO_QUIRK_NO_PULLUPDOWN),
105 BHND_DEVICE_QUIRK_END
109 chipc_gpio_probe(device_t dev)
111 const struct bhnd_device *id;
114 /* Look for compatible chipc parent */
115 chipc = device_get_parent(dev);
116 id = bhnd_device_lookup(chipc, chipc_gpio_devices,
117 sizeof(chipc_gpio_devices[0]));
121 device_set_desc(dev, id->desc);
122 return (BUS_PROBE_NOWILDCARD);
126 chipc_gpio_attach(device_t dev)
128 struct chipc_gpio_softc *sc;
132 chipc = device_get_parent(dev);
134 sc = device_get_softc(dev);
136 sc->quirks = bhnd_device_quirks(chipc, chipc_gpio_devices,
137 sizeof(chipc_gpio_devices[0]));
139 /* If this is a bridged wi-fi adapter, we don't want to support
140 * userspace requests via gpioc(4) */
141 if (bhnd_get_attach_type(chipc) == BHND_ATTACH_ADAPTER) {
142 if (!CC_GPIO_DEBUG(ADAPTER_GPIOC))
143 sc->quirks |= CC_GPIO_QUIRK_NO_GPIOC;
146 CC_GPIO_LOCK_INIT(sc);
149 sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid,
150 RF_ACTIVE|RF_SHAREABLE);
151 if (sc->mem_res == NULL) {
152 device_printf(dev, "failed to allocate chipcommon registers\n");
158 * If hardware 'pulsate' support is available, set the timer duty-cycle
159 * to either the NVRAM 'leddc' value if available, or the default duty
162 if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) {
165 error = bhnd_nvram_getvar_uint32(chipc, BHND_NVAR_LEDDC,
167 if (error == ENOENT) {
168 /* Fall back on default duty cycle */
169 dctimerval = CHIPC_GPIOTIMERVAL_DEFAULT;
171 device_printf(dev, "error reading %s from NVRAM: %d\n",
172 BHND_NVAR_LEDDC, error);
176 CC_GPIO_WR4(sc, CHIPC_GPIOTIMERVAL, dctimerval);
179 /* Attach gpioc/gpiobus */
180 if (CC_GPIO_QUIRK(sc, NO_GPIOC)) {
183 if ((sc->gpiobus = gpiobus_attach_bus(dev)) == NULL) {
184 device_printf(dev, "failed to attach gpiobus\n");
190 /* Register as the bus GPIO provider */
191 if ((error = bhnd_register_provider(dev, BHND_SERVICE_GPIO))) {
192 device_printf(dev, "failed to register gpio with bus: %d\n",
200 device_delete_children(dev);
202 if (sc->mem_res != NULL) {
203 bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid,
207 CC_GPIO_LOCK_DESTROY(sc);
213 chipc_gpio_detach(device_t dev)
215 struct chipc_gpio_softc *sc;
218 sc = device_get_softc(dev);
220 if ((error = bus_generic_detach(dev)))
223 if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY)))
226 bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res);
227 CC_GPIO_LOCK_DESTROY(sc);
233 chipc_gpio_get_bus(device_t dev)
235 struct chipc_gpio_softc *sc = device_get_softc(dev);
237 return (sc->gpiobus);
241 chipc_gpio_pin_max(device_t dev, int *maxpin)
243 *maxpin = CC_GPIO_NPINS-1;
248 chipc_gpio_pin_set(device_t dev, uint32_t pin_num, uint32_t pin_value)
250 struct chipc_gpio_softc *sc;
254 sc = device_get_softc(dev);
257 if (!CC_GPIO_VALID_PIN(pin_num))
273 switch (chipc_gpio_pin_get_mode(sc, pin_num)) {
274 case CC_GPIO_PIN_INPUT:
275 case CC_GPIO_PIN_TRISTATE:
279 case CC_GPIO_PIN_OUTPUT:
280 CC_GPIO_WRFLAG(sc, pin_num, GPIOOUT, pin_high);
290 chipc_gpio_pin_get(device_t dev, uint32_t pin_num, uint32_t *pin_value)
292 struct chipc_gpio_softc *sc;
295 if (!CC_GPIO_VALID_PIN(pin_num))
298 sc = device_get_softc(dev);
303 switch (chipc_gpio_pin_get_mode(sc, pin_num)) {
304 case CC_GPIO_PIN_INPUT:
305 pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOIN);
308 case CC_GPIO_PIN_OUTPUT:
309 pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOOUT);
312 case CC_GPIO_PIN_TRISTATE:
319 *pin_value = pin_high ? GPIO_PIN_HIGH : GPIO_PIN_LOW;
325 chipc_gpio_pin_toggle(device_t dev, uint32_t pin_num)
327 struct chipc_gpio_softc *sc;
331 if (!CC_GPIO_VALID_PIN(pin_num))
334 sc = device_get_softc(dev);
339 switch (chipc_gpio_pin_get_mode(sc, pin_num)) {
340 case CC_GPIO_PIN_INPUT:
341 case CC_GPIO_PIN_TRISTATE:
345 case CC_GPIO_PIN_OUTPUT:
346 pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOOUT);
347 CC_GPIO_WRFLAG(sc, pin_num, GPIOOUT, !pin_high);
357 chipc_gpio_pin_getcaps(device_t dev, uint32_t pin_num, uint32_t *caps)
359 struct chipc_gpio_softc *sc = device_get_softc(dev);
361 if (!CC_GPIO_VALID_PIN(pin_num))
364 *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_TRISTATE);
366 if (!CC_GPIO_QUIRK(sc, NO_PULLUPDOWN))
367 *caps |= (GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN);
369 if (!CC_GPIO_QUIRK(sc, NO_DCTIMER))
370 *caps |= GPIO_PIN_PULSATE;
376 chipc_gpio_pin_getflags(device_t dev, uint32_t pin_num, uint32_t *flags)
378 struct chipc_gpio_softc *sc = device_get_softc(dev);
380 if (!CC_GPIO_VALID_PIN(pin_num))
385 switch (chipc_gpio_pin_get_mode(sc, pin_num)) {
386 case CC_GPIO_PIN_INPUT:
387 *flags = GPIO_PIN_INPUT;
389 if (!CC_GPIO_QUIRK(sc, NO_PULLUPDOWN)) {
390 if (CC_GPIO_RDFLAG(sc, pin_num, GPIOPU)) {
391 *flags |= GPIO_PIN_PULLUP;
392 } else if (CC_GPIO_RDFLAG(sc, pin_num, GPIOPD)) {
393 *flags |= GPIO_PIN_PULLDOWN;
398 case CC_GPIO_PIN_OUTPUT:
399 *flags = GPIO_PIN_OUTPUT;
401 if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) {
402 if (CC_GPIO_RDFLAG(sc, pin_num, GPIOTIMEROUTMASK))
403 *flags |= GPIO_PIN_PULSATE;
408 case CC_GPIO_PIN_TRISTATE:
409 *flags = GPIO_PIN_TRISTATE|GPIO_PIN_OUTPUT;
419 chipc_gpio_pin_getname(device_t dev, uint32_t pin_num, char *name)
423 if (!CC_GPIO_VALID_PIN(pin_num))
426 ret = snprintf(name, GPIOMAXNAME, "bhnd_gpio%02" PRIu32, pin_num);
431 if (ret >= GPIOMAXNAME)
438 chipc_gpio_pin_setflags(device_t dev, uint32_t pin_num, uint32_t flags)
440 struct chipc_gpio_softc *sc;
441 struct chipc_gpio_update upd;
444 sc = device_get_softc(dev);
446 if (!CC_GPIO_VALID_PIN(pin_num))
449 /* Produce an update descriptor */
450 memset(&upd, 0, sizeof(upd));
451 if ((error = chipc_gpio_pin_update(sc, &upd, pin_num, flags)))
454 /* Commit the update */
456 error = chipc_gpio_commit_update(sc, &upd);
463 chipc_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins,
464 uint32_t change_pins, uint32_t *orig_pins)
466 struct chipc_gpio_softc *sc;
467 struct chipc_gpio_update upd;
468 uint32_t out, outen, ctrl;
472 sc = device_get_softc(dev);
474 if (first_pin >= CC_GPIO_NPINS)
477 /* Determine the actual number of referenced pins */
478 if (clear_pins == 0 && change_pins == 0) {
479 num_pins = CC_GPIO_NPINS - first_pin;
481 int num_clear_pins, num_change_pins;
483 num_clear_pins = flsl((u_long)clear_pins);
484 num_change_pins = flsl((u_long)change_pins);
485 num_pins = MAX(num_clear_pins, num_change_pins);
488 /* Validate the full pin range */
489 if (!CC_GPIO_VALID_PINS(first_pin, num_pins))
492 /* Produce an update descriptor for all pins, relative to the current
495 memset(&upd, 0, sizeof(upd));
497 out = CC_GPIO_RD4(sc, CHIPC_GPIOOUT);
498 outen = CC_GPIO_RD4(sc, CHIPC_GPIOOUTEN);
499 ctrl = CC_GPIO_RD4(sc, CHIPC_GPIOCTRL);
501 for (uint32_t i = 0; i < num_pins; i++) {
507 /* The pin must be configured for output */
508 if ((outen & (1 << pin)) == 0) {
513 /* The pin must not tristated */
514 if ((ctrl & (1 << pin)) != 0) {
519 /* Fetch current state */
520 if (out & (1 << pin)) {
526 /* Apply clear/toggle request */
527 if (clear_pins & (1 << pin))
530 if (change_pins & (1 << pin))
531 pin_high = !pin_high;
533 /* Add to our update descriptor */
534 CC_GPIO_UPDATE(&upd, pin, out, pin_high);
537 /* Commit the update */
538 error = chipc_gpio_commit_update(sc, &upd);
545 chipc_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins,
548 struct chipc_gpio_softc *sc;
549 struct chipc_gpio_update upd;
552 sc = device_get_softc(dev);
554 if (!CC_GPIO_VALID_PINS(first_pin, num_pins))
557 /* Produce an update descriptor */
558 memset(&upd, 0, sizeof(upd));
559 for (uint32_t i = 0; i < num_pins; i++) {
563 flags = pin_flags[i];
565 /* As per the gpio_config_32 API documentation, any pins for
566 * which neither GPIO_PIN_OUTPUT or GPIO_PIN_INPUT are set
567 * should be ignored and left unmodified */
568 if ((flags & (GPIO_PIN_OUTPUT|GPIO_PIN_INPUT)) == 0)
571 if ((error = chipc_gpio_pin_update(sc, &upd, pin, flags)))
575 /* Commit the update */
577 error = chipc_gpio_commit_update(sc, &upd);
585 * Commit a single @p reg register update.
588 chipc_gpio_commit_reg(struct chipc_gpio_softc *sc, bus_size_t offset,
589 struct chipc_gpio_reg *reg)
593 CC_GPIO_LOCK_ASSERT(sc, MA_OWNED);
598 value = bhnd_bus_read_4(sc->mem_res, offset);
602 bhnd_bus_write_4(sc->mem_res, offset, value);
606 * Commit the set of GPIO register updates described by @p update.
609 chipc_gpio_commit_update(struct chipc_gpio_softc *sc,
610 struct chipc_gpio_update *update)
612 CC_GPIO_LOCK_ASSERT(sc, MA_OWNED);
614 /* Commit pulldown/pullup before potentially disabling an output pin */
615 chipc_gpio_commit_reg(sc, CHIPC_GPIOPD, &update->pulldown);
616 chipc_gpio_commit_reg(sc, CHIPC_GPIOPU, &update->pullup);
618 /* Commit output settings before potentially enabling an output pin */
619 chipc_gpio_commit_reg(sc, CHIPC_GPIOTIMEROUTMASK,
620 &update->timeroutmask);
621 chipc_gpio_commit_reg(sc, CHIPC_GPIOOUT, &update->out);
623 /* Commit input/output/tristate modes */
624 chipc_gpio_commit_reg(sc, CHIPC_GPIOOUTEN, &update->outen);
625 chipc_gpio_commit_reg(sc, CHIPC_GPIOCTRL, &update->ctrl);
631 * Apply the changes described by @p flags for @p pin_num to the given @p update
635 chipc_gpio_pin_update(struct chipc_gpio_softc *sc,
636 struct chipc_gpio_update *update, uint32_t pin_num, uint32_t flags)
638 chipc_gpio_pin_mode mode;
641 if (!CC_GPIO_VALID_PIN(pin_num))
644 /* Verify flag compatibility and determine the pin mode */
645 if ((error = chipc_gpio_check_flags(sc, pin_num, flags, &mode)))
648 /* Apply the mode-specific changes */
650 case CC_GPIO_PIN_INPUT:
651 CC_GPIO_UPDATE(update, pin_num, pullup, false);
652 CC_GPIO_UPDATE(update, pin_num, pulldown, false);
653 CC_GPIO_UPDATE(update, pin_num, out, false);
654 CC_GPIO_UPDATE(update, pin_num, outen, false);
655 CC_GPIO_UPDATE(update, pin_num, timeroutmask, false);
656 CC_GPIO_UPDATE(update, pin_num, ctrl, false);
658 if (flags & GPIO_PIN_PULLUP) {
659 CC_GPIO_UPDATE(update, pin_num, pullup, true);
660 } else if (flags & GPIO_PIN_PULLDOWN) {
661 CC_GPIO_UPDATE(update, pin_num, pulldown, true);
666 case CC_GPIO_PIN_OUTPUT:
667 CC_GPIO_UPDATE(update, pin_num, pullup, false);
668 CC_GPIO_UPDATE(update, pin_num, pulldown, false);
669 CC_GPIO_UPDATE(update, pin_num, outen, true);
670 CC_GPIO_UPDATE(update, pin_num, timeroutmask, false);
671 CC_GPIO_UPDATE(update, pin_num, ctrl, false);
673 if (flags & GPIO_PIN_PRESET_HIGH) {
674 CC_GPIO_UPDATE(update, pin_num, out, true);
675 } else if (flags & GPIO_PIN_PRESET_LOW) {
676 CC_GPIO_UPDATE(update, pin_num, out, false);
679 if (flags & GPIO_PIN_PULSATE)
680 CC_GPIO_UPDATE(update, pin_num, timeroutmask, true);
684 case CC_GPIO_PIN_TRISTATE:
685 CC_GPIO_UPDATE(update, pin_num, pullup, false);
686 CC_GPIO_UPDATE(update, pin_num, pulldown, false);
687 CC_GPIO_UPDATE(update, pin_num, out, false);
688 CC_GPIO_UPDATE(update, pin_num, outen, false);
689 CC_GPIO_UPDATE(update, pin_num, timeroutmask, false);
690 CC_GPIO_UPDATE(update, pin_num, ctrl, true);
692 if (flags & GPIO_PIN_OUTPUT)
693 CC_GPIO_UPDATE(update, pin_num, outen, true);
698 device_printf(sc->dev, "unknown pin mode %d\n", mode);
703 * Verify that @p flags are valid for use with @p pin_num, and on success,
704 * return the pin mode described by @p flags in @p mode.
706 * @param sc GPIO driver instance state.
707 * @param pin_num The pin number to configure.
708 * @param flags The pin flags to be validated.
709 * @param[out] mode On success, will be populated with the GPIO pin mode
710 * defined by @p flags.
713 * @retval EINVAL if @p flags are invalid.
716 chipc_gpio_check_flags(struct chipc_gpio_softc *sc, uint32_t pin_num,
717 uint32_t flags, chipc_gpio_pin_mode *mode)
719 uint32_t mode_flag, input_flag, output_flag;
721 CC_GPIO_ASSERT_VALID_PIN(sc, pin_num);
723 mode_flag = flags & (GPIO_PIN_OUTPUT | GPIO_PIN_INPUT |
725 output_flag = flags & (GPIO_PIN_PRESET_HIGH | GPIO_PIN_PRESET_LOW
727 input_flag = flags & (GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN);
730 case GPIO_PIN_OUTPUT:
731 /* No input flag(s) should be set */
735 /* Validate our output flag(s) */
736 switch (output_flag) {
737 case GPIO_PIN_PRESET_HIGH:
738 case GPIO_PIN_PRESET_LOW:
739 case (GPIO_PIN_PRESET_HIGH|GPIO_PIN_PULSATE):
740 case (GPIO_PIN_PRESET_LOW|GPIO_PIN_PULSATE):
742 /* Check for unhandled flags */
743 if ((flags & ~(mode_flag | output_flag)) != 0)
746 *mode = CC_GPIO_PIN_OUTPUT;
750 /* Incompatible output flags */
755 /* No output flag(s) should be set */
756 if (output_flag != 0)
759 /* Validate our input flag(s) */
760 switch (input_flag) {
761 case GPIO_PIN_PULLUP:
762 case GPIO_PIN_PULLDOWN:
764 /* Check for unhandled flags */
765 if ((flags & ~(mode_flag | input_flag)) != 0)
768 *mode = CC_GPIO_PIN_INPUT;
772 /* Incompatible input flags */
778 case (GPIO_PIN_TRISTATE|GPIO_PIN_OUTPUT):
779 case GPIO_PIN_TRISTATE:
780 /* No input or output flag(s) should be set */
781 if (input_flag != 0 || output_flag != 0)
784 /* Check for unhandled flags */
785 if ((flags & ~mode_flag) != 0)
788 *mode = CC_GPIO_PIN_TRISTATE;
792 /* Incompatible mode flags */
798 * Return the current pin mode for @p pin_num.
800 * @param sc GPIO driver instance state.
801 * @param pin_num The pin number to query.
803 static chipc_gpio_pin_mode
804 chipc_gpio_pin_get_mode(struct chipc_gpio_softc *sc, uint32_t pin_num)
806 CC_GPIO_LOCK_ASSERT(sc, MA_OWNED);
807 CC_GPIO_ASSERT_VALID_PIN(sc, pin_num);
809 if (CC_GPIO_RDFLAG(sc, pin_num, GPIOCTRL)) {
810 return (CC_GPIO_PIN_TRISTATE);
811 } else if (CC_GPIO_RDFLAG(sc, pin_num, GPIOOUTEN)) {
812 return (CC_GPIO_PIN_OUTPUT);
814 return (CC_GPIO_PIN_INPUT);
818 static device_method_t chipc_gpio_methods[] = {
819 /* Device interface */
820 DEVMETHOD(device_probe, chipc_gpio_probe),
821 DEVMETHOD(device_attach, chipc_gpio_attach),
822 DEVMETHOD(device_detach, chipc_gpio_detach),
825 DEVMETHOD(gpio_get_bus, chipc_gpio_get_bus),
826 DEVMETHOD(gpio_pin_max, chipc_gpio_pin_max),
827 DEVMETHOD(gpio_pin_getname, chipc_gpio_pin_getname),
828 DEVMETHOD(gpio_pin_getflags, chipc_gpio_pin_getflags),
829 DEVMETHOD(gpio_pin_getcaps, chipc_gpio_pin_getcaps),
830 DEVMETHOD(gpio_pin_setflags, chipc_gpio_pin_setflags),
831 DEVMETHOD(gpio_pin_get, chipc_gpio_pin_get),
832 DEVMETHOD(gpio_pin_set, chipc_gpio_pin_set),
833 DEVMETHOD(gpio_pin_toggle, chipc_gpio_pin_toggle),
834 DEVMETHOD(gpio_pin_access_32, chipc_gpio_pin_access_32),
835 DEVMETHOD(gpio_pin_config_32, chipc_gpio_pin_config_32),
840 static devclass_t gpio_devclass;
842 DEFINE_CLASS_0(gpio, chipc_gpio_driver, chipc_gpio_methods, sizeof(struct chipc_gpio_softc));
843 EARLY_DRIVER_MODULE(chipc_gpio, bhnd_chipc, chipc_gpio_driver,
844 gpio_devclass, NULL, NULL, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
846 MODULE_DEPEND(chipc_gpio, bhnd, 1, 1, 1);
847 MODULE_DEPEND(chipc_gpio, gpiobus, 1, 1, 1);
848 MODULE_VERSION(chipc_gpio, 1);