eppcicvar.h revision 1.3 1 1.3 skrll /* $NetBSD: eppcicvar.h,v 1.3 2012/11/12 18:00:36 skrll Exp $ */
2 1.1 hamajima
3 1.1 hamajima /*
4 1.1 hamajima * Copyright (c) 2005 HAMAJIMA Katsuomi. All rights reserved.
5 1.1 hamajima *
6 1.1 hamajima * Redistribution and use in source and binary forms, with or without
7 1.1 hamajima * modification, are permitted provided that the following conditions
8 1.1 hamajima * are met:
9 1.1 hamajima * 1. Redistributions of source code must retain the above copyright
10 1.1 hamajima * notice, this list of conditions and the following disclaimer.
11 1.1 hamajima * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 hamajima * notice, this list of conditions and the following disclaimer in the
13 1.1 hamajima * documentation and/or other materials provided with the distribution.
14 1.1 hamajima *
15 1.1 hamajima * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 1.1 hamajima * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 1.1 hamajima * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 1.1 hamajima * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.1 hamajima * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.1 hamajima * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 1.1 hamajima * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.1 hamajima * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.1 hamajima * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.1 hamajima * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.1 hamajima * SUCH DAMAGE.
26 1.1 hamajima */
27 1.1 hamajima
28 1.1 hamajima #ifndef _EPPCICVAR_H_
29 1.1 hamajima #define _EPPCICVAR_H_
30 1.1 hamajima
31 1.1 hamajima /* socket_type */
32 1.1 hamajima #define SLOT_DISABLE 0
33 1.1 hamajima #define CF_MODE 1
34 1.1 hamajima #define PCMCIA_MODE 2
35 1.1 hamajima /* power_capability */
36 1.1 hamajima #define VCC_5V (1<<0)
37 1.1 hamajima #define VCC_3V (1<<1)
38 1.1 hamajima /* power_ctl */
39 1.1 hamajima #define POWER_ON 1
40 1.1 hamajima #define POWER_OFF 0
41 1.1 hamajima
42 1.1 hamajima struct eppcic_chipset_tag {
43 1.1 hamajima int (*socket_type)(void *, int socket);
44 1.1 hamajima int (*power_capability)(void *, int socket);
45 1.1 hamajima int (*power_ctl)(void *, int socket, int onoff);
46 1.1 hamajima };
47 1.1 hamajima typedef struct eppcic_chipset_tag *eppcic_chipset_tag_t;
48 1.1 hamajima
49 1.1 hamajima #define EP93XX_PCMCIA_NSOCKET 1
50 1.1 hamajima
51 1.1 hamajima struct eppcic_handle;
52 1.1 hamajima
53 1.1 hamajima struct eppcic_softc {
54 1.2 chs device_t sc_dev;
55 1.1 hamajima bus_space_tag_t sc_iot;
56 1.1 hamajima bus_space_handle_t sc_ioh;
57 1.1 hamajima struct eppcic_handle *sc_ph[EP93XX_PCMCIA_NSOCKET];
58 1.1 hamajima eppcic_chipset_tag_t sc_pcic;
59 1.3 skrll uint32_t sc_hclk;
60 1.1 hamajima int sc_enable;
61 1.1 hamajima struct epgpio_softc *sc_gpio;
62 1.1 hamajima };
63 1.1 hamajima
64 1.2 chs void eppcic_attach_common(device_t, device_t, void *,
65 1.1 hamajima eppcic_chipset_tag_t);
66 1.1 hamajima
67 1.1 hamajima #endif /* _EPPCICVAR_H_ */
68