aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2009-03-29 17:35:11 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:30:12 -0500
commitdabd14684bc2375bf69f227f04993a4dc2fd3a16 (patch)
tree8315b3a85846538459bcfdb93b316ef086f2404c
parent701a5dc05ad99a06958b3f97cb69d99b47cebee3 (diff)
PCMCIA: sa1111: remove duplicated initializers
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--drivers/pcmcia/pxa2xx_lubbock.c4
-rw-r--r--drivers/pcmcia/sa1100_badge4.c6
-rw-r--r--drivers/pcmcia/sa1100_jornada720.c32
-rw-r--r--drivers/pcmcia/sa1100_neponset.c4
-rw-r--r--drivers/pcmcia/sa1111_generic.c11
-rw-r--r--drivers/pcmcia/sa1111_generic.h3
6 files changed, 17 insertions, 43 deletions
diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c
index 35d52809a8cd..b9f8c8fb42bd 100644
--- a/drivers/pcmcia/pxa2xx_lubbock.c
+++ b/drivers/pcmcia/pxa2xx_lubbock.c
@@ -201,12 +201,8 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
201 201
202static struct pcmcia_low_level lubbock_pcmcia_ops = { 202static struct pcmcia_low_level lubbock_pcmcia_ops = {
203 .owner = THIS_MODULE, 203 .owner = THIS_MODULE,
204 .hw_init = sa1111_pcmcia_hw_init,
205 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
206 .socket_state = sa1111_pcmcia_socket_state,
207 .configure_socket = lubbock_pcmcia_configure_socket, 204 .configure_socket = lubbock_pcmcia_configure_socket,
208 .socket_init = sa1111_pcmcia_socket_init, 205 .socket_init = sa1111_pcmcia_socket_init,
209 .socket_suspend = sa1111_pcmcia_socket_suspend,
210 .first = 0, 206 .first = 0,
211 .nr = 2, 207 .nr = 2,
212}; 208};
diff --git a/drivers/pcmcia/sa1100_badge4.c b/drivers/pcmcia/sa1100_badge4.c
index 6399314e244d..1ce53f493bef 100644
--- a/drivers/pcmcia/sa1100_badge4.c
+++ b/drivers/pcmcia/sa1100_badge4.c
@@ -127,14 +127,8 @@ badge4_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state
127 127
128static struct pcmcia_low_level badge4_pcmcia_ops = { 128static struct pcmcia_low_level badge4_pcmcia_ops = {
129 .owner = THIS_MODULE, 129 .owner = THIS_MODULE,
130 .hw_init = sa1111_pcmcia_hw_init,
131 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
132 .socket_state = sa1111_pcmcia_socket_state,
133 .configure_socket = badge4_pcmcia_configure_socket, 130 .configure_socket = badge4_pcmcia_configure_socket,
134
135 .socket_init = sa1111_pcmcia_socket_init, 131 .socket_init = sa1111_pcmcia_socket_init,
136 .socket_suspend = sa1111_pcmcia_socket_suspend,
137
138 .first = 0, 132 .first = 0,
139 .nr = 2, 133 .nr = 2,
140}; 134};
diff --git a/drivers/pcmcia/sa1100_jornada720.c b/drivers/pcmcia/sa1100_jornada720.c
index 4a32f4f1a717..6bcabee6bde4 100644
--- a/drivers/pcmcia/sa1100_jornada720.c
+++ b/drivers/pcmcia/sa1100_jornada720.c
@@ -22,23 +22,6 @@
22#define SOCKET1_POWER (GPIO_GPIO1 | GPIO_GPIO3) 22#define SOCKET1_POWER (GPIO_GPIO1 | GPIO_GPIO3)
23#define SOCKET1_3V GPIO_GPIO3 23#define SOCKET1_3V GPIO_GPIO3
24 24
25static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
26{
27 struct sa1111_pcmcia_socket *s = to_skt(skt);
28 unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3;
29
30 /*
31 * What is all this crap for?
32 */
33 GRER |= 0x00000002;
34 /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */
35 sa1111_set_io_dir(s->dev, pin, 0, 0);
36 sa1111_set_io(s->dev, pin, 0);
37 sa1111_set_sleep_io(s->dev, pin, 0);
38
39 return sa1111_pcmcia_hw_init(skt);
40}
41
42static int 25static int
43jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) 26jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
44{ 27{
@@ -108,14 +91,8 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s
108 91
109static struct pcmcia_low_level jornada720_pcmcia_ops = { 92static struct pcmcia_low_level jornada720_pcmcia_ops = {
110 .owner = THIS_MODULE, 93 .owner = THIS_MODULE,
111 .hw_init = jornada720_pcmcia_hw_init,
112 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
113 .socket_state = sa1111_pcmcia_socket_state,
114 .configure_socket = jornada720_pcmcia_configure_socket, 94 .configure_socket = jornada720_pcmcia_configure_socket,
115
116 .socket_init = sa1111_pcmcia_socket_init, 95 .socket_init = sa1111_pcmcia_socket_init,
117 .socket_suspend = sa1111_pcmcia_socket_suspend,
118
119 .first = 0, 96 .first = 0,
120 .nr = 2, 97 .nr = 2,
121}; 98};
@@ -125,6 +102,15 @@ int __devinit pcmcia_jornada720_init(struct device *dev)
125 int ret = -ENODEV; 102 int ret = -ENODEV;
126 103
127 if (machine_is_jornada720()) { 104 if (machine_is_jornada720()) {
105 unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3;
106
107 GRER |= 0x00000002;
108
109 /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */
110 sa1111_set_io_dir(dev, pin, 0, 0);
111 sa1111_set_io(dev, pin, 0);
112 sa1111_set_sleep_io(dev, pin, 0);
113
128 sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops); 114 sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops);
129 ret = sa1111_pcmcia_add(dev, &jornada720_pcmcia_ops, 115 ret = sa1111_pcmcia_add(dev, &jornada720_pcmcia_ops,
130 sa11xx_drv_pcmcia_add_one); 116 sa11xx_drv_pcmcia_add_one);
diff --git a/drivers/pcmcia/sa1100_neponset.c b/drivers/pcmcia/sa1100_neponset.c
index e39c65a06fee..c95639b5f2a0 100644
--- a/drivers/pcmcia/sa1100_neponset.c
+++ b/drivers/pcmcia/sa1100_neponset.c
@@ -116,12 +116,8 @@ static void neponset_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
116 116
117static struct pcmcia_low_level neponset_pcmcia_ops = { 117static struct pcmcia_low_level neponset_pcmcia_ops = {
118 .owner = THIS_MODULE, 118 .owner = THIS_MODULE,
119 .hw_init = sa1111_pcmcia_hw_init,
120 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
121 .socket_state = sa1111_pcmcia_socket_state,
122 .configure_socket = neponset_pcmcia_configure_socket, 119 .configure_socket = neponset_pcmcia_configure_socket,
123 .socket_init = neponset_pcmcia_socket_init, 120 .socket_init = neponset_pcmcia_socket_init,
124 .socket_suspend = sa1111_pcmcia_socket_suspend,
125 .first = 0, 121 .first = 0,
126 .nr = 2, 122 .nr = 2,
127}; 123};
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 98c791537cac..219860aba818 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -28,12 +28,12 @@ static struct pcmcia_irqs irqs[] = {
28 { 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" }, 28 { 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" },
29}; 29};
30 30
31int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 31static int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
32{ 32{
33 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 33 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
34} 34}
35 35
36void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 36static void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
37{ 37{
38 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); 38 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
39} 39}
@@ -111,7 +111,7 @@ void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
111 soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); 111 soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
112} 112}
113 113
114void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) 114static void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
115{ 115{
116 soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs)); 116 soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
117} 117}
@@ -122,6 +122,11 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
122 struct sa1111_pcmcia_socket *s; 122 struct sa1111_pcmcia_socket *s;
123 int i, ret = 0; 123 int i, ret = 0;
124 124
125 ops->hw_init = sa1111_pcmcia_hw_init;
126 ops->hw_shutdown = sa1111_pcmcia_hw_shutdown;
127 ops->socket_state = sa1111_pcmcia_socket_state;
128 ops->socket_suspend = sa1111_pcmcia_socket_suspend;
129
125 s = kzalloc(sizeof(*s) * ops->nr, GFP_KERNEL); 130 s = kzalloc(sizeof(*s) * ops->nr, GFP_KERNEL);
126 if (!s) 131 if (!s)
127 return -ENODEV; 132 return -ENODEV;
diff --git a/drivers/pcmcia/sa1111_generic.h b/drivers/pcmcia/sa1111_generic.h
index 536fe15818be..02dc8577cdaf 100644
--- a/drivers/pcmcia/sa1111_generic.h
+++ b/drivers/pcmcia/sa1111_generic.h
@@ -15,12 +15,9 @@ static inline struct sa1111_pcmcia_socket *to_skt(struct soc_pcmcia_socket *s)
15int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, 15int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
16 int (*add)(struct soc_pcmcia_socket *)); 16 int (*add)(struct soc_pcmcia_socket *));
17 17
18extern int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *);
19extern void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *);
20extern void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia_state *); 18extern void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia_state *);
21extern int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *); 19extern int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *);
22extern void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *); 20extern void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *);
23extern void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *);
24 21
25extern int pcmcia_badge4_init(struct device *); 22extern int pcmcia_badge4_init(struct device *);
26extern int pcmcia_jornada720_init(struct device *); 23extern int pcmcia_jornada720_init(struct device *);