2 * drivers/pcmcia/sa1100_shannon.c
4 * PCMCIA implementation routines for Shannon
7 #include <linux/module.h>
8 #include <linux/kernel.h>
9 #include <linux/device.h>
10 #include <linux/init.h>
13 #include <mach/hardware.h>
14 #include <asm/mach-types.h>
15 #include <mach/shannon.h>
17 #include "sa1100_generic.h"
19 static int shannon_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
21 /* All those are inputs */
22 GAFR &= ~(GPIO_GPIO(SHANNON_GPIO_EJECT_0) |
23 GPIO_GPIO(SHANNON_GPIO_EJECT_1) |
24 GPIO_GPIO(SHANNON_GPIO_RDY_0) |
25 GPIO_GPIO(SHANNON_GPIO_RDY_1));
28 skt->stat[SOC_STAT_CD].gpio = SHANNON_GPIO_EJECT_0;
29 skt->stat[SOC_STAT_CD].name = "PCMCIA_CD_0";
30 skt->stat[SOC_STAT_RDY].gpio = SHANNON_GPIO_RDY_0;
31 skt->stat[SOC_STAT_RDY].name = "PCMCIA_RDY_0";
33 skt->stat[SOC_STAT_CD].gpio = SHANNON_GPIO_EJECT_1;
34 skt->stat[SOC_STAT_CD].name = "PCMCIA_CD_1";
35 skt->stat[SOC_STAT_RDY].gpio = SHANNON_GPIO_RDY_1;
36 skt->stat[SOC_STAT_RDY].name = "PCMCIA_RDY_1";
43 shannon_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
44 struct pcmcia_state *state)
50 state->vs_3v = 1; /* FIXME Can only apply 3.3V on Shannon. */
57 state->vs_3v = 1; /* FIXME Can only apply 3.3V on Shannon. */
64 shannon_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
65 const socket_state_t *state)
68 case 0: /* power off */
69 printk(KERN_WARNING "%s(): CS asked for 0V, still applying 3.3V..\n", __func__);
72 printk(KERN_WARNING "%s(): CS asked for 5V, applying 3.3V..\n", __func__);
76 printk(KERN_ERR "%s(): unrecognized Vcc %u\n",
77 __func__, state->Vcc);
81 printk(KERN_WARNING "%s(): Warning, Can't perform reset\n", __func__);
83 /* Silently ignore Vpp, output enable, speaker enable. */
88 static struct pcmcia_low_level shannon_pcmcia_ops = {
90 .hw_init = shannon_pcmcia_hw_init,
91 .socket_state = shannon_pcmcia_socket_state,
92 .configure_socket = shannon_pcmcia_configure_socket,
95 int pcmcia_shannon_init(struct device *dev)
99 if (machine_is_shannon())
100 ret = sa11xx_drv_pcmcia_probe(dev, &shannon_pcmcia_ops, 0, 2);