aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pxa2xx_palmld.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/pxa2xx_palmld.c')
-rw-r--r--drivers/pcmcia/pxa2xx_palmld.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/drivers/pcmcia/pxa2xx_palmld.c b/drivers/pcmcia/pxa2xx_palmld.c
index 6fb6f7f0672..69f73670949 100644
--- a/drivers/pcmcia/pxa2xx_palmld.c
+++ b/drivers/pcmcia/pxa2xx_palmld.c
@@ -4,7 +4,7 @@
4 * Driver for Palm LifeDrive PCMCIA 4 * Driver for Palm LifeDrive PCMCIA
5 * 5 *
6 * Copyright (C) 2006 Alex Osborne <ato@meshy.org> 6 * Copyright (C) 2006 Alex Osborne <ato@meshy.org>
7 * Copyright (C) 2007-2008 Marek Vasut <marek.vasut@gmail.com> 7 * Copyright (C) 2007-2011 Marek Vasut <marek.vasut@gmail.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
@@ -20,49 +20,27 @@
20#include <mach/palmld.h> 20#include <mach/palmld.h>
21#include "soc_common.h" 21#include "soc_common.h"
22 22
23static struct gpio palmld_pcmcia_gpios[] = {
24 { GPIO_NR_PALMLD_PCMCIA_POWER, GPIOF_INIT_LOW, "PCMCIA Power" },
25 { GPIO_NR_PALMLD_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" },
26 { GPIO_NR_PALMLD_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" },
27};
28
23static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 29static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
24{ 30{
25 int ret; 31 int ret;
26 32
27 ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_POWER, "PCMCIA PWR"); 33 ret = gpio_request_array(palmld_pcmcia_gpios,
28 if (ret) 34 ARRAY_SIZE(palmld_pcmcia_gpios));
29 goto err1;
30 ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_POWER, 0);
31 if (ret)
32 goto err2;
33
34 ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_RESET, "PCMCIA RST");
35 if (ret)
36 goto err2;
37 ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_RESET, 1);
38 if (ret)
39 goto err3;
40
41 ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_READY, "PCMCIA RDY");
42 if (ret)
43 goto err3;
44 ret = gpio_direction_input(GPIO_NR_PALMLD_PCMCIA_READY);
45 if (ret)
46 goto err4;
47 35
48 skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY); 36 skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
49 return 0;
50 37
51err4:
52 gpio_free(GPIO_NR_PALMLD_PCMCIA_READY);
53err3:
54 gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET);
55err2:
56 gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER);
57err1:
58 return ret; 38 return ret;
59} 39}
60 40
61static void palmld_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 41static void palmld_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
62{ 42{
63 gpio_free(GPIO_NR_PALMLD_PCMCIA_READY); 43 gpio_free_array(palmld_pcmcia_gpios, ARRAY_SIZE(palmld_pcmcia_gpios));
64 gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET);
65 gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER);
66} 44}
67 45
68static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt, 46static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt,