diff options
Diffstat (limited to 'drivers/pcmcia/pxa2xx_vpac270.c')
-rw-r--r-- | drivers/pcmcia/pxa2xx_vpac270.c | 53 |
1 files changed, 8 insertions, 45 deletions
diff --git a/drivers/pcmcia/pxa2xx_vpac270.c b/drivers/pcmcia/pxa2xx_vpac270.c index 61b17d235dbe..cf07d8825513 100644 --- a/drivers/pcmcia/pxa2xx_vpac270.c +++ b/drivers/pcmcia/pxa2xx_vpac270.c | |||
@@ -23,29 +23,14 @@ | |||
23 | #include "soc_common.h" | 23 | #include "soc_common.h" |
24 | 24 | ||
25 | static struct gpio vpac270_pcmcia_gpios[] = { | 25 | static struct gpio vpac270_pcmcia_gpios[] = { |
26 | { GPIO84_VPAC270_PCMCIA_CD, GPIOF_IN, "PCMCIA Card Detect" }, | ||
27 | { GPIO35_VPAC270_PCMCIA_RDY, GPIOF_IN, "PCMCIA Ready" }, | ||
28 | { GPIO107_VPAC270_PCMCIA_PPEN, GPIOF_INIT_LOW, "PCMCIA PPEN" }, | 26 | { GPIO107_VPAC270_PCMCIA_PPEN, GPIOF_INIT_LOW, "PCMCIA PPEN" }, |
29 | { GPIO11_VPAC270_PCMCIA_RESET, GPIOF_INIT_LOW, "PCMCIA Reset" }, | 27 | { GPIO11_VPAC270_PCMCIA_RESET, GPIOF_INIT_LOW, "PCMCIA Reset" }, |
30 | }; | 28 | }; |
31 | 29 | ||
32 | static struct gpio vpac270_cf_gpios[] = { | 30 | static struct gpio vpac270_cf_gpios[] = { |
33 | { GPIO17_VPAC270_CF_CD, GPIOF_IN, "CF Card Detect" }, | ||
34 | { GPIO12_VPAC270_CF_RDY, GPIOF_IN, "CF Ready" }, | ||
35 | { GPIO16_VPAC270_CF_RESET, GPIOF_INIT_LOW, "CF Reset" }, | 31 | { GPIO16_VPAC270_CF_RESET, GPIOF_INIT_LOW, "CF Reset" }, |
36 | }; | 32 | }; |
37 | 33 | ||
38 | static struct pcmcia_irqs cd_irqs[] = { | ||
39 | { | ||
40 | .sock = 0, | ||
41 | .str = "PCMCIA CD" | ||
42 | }, | ||
43 | { | ||
44 | .sock = 1, | ||
45 | .str = "CF CD" | ||
46 | }, | ||
47 | }; | ||
48 | |||
49 | static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | 34 | static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) |
50 | { | 35 | { |
51 | int ret; | 36 | int ret; |
@@ -54,20 +39,18 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
54 | ret = gpio_request_array(vpac270_pcmcia_gpios, | 39 | ret = gpio_request_array(vpac270_pcmcia_gpios, |
55 | ARRAY_SIZE(vpac270_pcmcia_gpios)); | 40 | ARRAY_SIZE(vpac270_pcmcia_gpios)); |
56 | 41 | ||
57 | skt->socket.pci_irq = gpio_to_irq(GPIO35_VPAC270_PCMCIA_RDY); | 42 | skt->stat[SOC_STAT_CD].gpio = GPIO84_VPAC270_PCMCIA_CD; |
58 | cd_irqs[0].irq = gpio_to_irq(GPIO84_VPAC270_PCMCIA_CD); | 43 | skt->stat[SOC_STAT_CD].name = "PCMCIA CD"; |
59 | 44 | skt->stat[SOC_STAT_RDY].gpio = GPIO35_VPAC270_PCMCIA_RDY; | |
60 | if (!ret) | 45 | skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready"; |
61 | ret = soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1); | ||
62 | } else { | 46 | } else { |
63 | ret = gpio_request_array(vpac270_cf_gpios, | 47 | ret = gpio_request_array(vpac270_cf_gpios, |
64 | ARRAY_SIZE(vpac270_cf_gpios)); | 48 | ARRAY_SIZE(vpac270_cf_gpios)); |
65 | 49 | ||
66 | skt->socket.pci_irq = gpio_to_irq(GPIO12_VPAC270_CF_RDY); | 50 | skt->stat[SOC_STAT_CD].gpio = GPIO17_VPAC270_CF_CD; |
67 | cd_irqs[1].irq = gpio_to_irq(GPIO17_VPAC270_CF_CD); | 51 | skt->stat[SOC_STAT_CD].name = "CF CD"; |
68 | 52 | skt->stat[SOC_STAT_RDY].gpio = GPIO12_VPAC270_CF_RDY; | |
69 | if (!ret) | 53 | skt->stat[SOC_STAT_RDY].name = "CF Ready"; |
70 | ret = soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1); | ||
71 | } | 54 | } |
72 | 55 | ||
73 | return ret; | 56 | return ret; |
@@ -86,15 +69,6 @@ static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | |||
86 | static void vpac270_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | 69 | static void vpac270_pcmcia_socket_state(struct soc_pcmcia_socket *skt, |
87 | struct pcmcia_state *state) | 70 | struct pcmcia_state *state) |
88 | { | 71 | { |
89 | if (skt->nr == 0) { | ||
90 | state->detect = !gpio_get_value(GPIO84_VPAC270_PCMCIA_CD); | ||
91 | state->ready = !!gpio_get_value(GPIO35_VPAC270_PCMCIA_RDY); | ||
92 | } else { | ||
93 | state->detect = !gpio_get_value(GPIO17_VPAC270_CF_CD); | ||
94 | state->ready = !!gpio_get_value(GPIO12_VPAC270_CF_RDY); | ||
95 | } | ||
96 | state->bvd1 = 1; | ||
97 | state->bvd2 = 1; | ||
98 | state->wrprot = 0; | 72 | state->wrprot = 0; |
99 | state->vs_3v = 1; | 73 | state->vs_3v = 1; |
100 | state->vs_Xv = 0; | 74 | state->vs_Xv = 0; |
@@ -117,14 +91,6 @@ vpac270_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
117 | return 0; | 91 | return 0; |
118 | } | 92 | } |
119 | 93 | ||
120 | static void vpac270_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | ||
121 | { | ||
122 | } | ||
123 | |||
124 | static void vpac270_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | ||
125 | { | ||
126 | } | ||
127 | |||
128 | static struct pcmcia_low_level vpac270_pcmcia_ops = { | 94 | static struct pcmcia_low_level vpac270_pcmcia_ops = { |
129 | .owner = THIS_MODULE, | 95 | .owner = THIS_MODULE, |
130 | 96 | ||
@@ -136,9 +102,6 @@ static struct pcmcia_low_level vpac270_pcmcia_ops = { | |||
136 | 102 | ||
137 | .socket_state = vpac270_pcmcia_socket_state, | 103 | .socket_state = vpac270_pcmcia_socket_state, |
138 | .configure_socket = vpac270_pcmcia_configure_socket, | 104 | .configure_socket = vpac270_pcmcia_configure_socket, |
139 | |||
140 | .socket_init = vpac270_pcmcia_socket_init, | ||
141 | .socket_suspend = vpac270_pcmcia_socket_suspend, | ||
142 | }; | 105 | }; |
143 | 106 | ||
144 | static struct platform_device *vpac270_pcmcia_device; | 107 | static struct platform_device *vpac270_pcmcia_device; |