4 * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
7 * Redistribution and use in source and binary forms, with or
8 * without modification, are permitted provided that the following
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
13 * copyright notice, this list of conditions and the following
14 * disclaimer in the documentation and/or other materials provided
15 * with the distribution.
16 * 3. The names of the authors may not be used to endorse or promote
17 * products derived from this software without specific prior
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY
21 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
29 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
34 #ifndef _ADM5120_MAINBUSVAR_H_
35 #define _ADM5120_MAINBUSVAR_H_
37 #include <sys/types.h>
39 #include <sys/ioctl.h>
40 #include <dev/gpio/gpiovar.h>
42 struct mainbus_attach_args
{
43 const char *ma_name
; /* name of device */
44 bus_dma_tag_t ma_dmat
;
45 bus_space_tag_t ma_obiot
;
46 bus_space_handle_t ma_gpioh
;
49 uint32_t ma_gpio_mask
;
52 struct mainbus_softc
{
54 bus_space_tag_t sc_obiot
;
55 bus_space_handle_t sc_gpioh
;
56 struct gpio_chipset_tag sc_gp
;
57 gpio_pin_t sc_pins
[8];
61 device_t
admgpio_attach(struct mainbus_softc
*);
63 #endif /* _ADM5120_MAINBUSVAR_H_ */