aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-07-13 10:54:58 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2011-07-29 11:55:15 -0400
commit5be56a62a2868f4b7733c7c51106a8b0a88b9380 (patch)
tree5ce03b15ea5c5741b8cc620098792b69221ffb3c /drivers/pcmcia
parent7594549e8acec8123c45e26750b7820d9e938760 (diff)
pxa2xx pcmcia - stargate 2 use gpio array.
Kill off the buff gpio as not used anywhere. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/pxa2xx_stargate2.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/drivers/pcmcia/pxa2xx_stargate2.c b/drivers/pcmcia/pxa2xx_stargate2.c
index d08802fe35f9..939622251dfb 100644
--- a/drivers/pcmcia/pxa2xx_stargate2.c
+++ b/drivers/pcmcia/pxa2xx_stargate2.c
@@ -28,7 +28,6 @@
28 28
29#include "soc_common.h" 29#include "soc_common.h"
30 30
31#define SG2_S0_BUFF_CTL 120
32#define SG2_S0_POWER_CTL 108 31#define SG2_S0_POWER_CTL 108
33#define SG2_S0_GPIO_RESET 82 32#define SG2_S0_GPIO_RESET 82
34#define SG2_S0_GPIO_DETECT 53 33#define SG2_S0_GPIO_DETECT 53
@@ -38,6 +37,11 @@ static struct pcmcia_irqs irqs[] = {
38 { 0, IRQ_GPIO(SG2_S0_GPIO_DETECT), "PCMCIA0 CD" }, 37 { 0, IRQ_GPIO(SG2_S0_GPIO_DETECT), "PCMCIA0 CD" },
39}; 38};
40 39
40static struct gpio sg2_pcmcia_gpios[] = {
41 { SG2_S0_GPIO_RESET, GPIOF_OUT_INIT_HIGH, "PCMCIA Reset" },
42 { SG2_S0_POWER_CTL, GPIOF_OUT_INIT_HIGH, "PCMCIA Power Ctrl" },
43};
44
41static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 45static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
42{ 46{
43 skt->socket.pci_irq = IRQ_GPIO(SG2_S0_GPIO_READY); 47 skt->socket.pci_irq = IRQ_GPIO(SG2_S0_GPIO_READY);
@@ -122,37 +126,23 @@ static int __init sg2_pcmcia_init(void)
122 if (!sg2_pcmcia_device) 126 if (!sg2_pcmcia_device)
123 return -ENOMEM; 127 return -ENOMEM;
124 128
125 ret = gpio_request(SG2_S0_BUFF_CTL, "SG2 CF buff ctl"); 129 ret = gpio_request_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
126 if (ret) 130 if (ret)
127 goto error_put_platform_device; 131 goto error_put_platform_device;
128 ret = gpio_request(SG2_S0_POWER_CTL, "SG2 CF power ctl");
129 if (ret)
130 goto error_free_gpio_buff_ctl;
131 ret = gpio_request(SG2_S0_GPIO_RESET, "SG2 CF reset");
132 if (ret)
133 goto error_free_gpio_power_ctl;
134 /* Set gpio directions */
135 gpio_direction_output(SG2_S0_BUFF_CTL, 0);
136 gpio_direction_output(SG2_S0_POWER_CTL, 1);
137 gpio_direction_output(SG2_S0_GPIO_RESET, 1);
138 132
139 ret = platform_device_add_data(sg2_pcmcia_device, 133 ret = platform_device_add_data(sg2_pcmcia_device,
140 &sg2_pcmcia_ops, 134 &sg2_pcmcia_ops,
141 sizeof(sg2_pcmcia_ops)); 135 sizeof(sg2_pcmcia_ops));
142 if (ret) 136 if (ret)
143 goto error_free_gpio_reset; 137 goto error_free_gpios;
144 138
145 ret = platform_device_add(sg2_pcmcia_device); 139 ret = platform_device_add(sg2_pcmcia_device);
146 if (ret) 140 if (ret)
147 goto error_free_gpio_reset; 141 goto error_free_gpios;
148 142
149 return 0; 143 return 0;
150error_free_gpio_reset: 144error_free_gpios:
151 gpio_free(SG2_S0_GPIO_RESET); 145 gpio_free_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
152error_free_gpio_power_ctl:
153 gpio_free(SG2_S0_POWER_CTL);
154error_free_gpio_buff_ctl:
155 gpio_free(SG2_S0_BUFF_CTL);
156error_put_platform_device: 146error_put_platform_device:
157 platform_device_put(sg2_pcmcia_device); 147 platform_device_put(sg2_pcmcia_device);
158 148
@@ -162,9 +152,7 @@ error_put_platform_device:
162static void __exit sg2_pcmcia_exit(void) 152static void __exit sg2_pcmcia_exit(void)
163{ 153{
164 platform_device_unregister(sg2_pcmcia_device); 154 platform_device_unregister(sg2_pcmcia_device);
165 gpio_free(SG2_S0_BUFF_CTL); 155 gpio_free_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
166 gpio_free(SG2_S0_POWER_CTL);
167 gpio_free(SG2_S0_GPIO_RESET);
168} 156}
169 157
170fs_initcall(sg2_pcmcia_init); 158fs_initcall(sg2_pcmcia_init);