diff options
author | Pavel Machek <pavel@ucw.cz> | 2005-10-30 18:39:02 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-10-30 18:39:02 -0500 |
commit | 77bb86a1b9f8b872d8efc33c4f4359f809220252 (patch) | |
tree | 3f0b5980d340cdec48700ab398ea9a4b1e48ee5a /drivers | |
parent | 1753298947afe5eb56da755bc057f1868f345ec1 (diff) |
[ARM] Support pcmcia slot on sharp sl-5500
This adds support for pcmcia slot on sharp zaurus sl-5500.
pxa2xx_sharpsl.c thus becomes quite miss-named, but I guess that
is not worth fixing?
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pcmcia/Makefile | 1 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_sharpsl.c | 31 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_generic.c | 7 |
3 files changed, 38 insertions, 1 deletions
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 77ecee7f987b..da7a8f2dab24 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
@@ -59,6 +59,7 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o | |||
59 | sa1100_cs-y += sa1100_generic.o | 59 | sa1100_cs-y += sa1100_generic.o |
60 | sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o | 60 | sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o |
61 | sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o | 61 | sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o |
62 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o | ||
62 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o | 63 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o |
63 | sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o | 64 | sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o |
64 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o | 65 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o |
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"); |
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index b768fa81f043..acf60ffc8a12 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c | |||
@@ -38,8 +38,12 @@ | |||
38 | #include <pcmcia/cs.h> | 38 | #include <pcmcia/cs.h> |
39 | #include <pcmcia/ss.h> | 39 | #include <pcmcia/ss.h> |
40 | 40 | ||
41 | #include <asm/hardware/scoop.h> | ||
42 | |||
41 | #include "sa1100_generic.h" | 43 | #include "sa1100_generic.h" |
42 | 44 | ||
45 | int __init pcmcia_collie_init(struct device *dev); | ||
46 | |||
43 | static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { | 47 | static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { |
44 | #ifdef CONFIG_SA1100_ASSABET | 48 | #ifdef CONFIG_SA1100_ASSABET |
45 | pcmcia_assabet_init, | 49 | pcmcia_assabet_init, |
@@ -56,6 +60,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { | |||
56 | #ifdef CONFIG_SA1100_SIMPAD | 60 | #ifdef CONFIG_SA1100_SIMPAD |
57 | pcmcia_simpad_init, | 61 | pcmcia_simpad_init, |
58 | #endif | 62 | #endif |
63 | #ifdef CONFIG_SA1100_COLLIE | ||
64 | pcmcia_collie_init, | ||
65 | #endif | ||
59 | }; | 66 | }; |
60 | 67 | ||
61 | static int sa11x0_drv_pcmcia_probe(struct device *dev) | 68 | static int sa11x0_drv_pcmcia_probe(struct device *dev) |