adm5120_extiovar.h revision 1.1.2.2 1 1.1.2.2 yamt /* $NetBSD: adm5120_extiovar.h,v 1.1.2.2 2007/03/24 14:54:53 yamt Exp $ */
2 1.1.2.2 yamt
3 1.1.2.2 yamt /*-
4 1.1.2.2 yamt * Copyright (c) 2007 David Young. All rights reserved.
5 1.1.2.2 yamt *
6 1.1.2.2 yamt * Redistribution and use in source and binary forms, with or
7 1.1.2.2 yamt * without modification, are permitted provided that the following
8 1.1.2.2 yamt * conditions are met:
9 1.1.2.2 yamt * 1. Redistributions of source code must retain the above copyright
10 1.1.2.2 yamt * notice, this list of conditions and the following disclaimer.
11 1.1.2.2 yamt * 2. Redistributions in binary form must reproduce the above
12 1.1.2.2 yamt * copyright notice, this list of conditions and the following
13 1.1.2.2 yamt * disclaimer in the documentation and/or other materials provided
14 1.1.2.2 yamt * with the distribution.
15 1.1.2.2 yamt * 3. The name of the author may not be used to endorse or promote
16 1.1.2.2 yamt * products derived from this software without specific prior
17 1.1.2.2 yamt * written permission.
18 1.1.2.2 yamt *
19 1.1.2.2 yamt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
20 1.1.2.2 yamt * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 1.1.2.2 yamt * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 1.1.2.2 yamt * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
23 1.1.2.2 yamt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24 1.1.2.2 yamt * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 1.1.2.2 yamt * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 1.1.2.2 yamt * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 1.1.2.2 yamt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
28 1.1.2.2 yamt * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 1.1.2.2 yamt * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 1.1.2.2 yamt * OF SUCH DAMAGE.
31 1.1.2.2 yamt */
32 1.1.2.2 yamt #ifndef _ADM5120_EXTIOVAR_H_
33 1.1.2.2 yamt #define _ADM5120_EXTIOVAR_H_
34 1.1.2.2 yamt
35 1.1.2.2 yamt #include <sys/types.h>
36 1.1.2.2 yamt #include <sys/gpio.h>
37 1.1.2.2 yamt #include <sys/ioctl.h>
38 1.1.2.2 yamt #include <dev/gpio/gpiovar.h>
39 1.1.2.2 yamt
40 1.1.2.2 yamt struct extio_attach_args {
41 1.1.2.2 yamt const char *ea_name; /* name of device */
42 1.1.2.2 yamt bus_space_tag_t ea_st;
43 1.1.2.2 yamt bus_addr_t ea_addr; /* address of device */
44 1.1.2.2 yamt int ea_irq; /* interrupt bit # */
45 1.1.2.2 yamt void *ea_gpio;
46 1.1.2.2 yamt int ea_gpio_offset;
47 1.1.2.2 yamt uint32_t ea_gpio_mask;
48 1.1.2.2 yamt int ea_cfio;
49 1.1.2.2 yamt };
50 1.1.2.2 yamt
51 1.1.2.2 yamt struct extio_softc {
52 1.1.2.2 yamt struct device sc_dev;
53 1.1.2.2 yamt bus_space_tag_t sc_obiot;
54 1.1.2.2 yamt bus_space_handle_t sc_gpioh;
55 1.1.2.2 yamt bus_space_handle_t sc_mpmch;
56 1.1.2.2 yamt device_t sc_gpio;
57 1.1.2.2 yamt int sc_map[5];
58 1.1.2.2 yamt struct gpio_pinmap sc_pm;
59 1.1.2.2 yamt struct mips_bus_space sc_cfio;
60 1.1.2.2 yamt };
61 1.1.2.2 yamt
62 1.1.2.2 yamt void cfio_bus_mem_init(bus_space_tag_t, bus_space_tag_t);
63 1.1.2.2 yamt void extio_bus_mem_init(bus_space_tag_t, void *);
64 1.1.2.2 yamt
65 1.1.2.2 yamt #endif /* _ADM5120_EXTIOVAR_H_ */
66