omap: i2c: add a timeout to the busy waiting
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / pcmcia / au1000_generic.h
bloba324d329dea65e55a6183eed448aa68a29b52ac3
1 /*
2 * Alchemy Semi Au1000 pcmcia driver include file
4 * Copyright 2001 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc.
6 * ppopov@mvista.com or source@mvista.com
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 #ifndef __ASM_AU1000_PCMCIA_H
22 #define __ASM_AU1000_PCMCIA_H
24 /* include the world */
26 #include <pcmcia/cs_types.h>
27 #include <pcmcia/cs.h>
28 #include <pcmcia/ss.h>
29 #include <pcmcia/cistpl.h>
30 #include "cs_internal.h"
32 #define AU1000_PCMCIA_POLL_PERIOD (2*HZ)
33 #define AU1000_PCMCIA_IO_SPEED (255)
34 #define AU1000_PCMCIA_MEM_SPEED (300)
36 #define AU1X_SOCK0_IO 0xF00000000ULL
37 #define AU1X_SOCK0_PHYS_ATTR 0xF40000000ULL
38 #define AU1X_SOCK0_PHYS_MEM 0xF80000000ULL
40 /* pcmcia socket 1 needs external glue logic so the memory map
41 * differs from board to board.
43 #if defined(CONFIG_MIPS_PB1000)
44 #define AU1X_SOCK1_IO 0xF08000000ULL
45 #define AU1X_SOCK1_PHYS_ATTR 0xF48000000ULL
46 #define AU1X_SOCK1_PHYS_MEM 0xF88000000ULL
47 #endif
49 struct pcmcia_state {
50 unsigned detect: 1,
51 ready: 1,
52 wrprot: 1,
53 bvd1: 1,
54 bvd2: 1,
55 vs_3v: 1,
56 vs_Xv: 1;
59 struct pcmcia_configure {
60 unsigned sock: 8,
61 vcc: 8,
62 vpp: 8,
63 output: 1,
64 speaker: 1,
65 reset: 1;
68 struct pcmcia_irqs {
69 int sock;
70 int irq;
71 const char *str;
75 struct au1000_pcmcia_socket {
76 struct pcmcia_socket socket;
79 * Info from low level handler
81 struct device *dev;
82 unsigned int nr;
83 unsigned int irq;
86 * Core PCMCIA state
88 struct pcmcia_low_level *ops;
90 unsigned int status;
91 socket_state_t cs_state;
93 unsigned short spd_io[MAX_IO_WIN];
94 unsigned short spd_mem[MAX_WIN];
95 unsigned short spd_attr[MAX_WIN];
97 struct resource res_skt;
98 struct resource res_io;
99 struct resource res_mem;
100 struct resource res_attr;
102 void * virt_io;
103 unsigned int phys_io;
104 unsigned int phys_attr;
105 unsigned int phys_mem;
106 unsigned short speed_io, speed_attr, speed_mem;
108 unsigned int irq_state;
110 struct timer_list poll_timer;
113 struct pcmcia_low_level {
114 struct module *owner;
116 int (*hw_init)(struct au1000_pcmcia_socket *);
117 void (*hw_shutdown)(struct au1000_pcmcia_socket *);
119 void (*socket_state)(struct au1000_pcmcia_socket *, struct pcmcia_state *);
120 int (*configure_socket)(struct au1000_pcmcia_socket *, struct socket_state_t *);
123 * Enable card status IRQs on (re-)initialisation. This can
124 * be called at initialisation, power management event, or
125 * pcmcia event.
127 void (*socket_init)(struct au1000_pcmcia_socket *);
130 * Disable card status IRQs and PCMCIA bus on suspend.
132 void (*socket_suspend)(struct au1000_pcmcia_socket *);
135 extern int au1x_board_init(struct device *dev);
137 #endif /* __ASM_AU1000_PCMCIA_H */