aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pxa2xx_mainstone.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/pxa2xx_mainstone.c')
-rw-r--r--drivers/pcmcia/pxa2xx_mainstone.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c
index aded706c0b9f..7e32e25cdcb2 100644
--- a/drivers/pcmcia/pxa2xx_mainstone.c
+++ b/drivers/pcmcia/pxa2xx_mainstone.c
@@ -30,27 +30,26 @@
30#include "soc_common.h" 30#include "soc_common.h"
31 31
32 32
33static struct pcmcia_irqs irqs[] = {
34 { 0, MAINSTONE_S0_CD_IRQ, "PCMCIA0 CD" },
35 { 1, MAINSTONE_S1_CD_IRQ, "PCMCIA1 CD" },
36 { 0, MAINSTONE_S0_STSCHG_IRQ, "PCMCIA0 STSCHG" },
37 { 1, MAINSTONE_S1_STSCHG_IRQ, "PCMCIA1 STSCHG" },
38};
39
40static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 33static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
41{ 34{
42 /* 35 /*
43 * Setup default state of GPIO outputs 36 * Setup default state of GPIO outputs
44 * before we enable them as outputs. 37 * before we enable them as outputs.
45 */ 38 */
46 39 if (skt->nr == 0) {
47 skt->socket.pci_irq = (skt->nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ; 40 skt->socket.pci_irq = MAINSTONE_S0_IRQ;
48 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 41 skt->stat[SOC_STAT_CD].irq = MAINSTONE_S0_CD_IRQ;
49} 42 skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD";
50 43 skt->stat[SOC_STAT_BVD1].irq = MAINSTONE_S0_STSCHG_IRQ;
51static void mst_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 44 skt->stat[SOC_STAT_BVD1].name = "PCMCIA0 STSCHG";
52{ 45 } else {
53 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); 46 skt->socket.pci_irq = MAINSTONE_S1_IRQ;
47 skt->stat[SOC_STAT_CD].irq = MAINSTONE_S1_CD_IRQ;
48 skt->stat[SOC_STAT_CD].name = "PCMCIA1 CD";
49 skt->stat[SOC_STAT_BVD1].irq = MAINSTONE_S1_STSCHG_IRQ;
50 skt->stat[SOC_STAT_BVD1].name = "PCMCIA1 STSCHG";
51 }
52 return 0;
54} 53}
55 54
56static unsigned long mst_pcmcia_status[2]; 55static unsigned long mst_pcmcia_status[2];
@@ -84,7 +83,6 @@ static void mst_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
84 state->bvd2 = (status & MST_PCMCIA_nSPKR_BVD2) ? 1 : 0; 83 state->bvd2 = (status & MST_PCMCIA_nSPKR_BVD2) ? 1 : 0;
85 state->vs_3v = (status & MST_PCMCIA_nVS1) ? 0 : 1; 84 state->vs_3v = (status & MST_PCMCIA_nVS1) ? 0 : 1;
86 state->vs_Xv = (status & MST_PCMCIA_nVS2) ? 0 : 1; 85 state->vs_Xv = (status & MST_PCMCIA_nVS2) ? 0 : 1;
87 state->wrprot = 0; /* not available */
88} 86}
89 87
90static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, 88static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
@@ -131,7 +129,6 @@ static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
131static struct pcmcia_low_level mst_pcmcia_ops __initdata = { 129static struct pcmcia_low_level mst_pcmcia_ops __initdata = {
132 .owner = THIS_MODULE, 130 .owner = THIS_MODULE,
133 .hw_init = mst_pcmcia_hw_init, 131 .hw_init = mst_pcmcia_hw_init,
134 .hw_shutdown = mst_pcmcia_hw_shutdown,
135 .socket_state = mst_pcmcia_socket_state, 132 .socket_state = mst_pcmcia_socket_state,
136 .configure_socket = mst_pcmcia_configure_socket, 133 .configure_socket = mst_pcmcia_configure_socket,
137 .nr = 2, 134 .nr = 2,