1 /* 2 * linux/include/asm/arch/pcmcia.h 3 * 4 * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu> 5 * 6 * This file contains definitions for the low-level SA-1100 kernel PCMCIA 7 * interface. Please see linux/Documentation/arm/SA1100/PCMCIA for details. 8 */ 9 #ifndef _ASM_ARCH_PCMCIA 10 #define _ASM_ARCH_PCMCIA 11 12 /* Ideally, we'd support up to MAX_SOCK sockets, but the SA-1100 only 13 * has support for two. This shows up in lots of hardwired ways, such 14 * as the fact that MECR only has enough bits to configure two sockets. 15 * Since it's so entrenched in the hardware, limiting the software 16 * in this way doesn't seem too terrible. 17 */ 18 #define SA1100_PCMCIA_MAX_SOCK (2) 19 20 struct pcmcia_init { 21 void (*handler)(int irq, void *dev, struct pt_regs *regs); 22 }; 23 24 struct pcmcia_state { 25 unsigned detect: 1, 26 ready: 1, 27 bvd1: 1, 28 bvd2: 1, 29 wrprot: 1, 30 vs_3v: 1, 31 vs_Xv: 1; 32 }; 33 34 struct pcmcia_state_array { 35 unsigned int size; 36 struct pcmcia_state *state; 37 }; 38 39 struct pcmcia_configure { 40 unsigned sock: 8, 41 vcc: 8, 42 vpp: 8, 43 output: 1, 44 speaker: 1, 45 reset: 1, 46 irq: 1; 47 }; 48 49 struct pcmcia_irq_info { 50 unsigned int sock; 51 unsigned int irq; 52 }; 53 54 struct pcmcia_low_level { 55 int (*init)(struct pcmcia_init *); 56 int (*shutdown)(void); 57 int (*socket_state)(struct pcmcia_state_array *); 58 int (*get_irq_info)(struct pcmcia_irq_info *); 59 int (*configure_socket)(const struct pcmcia_configure *); 60 61 /* 62 * Enable card status IRQs on (re-)initialisation. This can 63 * be called at initialisation, power management event, or 64 * pcmcia event. 65 */ 66 int (*socket_init)(int sock); 67 68 /* 69 * Disable card status IRQs and PCMCIA bus on suspend. 70 */ 71 int (*socket_suspend)(int sock); 72 }; 73 74 extern struct pcmcia_low_level *pcmcia_low_level; 75 76 #endif 77