gb225var.h revision 1.1.8.2 1 1.1.8.2 kent /* $NetBSD: gb225var.h,v 1.1.8.2 2005/04/29 11:28:07 kent Exp $ */
2 1.1.8.2 kent
3 1.1.8.2 kent /*
4 1.1.8.2 kent * Copyright (c) 2002, 2003 Genetec corp. All rights reserved.
5 1.1.8.2 kent * Written by Hiroyuki Bessho for Genetec corp.
6 1.1.8.2 kent *
7 1.1.8.2 kent * Redistribution and use in source and binary forms, with or without
8 1.1.8.2 kent * modification, are permitted provided that the following conditions
9 1.1.8.2 kent * are met:
10 1.1.8.2 kent * 1. Redistributions of source code must retain the above copyright
11 1.1.8.2 kent * notice, this list of conditions and the following disclaimer.
12 1.1.8.2 kent * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.8.2 kent * notice, this list of conditions and the following disclaimer in the
14 1.1.8.2 kent * documentation and/or other materials provided with the distribution.
15 1.1.8.2 kent * 3. The name of Genetec corp. may not be used to endorse
16 1.1.8.2 kent * or promote products derived from this software without specific prior
17 1.1.8.2 kent * written permission.
18 1.1.8.2 kent *
19 1.1.8.2 kent * THIS SOFTWARE IS PROVIDED BY GENETEC CORP. ``AS IS'' AND
20 1.1.8.2 kent * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1.8.2 kent * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1.8.2 kent * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORP.
23 1.1.8.2 kent * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1.8.2 kent * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1.8.2 kent * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1.8.2 kent * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1.8.2 kent * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1.8.2 kent * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1.8.2 kent * POSSIBILITY OF SUCH DAMAGE.
30 1.1.8.2 kent */
31 1.1.8.2 kent
32 1.1.8.2 kent #ifndef _EVBARM_GB225VAR_H
33 1.1.8.2 kent #define _EVBARM_GB225VAR_H
34 1.1.8.2 kent
35 1.1.8.2 kent #include <sys/queue.h>
36 1.1.8.2 kent #include <sys/callout.h>
37 1.1.8.2 kent
38 1.1.8.2 kent /*
39 1.1.8.2 kent * Interrupt sources for option baord CPLD.
40 1.1.8.2 kent */
41 1.1.8.2 kent #define OPIO_INTR_CF_INSERT 0
42 1.1.8.2 kent #define OPIO_INTR_PCMCIA_INSERT 1
43 1.1.8.2 kent #define OPIO_INTR_USB_POWER 2 /* USB power fault */
44 1.1.8.2 kent #define OPIO_INTR_CARD_POWER 3 /* PCMCIA/CF power fault */
45 1.1.8.2 kent #define N_OPIO_INTR 4
46 1.1.8.2 kent
47 1.1.8.2 kent
48 1.1.8.2 kent struct opio_intr_handler;
49 1.1.8.2 kent
50 1.1.8.2 kent struct opio_softc {
51 1.1.8.2 kent struct device sc_dev;
52 1.1.8.2 kent
53 1.1.8.2 kent bus_space_tag_t sc_iot;
54 1.1.8.2 kent bus_space_handle_t sc_ioh;
55 1.1.8.2 kent
56 1.1.8.2 kent bus_space_handle_t sc_memctl_ioh; /* PXA2x0's memory controller */
57 1.1.8.2 kent
58 1.1.8.2 kent void *sc_ih; /* interrupt handler */
59 1.1.8.2 kent /* callout for debounce */
60 1.1.8.2 kent struct callout sc_callout;
61 1.1.8.2 kent
62 1.1.8.2 kent enum {ST_STABLE, ST_BOUNCING } sc_debounce;
63 1.1.8.2 kent
64 1.1.8.2 kent struct opio_intr_handler {
65 1.1.8.2 kent int (* func)(void *, int);
66 1.1.8.2 kent void *arg;
67 1.1.8.2 kent int level;
68 1.1.8.2 kent
69 1.1.8.2 kent uint8_t reported_state;
70 1.1.8.2 kent uint8_t last_state;
71 1.1.8.2 kent short debounce_count;
72 1.1.8.2 kent } sc_intr[N_OPIO_INTR];
73 1.1.8.2 kent };
74 1.1.8.2 kent
75 1.1.8.2 kent
76 1.1.8.2 kent void *opio_intr_establish(struct opio_softc *, int, int,
77 1.1.8.2 kent int (*)(void *, int), void *);
78 1.1.8.2 kent
79 1.1.8.2 kent #endif /* _EVBARM_GB225VAR_H */
80