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