aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pxa2xx_stargate2.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_stargate2.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_stargate2.c')
-rw-r--r--drivers/pcmcia/pxa2xx_stargate2.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/drivers/pcmcia/pxa2xx_stargate2.c b/drivers/pcmcia/pxa2xx_stargate2.c
index 6c2366b74a35..e7c7eb530cb1 100644
--- a/drivers/pcmcia/pxa2xx_stargate2.c
+++ b/drivers/pcmcia/pxa2xx_stargate2.c
@@ -33,10 +33,6 @@
33#define SG2_S0_GPIO_DETECT 53 33#define SG2_S0_GPIO_DETECT 53
34#define SG2_S0_GPIO_READY 81 34#define SG2_S0_GPIO_READY 81
35 35
36static struct pcmcia_irqs irqs[] = {
37 {.sock = 0, .str = "PCMCIA0 CD" },
38};
39
40static struct gpio sg2_pcmcia_gpios[] = { 36static struct gpio sg2_pcmcia_gpios[] = {
41 { SG2_S0_GPIO_RESET, GPIOF_OUT_INIT_HIGH, "PCMCIA Reset" }, 37 { SG2_S0_GPIO_RESET, GPIOF_OUT_INIT_HIGH, "PCMCIA Reset" },
42 { SG2_S0_POWER_CTL, GPIOF_OUT_INIT_HIGH, "PCMCIA Power Ctrl" }, 38 { SG2_S0_POWER_CTL, GPIOF_OUT_INIT_HIGH, "PCMCIA Power Ctrl" },
@@ -44,22 +40,16 @@ static struct gpio sg2_pcmcia_gpios[] = {
44 40
45static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 41static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
46{ 42{
47 skt->socket.pci_irq = gpio_to_irq(SG2_S0_GPIO_READY); 43 skt->stat[SOC_STAT_CD].gpio = SG2_S0_GPIO_DETECT;
48 irqs[0].irq = gpio_to_irq(SG2_S0_GPIO_DETECT); 44 skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD";
49 45 skt->stat[SOC_STAT_RDY].gpio = SG2_S0_GPIO_READY;
50 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 46 skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY";
51} 47 return 0;
52
53static void sg2_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
54{
55 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
56} 48}
57 49
58static void sg2_pcmcia_socket_state(struct soc_pcmcia_socket *skt, 50static void sg2_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
59 struct pcmcia_state *state) 51 struct pcmcia_state *state)
60{ 52{
61 state->detect = !gpio_get_value(SG2_S0_GPIO_DETECT);
62 state->ready = !!gpio_get_value(SG2_S0_GPIO_READY);
63 state->bvd1 = 0; /* not available - battery detect on card */ 53 state->bvd1 = 0; /* not available - battery detect on card */
64 state->bvd2 = 0; /* not available */ 54 state->bvd2 = 0; /* not available */
65 state->vs_3v = 1; /* not available - voltage detect for card */ 55 state->vs_3v = 1; /* not available - voltage detect for card */
@@ -94,24 +84,11 @@ static int sg2_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
94 return 0; 84 return 0;
95} 85}
96 86
97static void sg2_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
98{
99 soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
100}
101
102static void sg2_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
103{
104 soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
105}
106
107static struct pcmcia_low_level sg2_pcmcia_ops __initdata = { 87static struct pcmcia_low_level sg2_pcmcia_ops __initdata = {
108 .owner = THIS_MODULE, 88 .owner = THIS_MODULE,
109 .hw_init = sg2_pcmcia_hw_init, 89 .hw_init = sg2_pcmcia_hw_init,
110 .hw_shutdown = sg2_pcmcia_hw_shutdown,
111 .socket_state = sg2_pcmcia_socket_state, 90 .socket_state = sg2_pcmcia_socket_state,
112 .configure_socket = sg2_pcmcia_configure_socket, 91 .configure_socket = sg2_pcmcia_configure_socket,
113 .socket_init = sg2_pcmcia_socket_init,
114 .socket_suspend = sg2_pcmcia_socket_suspend,
115 .nr = 1, 92 .nr = 1,
116}; 93};
117 94