diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 18:06:48 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-02-21 09:27:03 -0500 |
commit | b1d8a5f91796179f33de9cd7fb26052fcc47b4fa (patch) | |
tree | 0829a261bc6c30993f81fd9df9a78c10ff729cd7 /drivers/pcmcia | |
parent | 3b61436a792517848ee386bd2ccf4fc3a75f1a0f (diff) |
PCMCIA: sa11x0: simpad: convert to use new irq/gpio management
Convert Simpad socket driver to use the new irq/gpio management.
This is slightly more involved because we have to touch the private
platform header file to modify the GPIO bitmasks to be GPIO numbers.
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/sa1100_simpad.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/pcmcia/sa1100_simpad.c b/drivers/pcmcia/sa1100_simpad.c index 0fac9658b020..39d2241b9d80 100644 --- a/drivers/pcmcia/sa1100_simpad.c +++ b/drivers/pcmcia/sa1100_simpad.c | |||
@@ -15,24 +15,21 @@ | |||
15 | #include <mach/simpad.h> | 15 | #include <mach/simpad.h> |
16 | #include "sa1100_generic.h" | 16 | #include "sa1100_generic.h" |
17 | 17 | ||
18 | static struct pcmcia_irqs irqs[] = { | ||
19 | { 1, IRQ_GPIO_CF_CD, "CF_CD" }, | ||
20 | }; | ||
21 | |||
22 | static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | 18 | static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt) |
23 | { | 19 | { |
24 | 20 | ||
25 | simpad_clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); | 21 | simpad_clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); |
26 | 22 | ||
27 | skt->socket.pci_irq = IRQ_GPIO_CF_IRQ; | 23 | skt->stat[SOC_STAT_CD].gpio = GPIO_CF_CD; |
24 | skt->stat[SOC_STAT_CD].name = "CF_CD"; | ||
25 | skt->stat[SOC_STAT_RDY].gpio = GPIO_CF_IRQ; | ||
26 | skt->stat[SOC_STAT_RDY].name = "CF_RDY"; | ||
28 | 27 | ||
29 | return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); | 28 | return 0; |
30 | } | 29 | } |
31 | 30 | ||
32 | static void simpad_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | 31 | static void simpad_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) |
33 | { | 32 | { |
34 | soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
35 | |||
36 | /* Disable CF bus: */ | 33 | /* Disable CF bus: */ |
37 | /*simpad_set_cs3_bit(PCMCIA_BUFF_DIS);*/ | 34 | /*simpad_set_cs3_bit(PCMCIA_BUFF_DIS);*/ |
38 | simpad_clear_cs3_bit(PCMCIA_RESET); | 35 | simpad_clear_cs3_bit(PCMCIA_RESET); |
@@ -42,11 +39,11 @@ static void | |||
42 | simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | 39 | simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, |
43 | struct pcmcia_state *state) | 40 | struct pcmcia_state *state) |
44 | { | 41 | { |
45 | unsigned long levels = GPLR; | ||
46 | long cs3reg = simpad_get_cs3_ro(); | 42 | long cs3reg = simpad_get_cs3_ro(); |
47 | 43 | ||
48 | state->detect=((levels & GPIO_CF_CD)==0)?1:0; | 44 | /* the detect signal is inverted - fix that up here */ |
49 | state->ready=(levels & GPIO_CF_IRQ)?1:0; | 45 | state->detect = !state->detect; |
46 | |||
50 | state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ | 47 | state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ |
51 | state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ | 48 | state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ |
52 | state->wrprot=0; /* Not available on Simpad. */ | 49 | state->wrprot=0; /* Not available on Simpad. */ |
@@ -99,14 +96,8 @@ simpad_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
99 | return 0; | 96 | return 0; |
100 | } | 97 | } |
101 | 98 | ||
102 | static void simpad_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | ||
103 | { | ||
104 | soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
105 | } | ||
106 | |||
107 | static void simpad_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | 99 | static void simpad_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) |
108 | { | 100 | { |
109 | soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
110 | simpad_set_cs3_bit(PCMCIA_RESET); | 101 | simpad_set_cs3_bit(PCMCIA_RESET); |
111 | } | 102 | } |
112 | 103 | ||
@@ -116,7 +107,6 @@ static struct pcmcia_low_level simpad_pcmcia_ops = { | |||
116 | .hw_shutdown = simpad_pcmcia_hw_shutdown, | 107 | .hw_shutdown = simpad_pcmcia_hw_shutdown, |
117 | .socket_state = simpad_pcmcia_socket_state, | 108 | .socket_state = simpad_pcmcia_socket_state, |
118 | .configure_socket = simpad_pcmcia_configure_socket, | 109 | .configure_socket = simpad_pcmcia_configure_socket, |
119 | .socket_init = simpad_pcmcia_socket_init, | ||
120 | .socket_suspend = simpad_pcmcia_socket_suspend, | 110 | .socket_suspend = simpad_pcmcia_socket_suspend, |
121 | }; | 111 | }; |
122 | 112 | ||