2 * linux/include/asm/arch/pcmcia.h
4 * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
6 * This file contains definitions for the low-level SA-1100 kernel PCMCIA
7 * interface. Please see linux/Documentation/arm/SA1100/PCMCIA for details.
9 #ifndef _ASM_ARCH_PCMCIA
10 #define _ASM_ARCH_PCMCIA
12 /* include the world */
13 #include <pcmcia/version.h>
14 #include <pcmcia/cs_types.h>
15 #include <pcmcia/cs.h>
16 #include <pcmcia/ss.h>
17 #include <pcmcia/bulkmem.h>
18 #include <pcmcia/cistpl.h>
19 #include "cs_internal.h"
23 /* Ideally, we'd support up to MAX_SOCK sockets, but the SA-1100 only
24 * has support for two. This shows up in lots of hardwired ways, such
25 * as the fact that MECR only has enough bits to configure two sockets.
26 * Since it's so entrenched in the hardware, limiting the software
27 * in this way doesn't seem too terrible.
29 #define SA1100_PCMCIA_MAX_SOCK (2)
42 * This structure encapsulates per-socket state which we might need to
43 * use when responding to a Card Services query of some kind.
45 struct sa1100_pcmcia_socket {
46 struct pcmcia_socket socket;
49 * Info from low level handler
58 struct pcmcia_low_level *ops;
61 socket_state_t cs_state;
63 unsigned short spd_io[MAX_IO_WIN];
64 unsigned short spd_mem[MAX_WIN];
65 unsigned short spd_attr[MAX_WIN];
67 struct resource res_skt;
68 struct resource res_io;
69 struct resource res_mem;
70 struct resource res_attr;
73 unsigned int irq_state;
75 struct timer_list poll_timer;
76 struct list_head node;
79 struct pcmcia_low_level {
82 int (*hw_init)(struct sa1100_pcmcia_socket *);
83 void (*hw_shutdown)(struct sa1100_pcmcia_socket *);
85 void (*socket_state)(struct sa1100_pcmcia_socket *, struct pcmcia_state *);
86 int (*configure_socket)(struct sa1100_pcmcia_socket *, const socket_state_t *);
89 * Enable card status IRQs on (re-)initialisation. This can
90 * be called at initialisation, power management event, or
93 void (*socket_init)(struct sa1100_pcmcia_socket *);
96 * Disable card status IRQs and PCMCIA bus on suspend.
98 void (*socket_suspend)(struct sa1100_pcmcia_socket *);
101 * Calculate MECR timing clock wait states
103 unsigned int (*socket_get_timing)(struct sa1100_pcmcia_socket *,
104 unsigned int cpu_speed, unsigned int cmd_time);
113 int sa11xx_request_irqs(struct sa1100_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
114 void sa11xx_free_irqs(struct sa1100_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
115 void sa11xx_disable_irqs(struct sa1100_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
116 void sa11xx_enable_irqs(struct sa1100_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
118 extern int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr);
119 extern int sa11xx_drv_pcmcia_remove(struct device *dev);