1 // SPDX-License-Identifier: GPL-2.0
3 * drivers/pcmcia/sa1100_shannon.c
5 * PCMCIA implementation routines for Shannon
8 #include <linux/module.h>
9 #include <linux/kernel.h>
10 #include <linux/device.h>
11 #include <linux/init.h>
14 #include <mach/hardware.h>
15 #include <asm/mach-types.h>
16 #include <mach/shannon.h>
18 #include "sa1100_generic.h"
20 static int shannon_pcmcia_hw_init(struct soc_pcmcia_socket
*skt
)
22 /* All those are inputs */
23 GAFR
&= ~(GPIO_GPIO(SHANNON_GPIO_EJECT_0
) |
24 GPIO_GPIO(SHANNON_GPIO_EJECT_1
) |
25 GPIO_GPIO(SHANNON_GPIO_RDY_0
) |
26 GPIO_GPIO(SHANNON_GPIO_RDY_1
));
29 skt
->stat
[SOC_STAT_CD
].gpio
= SHANNON_GPIO_EJECT_0
;
30 skt
->stat
[SOC_STAT_CD
].name
= "PCMCIA_CD_0";
31 skt
->stat
[SOC_STAT_RDY
].gpio
= SHANNON_GPIO_RDY_0
;
32 skt
->stat
[SOC_STAT_RDY
].name
= "PCMCIA_RDY_0";
34 skt
->stat
[SOC_STAT_CD
].gpio
= SHANNON_GPIO_EJECT_1
;
35 skt
->stat
[SOC_STAT_CD
].name
= "PCMCIA_CD_1";
36 skt
->stat
[SOC_STAT_RDY
].gpio
= SHANNON_GPIO_RDY_1
;
37 skt
->stat
[SOC_STAT_RDY
].name
= "PCMCIA_RDY_1";
44 shannon_pcmcia_socket_state(struct soc_pcmcia_socket
*skt
,
45 struct pcmcia_state
*state
)
51 state
->vs_3v
= 1; /* FIXME Can only apply 3.3V on Shannon. */
58 state
->vs_3v
= 1; /* FIXME Can only apply 3.3V on Shannon. */
65 shannon_pcmcia_configure_socket(struct soc_pcmcia_socket
*skt
,
66 const socket_state_t
*state
)
69 case 0: /* power off */
70 printk(KERN_WARNING
"%s(): CS asked for 0V, still applying 3.3V..\n", __func__
);
73 printk(KERN_WARNING
"%s(): CS asked for 5V, applying 3.3V..\n", __func__
);
77 printk(KERN_ERR
"%s(): unrecognized Vcc %u\n",
78 __func__
, state
->Vcc
);
82 printk(KERN_WARNING
"%s(): Warning, Can't perform reset\n", __func__
);
84 /* Silently ignore Vpp, output enable, speaker enable. */
89 static struct pcmcia_low_level shannon_pcmcia_ops
= {
91 .hw_init
= shannon_pcmcia_hw_init
,
92 .socket_state
= shannon_pcmcia_socket_state
,
93 .configure_socket
= shannon_pcmcia_configure_socket
,
96 int pcmcia_shannon_init(struct device
*dev
)
100 if (machine_is_shannon())
101 ret
= sa11xx_drv_pcmcia_probe(dev
, &shannon_pcmcia_ops
, 0, 2);