aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2011-11-14 07:52:26 -0500
committerHaojian Zhuang <hzhuang1@hexinfolabs.org>2011-11-15 06:09:56 -0500
commit951c486f62490e032da0ad17e93270b0cfb6687f (patch)
treef86c974dc0771add622a0aff1c09dc4fe653d380
parent389eda15e0f41112d7c44213b3c4f8bd1c9398bc (diff)
driver: pcmcia: replace IRQ_GPIO() with gpio_to_irq()
Use common gpio_to_irq() to replace machine dependant macro IRQ_GPIO(). Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
-rw-r--r--drivers/pcmcia/pxa2xx_cm_x255.c16
-rw-r--r--drivers/pcmcia/pxa2xx_cm_x270.c9
2 files changed, 12 insertions, 13 deletions
diff --git a/drivers/pcmcia/pxa2xx_cm_x255.c b/drivers/pcmcia/pxa2xx_cm_x255.c
index 0b4f946cf13a..31ab6ddf52c9 100644
--- a/drivers/pcmcia/pxa2xx_cm_x255.c
+++ b/drivers/pcmcia/pxa2xx_cm_x255.c
@@ -16,8 +16,6 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/export.h> 17#include <linux/export.h>
18 18
19#include <asm/mach-types.h>
20
21#include "soc_common.h" 19#include "soc_common.h"
22 20
23#define GPIO_PCMCIA_SKTSEL (54) 21#define GPIO_PCMCIA_SKTSEL (54)
@@ -27,15 +25,15 @@
27#define GPIO_PCMCIA_S1_RDYINT (8) 25#define GPIO_PCMCIA_S1_RDYINT (8)
28#define GPIO_PCMCIA_RESET (9) 26#define GPIO_PCMCIA_RESET (9)
29 27
30#define PCMCIA_S0_CD_VALID IRQ_GPIO(GPIO_PCMCIA_S0_CD_VALID) 28#define PCMCIA_S0_CD_VALID gpio_to_irq(GPIO_PCMCIA_S0_CD_VALID)
31#define PCMCIA_S1_CD_VALID IRQ_GPIO(GPIO_PCMCIA_S1_CD_VALID) 29#define PCMCIA_S1_CD_VALID gpio_to_irq(GPIO_PCMCIA_S1_CD_VALID)
32#define PCMCIA_S0_RDYINT IRQ_GPIO(GPIO_PCMCIA_S0_RDYINT) 30#define PCMCIA_S0_RDYINT gpio_to_irq(GPIO_PCMCIA_S0_RDYINT)
33#define PCMCIA_S1_RDYINT IRQ_GPIO(GPIO_PCMCIA_S1_RDYINT) 31#define PCMCIA_S1_RDYINT gpio_to_irq(GPIO_PCMCIA_S1_RDYINT)
34 32
35 33
36static struct pcmcia_irqs irqs[] = { 34static struct pcmcia_irqs irqs[] = {
37 { 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" }, 35 { .sock = 0, .str = "PCMCIA0 CD" },
38 { 1, PCMCIA_S1_CD_VALID, "PCMCIA1 CD" }, 36 { .sock = 1, .str = "PCMCIA1 CD" },
39}; 37};
40 38
41static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 39static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
@@ -46,6 +44,8 @@ static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
46 gpio_direction_output(GPIO_PCMCIA_RESET, 0); 44 gpio_direction_output(GPIO_PCMCIA_RESET, 0);
47 45
48 skt->socket.pci_irq = skt->nr == 0 ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT; 46 skt->socket.pci_irq = skt->nr == 0 ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT;
47 irqs[0].irq = PCMCIA_S0_CD_VALID;
48 irqs[1].irq = PCMCIA_S1_CD_VALID;
49 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 49 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
50 if (!ret) 50 if (!ret)
51 gpio_free(GPIO_PCMCIA_RESET); 51 gpio_free(GPIO_PCMCIA_RESET);
diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c
index 923f315926ef..3dc7621a0767 100644
--- a/drivers/pcmcia/pxa2xx_cm_x270.c
+++ b/drivers/pcmcia/pxa2xx_cm_x270.c
@@ -16,20 +16,18 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/export.h> 17#include <linux/export.h>
18 18
19#include <asm/mach-types.h>
20
21#include "soc_common.h" 19#include "soc_common.h"
22 20
23#define GPIO_PCMCIA_S0_CD_VALID (84) 21#define GPIO_PCMCIA_S0_CD_VALID (84)
24#define GPIO_PCMCIA_S0_RDYINT (82) 22#define GPIO_PCMCIA_S0_RDYINT (82)
25#define GPIO_PCMCIA_RESET (53) 23#define GPIO_PCMCIA_RESET (53)
26 24
27#define PCMCIA_S0_CD_VALID IRQ_GPIO(GPIO_PCMCIA_S0_CD_VALID) 25#define PCMCIA_S0_CD_VALID gpio_to_irq(GPIO_PCMCIA_S0_CD_VALID)
28#define PCMCIA_S0_RDYINT IRQ_GPIO(GPIO_PCMCIA_S0_RDYINT) 26#define PCMCIA_S0_RDYINT gpio_to_irq(GPIO_PCMCIA_S0_RDYINT)
29 27
30 28
31static struct pcmcia_irqs irqs[] = { 29static struct pcmcia_irqs irqs[] = {
32 { 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" }, 30 { .sock = 0, .str = "PCMCIA0 CD" },
33}; 31};
34 32
35static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 33static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
@@ -40,6 +38,7 @@ static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
40 gpio_direction_output(GPIO_PCMCIA_RESET, 0); 38 gpio_direction_output(GPIO_PCMCIA_RESET, 0);
41 39
42 skt->socket.pci_irq = PCMCIA_S0_RDYINT; 40 skt->socket.pci_irq = PCMCIA_S0_RDYINT;
41 irqs[0].irq = PCMCIA_S0_CD_VALID;
43 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 42 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
44 if (!ret) 43 if (!ret)
45 gpio_free(GPIO_PCMCIA_RESET); 44 gpio_free(GPIO_PCMCIA_RESET);