aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pxa2xx_mainstone.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-13 17:56:32 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-04 09:32:22 -0500
commita9bb5a4bf9f84256499c802fd397d56d55227e4f (patch)
tree793a74bebd0ed3f254035cb14caa093f58bb8bf6 /drivers/pcmcia/pxa2xx_mainstone.c
parentd9dc878769f521f494d1617d7cd0c92073df75d8 (diff)
PCMCIA: pxa: convert PXA socket drivers to use new irq/gpio management
Convert all the PXA platform socket drivers to use the new irq/gpio management provided by soc_common. This relieves these drivers from having to do anything with these GPIOs other than provide the numbers to soc_common. Acked-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/pcmcia/pxa2xx_mainstone.c')
-rw-r--r--drivers/pcmcia/pxa2xx_mainstone.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c
index aded706c0b9f..b0ea4d3f8a1c 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];
@@ -131,7 +130,6 @@ static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
131static struct pcmcia_low_level mst_pcmcia_ops __initdata = { 130static struct pcmcia_low_level mst_pcmcia_ops __initdata = {
132 .owner = THIS_MODULE, 131 .owner = THIS_MODULE,
133 .hw_init = mst_pcmcia_hw_init, 132 .hw_init = mst_pcmcia_hw_init,
134 .hw_shutdown = mst_pcmcia_hw_shutdown,
135 .socket_state = mst_pcmcia_socket_state, 133 .socket_state = mst_pcmcia_socket_state,
136 .configure_socket = mst_pcmcia_configure_socket, 134 .configure_socket = mst_pcmcia_configure_socket,
137 .nr = 2, 135 .nr = 2,