diff options
Diffstat (limited to 'drivers/pcmcia/pxa2xx_sharpsl.c')
-rw-r--r-- | drivers/pcmcia/pxa2xx_sharpsl.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index a1178a600e3c..bd924336a49f 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c | |||
@@ -18,10 +18,15 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | 20 | ||
21 | #include <asm/mach-types.h> | ||
21 | #include <asm/hardware.h> | 22 | #include <asm/hardware.h> |
22 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
23 | #include <asm/hardware/scoop.h> | 24 | #include <asm/hardware/scoop.h> |
24 | #include <asm/arch/pxa-regs.h> | 25 | #ifdef CONFIG_SA1100_COLLIE |
26 | #include <asm/arch-sa1100/collie.h> | ||
27 | #else | ||
28 | #include <asm/arch-pxa/pxa-regs.h> | ||
29 | #endif | ||
25 | 30 | ||
26 | #include "soc_common.h" | 31 | #include "soc_common.h" |
27 | 32 | ||
@@ -38,6 +43,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
38 | { | 43 | { |
39 | int ret; | 44 | int ret; |
40 | 45 | ||
46 | #ifndef CONFIG_SA1100_COLLIE | ||
41 | /* | 47 | /* |
42 | * Setup default state of GPIO outputs | 48 | * Setup default state of GPIO outputs |
43 | * before we enable them as outputs. | 49 | * before we enable them as outputs. |
@@ -60,6 +66,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
60 | pxa_gpio_mode(GPIO55_nPREG_MD); | 66 | pxa_gpio_mode(GPIO55_nPREG_MD); |
61 | pxa_gpio_mode(GPIO56_nPWAIT_MD); | 67 | pxa_gpio_mode(GPIO56_nPWAIT_MD); |
62 | pxa_gpio_mode(GPIO57_nIOIS16_MD); | 68 | pxa_gpio_mode(GPIO57_nIOIS16_MD); |
69 | #endif | ||
63 | 70 | ||
64 | /* Register interrupts */ | 71 | /* Register interrupts */ |
65 | if (scoop_devs[skt->nr].cd_irq >= 0) { | 72 | if (scoop_devs[skt->nr].cd_irq >= 0) { |
@@ -213,12 +220,20 @@ static void sharpsl_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | |||
213 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0); | 220 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0); |
214 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101); | 221 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101); |
215 | scoop_devs[skt->nr].keep_vs = NO_KEEP_VS; | 222 | scoop_devs[skt->nr].keep_vs = NO_KEEP_VS; |
223 | |||
224 | if (machine_is_collie()) | ||
225 | /* We need to disable SS_OUTPUT_ENA here. */ | ||
226 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080); | ||
216 | } | 227 | } |
217 | 228 | ||
218 | static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | 229 | static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) |
219 | { | 230 | { |
220 | /* CF_BUS_OFF */ | 231 | /* CF_BUS_OFF */ |
221 | sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]); | 232 | sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]); |
233 | |||
234 | if (machine_is_collie()) | ||
235 | /* We need to disable SS_OUTPUT_ENA here. */ | ||
236 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080); | ||
222 | } | 237 | } |
223 | 238 | ||
224 | static struct pcmcia_low_level sharpsl_pcmcia_ops = { | 239 | static struct pcmcia_low_level sharpsl_pcmcia_ops = { |
@@ -235,6 +250,19 @@ static struct pcmcia_low_level sharpsl_pcmcia_ops = { | |||
235 | 250 | ||
236 | static struct platform_device *sharpsl_pcmcia_device; | 251 | static struct platform_device *sharpsl_pcmcia_device; |
237 | 252 | ||
253 | #ifdef CONFIG_SA1100_COLLIE | ||
254 | int __init pcmcia_collie_init(struct device *dev) | ||
255 | { | ||
256 | int ret = -ENODEV; | ||
257 | |||
258 | if (machine_is_collie()) | ||
259 | ret = sa11xx_drv_pcmcia_probe(dev, &sharpsl_pcmcia_ops, 0, 1); | ||
260 | |||
261 | return ret; | ||
262 | } | ||
263 | |||
264 | #else | ||
265 | |||
238 | static int __init sharpsl_pcmcia_init(void) | 266 | static int __init sharpsl_pcmcia_init(void) |
239 | { | 267 | { |
240 | int ret; | 268 | int ret; |
@@ -269,6 +297,7 @@ static void __exit sharpsl_pcmcia_exit(void) | |||
269 | 297 | ||
270 | fs_initcall(sharpsl_pcmcia_init); | 298 | fs_initcall(sharpsl_pcmcia_init); |
271 | module_exit(sharpsl_pcmcia_exit); | 299 | module_exit(sharpsl_pcmcia_exit); |
300 | #endif | ||
272 | 301 | ||
273 | MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support"); | 302 | MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support"); |
274 | MODULE_LICENSE("GPL"); | 303 | MODULE_LICENSE("GPL"); |