diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2018-10-21 18:31:14 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2018-10-21 18:31:14 +0000 |
| commit | 2cce77dc3ed80b241ed70e0b745a419ef17d5bf2 (patch) | |
| tree | d28de87c7e1f90a709426c508b02a69870358c0c /sys/dev | |
| parent | 1247ce562fd3a778ced2318b66d9f28f04b8ef4f (diff) | |
Allow bus glue to reserve pins for private use
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/pl061.c | 7 | ||||
| -rw-r--r-- | sys/dev/ic/pl061var.h | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/pl061.c b/sys/dev/ic/pl061.c index cf50c4d2227..b3d8d80d2c3 100644 --- a/sys/dev/ic/pl061.c +++ b/sys/dev/ic/pl061.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl061.c,v 1.1 2018/10/15 23:50:48 jmcneill Exp $ */ +/* $NetBSD: pl061.c,v 1.2 2018/10/21 18:31:14 jmcneill Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pl061.c,v 1.1 2018/10/15 23:50:48 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pl061.c,v 1.2 2018/10/21 18:31:14 jmcneill Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -55,7 +55,8 @@ plgpio_attach(struct plgpio_softc *sc) sc->sc_gc.gp_pin_write = plgpio_pin_write; sc->sc_gc.gp_pin_ctl = plgpio_pin_ctl; - const uint32_t cnf = PLGPIO_READ(sc, PL061_GPIOAFSEL_REG); + const uint32_t cnf = PLGPIO_READ(sc, PL061_GPIOAFSEL_REG) | + sc->sc_reserved_mask; for (pin = 0; pin < 8; pin++) { sc->sc_pins[pin].pin_num = pin; diff --git a/sys/dev/ic/pl061var.h b/sys/dev/ic/pl061var.h index c495d99e5d4..55fd4479043 100644 --- a/sys/dev/ic/pl061var.h +++ b/sys/dev/ic/pl061var.h @@ -1,4 +1,4 @@ -/* $NetBSD: pl061var.h,v 1.1 2018/10/15 23:50:48 jmcneill Exp $ */ +/* $NetBSD: pl061var.h,v 1.2 2018/10/21 18:31:14 jmcneill Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -36,6 +36,8 @@ struct plgpio_softc { struct gpio_chipset_tag sc_gc; gpio_pin_t sc_pins[8]; + + uint32_t sc_reserved_mask; }; void plgpio_attach(struct plgpio_softc *); |
