gpiobusvar.h (278781) | gpiobusvar.h (278783) |
---|---|
1/*- 2 * Copyright (c) 2009 Oleksandr Tymoshenko <gonzo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2009 Oleksandr Tymoshenko <gonzo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: stable/10/sys/dev/gpio/gpiobusvar.h 278781 2015-02-14 20:32:24Z loos $ | 26 * $FreeBSD: stable/10/sys/dev/gpio/gpiobusvar.h 278783 2015-02-14 20:50:38Z loos $ |
27 * 28 */ 29 30#ifndef __GPIOBUS_H__ 31#define __GPIOBUS_H__ 32 33#include "opt_platform.h" 34 --- 16 unchanged lines hidden (view full) --- 51#define GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 52#define GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) 53#define GPIOBUS_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ 54 device_get_nameunit(_sc->sc_dev), "gpiobus", MTX_DEF) 55#define GPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) 56#define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) 57#define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) 58 | 27 * 28 */ 29 30#ifndef __GPIOBUS_H__ 31#define __GPIOBUS_H__ 32 33#include "opt_platform.h" 34 --- 16 unchanged lines hidden (view full) --- 51#define GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 52#define GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) 53#define GPIOBUS_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ 54 device_get_nameunit(_sc->sc_dev), "gpiobus", MTX_DEF) 55#define GPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) 56#define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) 57#define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) 58 |
59#define GPIOBUS_WAIT 1 60#define GPIOBUS_DONTWAIT 2 61 |
|
59struct gpiobus_softc 60{ 61 struct mtx sc_mtx; /* bus mutex */ 62 device_t sc_busdev; /* bus device */ 63 device_t sc_owner; /* bus owner */ 64 device_t sc_dev; /* driver device */ 65 int sc_npins; /* total pins on bus */ 66 int *sc_pins_mapped; /* mark mapped pins */ --- 30 unchanged lines hidden --- | 62struct gpiobus_softc 63{ 64 struct mtx sc_mtx; /* bus mutex */ 65 device_t sc_busdev; /* bus device */ 66 device_t sc_owner; /* bus owner */ 67 device_t sc_dev; /* driver device */ 68 int sc_npins; /* total pins on bus */ 69 int *sc_pins_mapped; /* mark mapped pins */ --- 30 unchanged lines hidden --- |