aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pxa2xx_sharpsl.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2005-10-30 18:39:02 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-10-30 18:39:02 -0500
commit77bb86a1b9f8b872d8efc33c4f4359f809220252 (patch)
tree3f0b5980d340cdec48700ab398ea9a4b1e48ee5a /drivers/pcmcia/pxa2xx_sharpsl.c
parent1753298947afe5eb56da755bc057f1868f345ec1 (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/pcmcia/pxa2xx_sharpsl.c')
-rw-r--r--drivers/pcmcia/pxa2xx_sharpsl.c31
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
218static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) 229static 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
224static struct pcmcia_low_level sharpsl_pcmcia_ops = { 239static struct pcmcia_low_level sharpsl_pcmcia_ops = {
@@ -235,6 +250,19 @@ static struct pcmcia_low_level sharpsl_pcmcia_ops = {
235 250
236static struct platform_device *sharpsl_pcmcia_device; 251static struct platform_device *sharpsl_pcmcia_device;
237 252
253#ifdef CONFIG_SA1100_COLLIE
254int __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
238static int __init sharpsl_pcmcia_init(void) 266static 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
270fs_initcall(sharpsl_pcmcia_init); 298fs_initcall(sharpsl_pcmcia_init);
271module_exit(sharpsl_pcmcia_exit); 299module_exit(sharpsl_pcmcia_exit);
300#endif
272 301
273MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support"); 302MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support");
274MODULE_LICENSE("GPL"); 303MODULE_LICENSE("GPL");