diff options
Diffstat (limited to 'drivers/pcmcia/sa1100_jornada720.c')
-rw-r--r-- | drivers/pcmcia/sa1100_jornada720.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/drivers/pcmcia/sa1100_jornada720.c b/drivers/pcmcia/sa1100_jornada720.c index 7eedb42f800c..6bcabee6bde4 100644 --- a/drivers/pcmcia/sa1100_jornada720.c +++ b/drivers/pcmcia/sa1100_jornada720.c | |||
@@ -22,25 +22,10 @@ | |||
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 | ||
25 | static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | ||
26 | { | ||
27 | unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3; | ||
28 | |||
29 | /* | ||
30 | * What is all this crap for? | ||
31 | */ | ||
32 | GRER |= 0x00000002; | ||
33 | /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ | ||
34 | sa1111_set_io_dir(SA1111_DEV(skt->dev), pin, 0, 0); | ||
35 | sa1111_set_io(SA1111_DEV(skt->dev), pin, 0); | ||
36 | sa1111_set_sleep_io(SA1111_DEV(skt->dev), pin, 0); | ||
37 | |||
38 | return sa1111_pcmcia_hw_init(skt); | ||
39 | } | ||
40 | |||
41 | static int | 25 | static int |
42 | jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) | 26 | jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) |
43 | { | 27 | { |
28 | struct sa1111_pcmcia_socket *s = to_skt(skt); | ||
44 | unsigned int pa_dwr_mask, pa_dwr_set; | 29 | unsigned int pa_dwr_mask, pa_dwr_set; |
45 | int ret; | 30 | int ret; |
46 | 31 | ||
@@ -97,7 +82,7 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s | |||
97 | unsigned long flags; | 82 | unsigned long flags; |
98 | 83 | ||
99 | local_irq_save(flags); | 84 | local_irq_save(flags); |
100 | sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, pa_dwr_set); | 85 | sa1111_set_io(s->dev, pa_dwr_mask, pa_dwr_set); |
101 | local_irq_restore(flags); | 86 | local_irq_restore(flags); |
102 | } | 87 | } |
103 | 88 | ||
@@ -106,21 +91,30 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s | |||
106 | 91 | ||
107 | static struct pcmcia_low_level jornada720_pcmcia_ops = { | 92 | static struct pcmcia_low_level jornada720_pcmcia_ops = { |
108 | .owner = THIS_MODULE, | 93 | .owner = THIS_MODULE, |
109 | .hw_init = jornada720_pcmcia_hw_init, | ||
110 | .hw_shutdown = sa1111_pcmcia_hw_shutdown, | ||
111 | .socket_state = sa1111_pcmcia_socket_state, | ||
112 | .configure_socket = jornada720_pcmcia_configure_socket, | 94 | .configure_socket = jornada720_pcmcia_configure_socket, |
113 | |||
114 | .socket_init = sa1111_pcmcia_socket_init, | 95 | .socket_init = sa1111_pcmcia_socket_init, |
115 | .socket_suspend = sa1111_pcmcia_socket_suspend, | 96 | .first = 0, |
97 | .nr = 2, | ||
116 | }; | 98 | }; |
117 | 99 | ||
118 | int __devinit pcmcia_jornada720_init(struct device *dev) | 100 | int __devinit pcmcia_jornada720_init(struct device *dev) |
119 | { | 101 | { |
120 | int ret = -ENODEV; | 102 | int ret = -ENODEV; |
121 | 103 | ||
122 | if (machine_is_jornada720()) | 104 | if (machine_is_jornada720()) { |
123 | ret = sa11xx_drv_pcmcia_probe(dev, &jornada720_pcmcia_ops, 0, 2); | 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 | |||
114 | sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops); | ||
115 | ret = sa1111_pcmcia_add(dev, &jornada720_pcmcia_ops, | ||
116 | sa11xx_drv_pcmcia_add_one); | ||
117 | } | ||
124 | 118 | ||
125 | return ret; | 119 | return ret; |
126 | } | 120 | } |