2 * linux/drivers/pcmcia/sa1100_neponset.c
4 * Neponset PCMCIA specific routines
6 #include <linux/kernel.h>
7 #include <linux/sched.h>
9 #include <asm/hardware.h>
10 #include <asm/arch/assabet.h>
11 #include <asm/hardware/sa1111.h>
13 #include "sa1100_generic.h"
14 #include "sa1111_generic.h"
16 static int neponset_pcmcia_init(struct pcmcia_init *init)
18 /* Set GPIO_A<3:0> to be outputs for PCMCIA/CF power controller: */
19 PA_DDR &= ~(GPIO_GPIO0 | GPIO_GPIO1 | GPIO_GPIO2 | GPIO_GPIO3);
21 /* MAX1600 to standby mode: */
22 PA_DWR &= ~(GPIO_GPIO0 | GPIO_GPIO1 | GPIO_GPIO2 | GPIO_GPIO3);
23 NCR_0 &= ~(NCR_A0VPP | NCR_A1VPP);
25 return sa1111_pcmcia_init(init);
29 neponset_pcmcia_configure_socket(const struct pcmcia_configure *conf)
31 unsigned int ncr_mask, pa_dwr_mask;
32 unsigned int ncr_set, pa_dwr_set;
35 /* Neponset uses the Maxim MAX1600, with the following connections:
39 * A0VCC SA-1111 GPIO A<1>
40 * A1VCC SA-1111 GPIO A<0>
41 * A0VPP CPLD NCR A0VPP
42 * A1VPP CPLD NCR A1VPP
43 * B0VCC SA-1111 GPIO A<2>
44 * B1VCC SA-1111 GPIO A<3>
45 * B0VPP ground (slot B is CF)
46 * B1VPP ground (slot B is CF)
51 * 12INB ground (slot B is CF)
53 * The MAX1600 CODE pin is tied to ground, placing the device in
54 * "Standard Intel code" mode. Refer to the Maxim data sheet for
55 * the corresponding truth table.
60 pa_dwr_mask = GPIO_GPIO0 | GPIO_GPIO1;
61 ncr_mask = NCR_A0VPP | NCR_A1VPP;
65 case 0: pa_dwr_set = 0; break;
66 case 33: pa_dwr_set = GPIO_GPIO1; break;
67 case 50: pa_dwr_set = GPIO_GPIO0; break;
71 case 0: ncr_set = 0; break;
72 case 120: ncr_set = NCR_A1VPP; break;
74 if (conf->vpp == conf->vcc)
77 printk(KERN_ERR "%s(): unrecognized VPP %u\n",
78 __FUNCTION__, conf->vpp);
85 pa_dwr_mask = GPIO_GPIO2 | GPIO_GPIO3;
91 case 0: pa_dwr_set = 0; break;
92 case 33: pa_dwr_set = GPIO_GPIO2; break;
93 case 50: pa_dwr_set = GPIO_GPIO3; break;
96 if (conf->vpp != conf->vcc && conf->vpp != 0) {
97 printk(KERN_ERR "%s(): CF slot cannot support VPP %u\n",
98 __FUNCTION__, conf->vpp);
107 ret = sa1111_pcmcia_configure_socket(conf);
111 local_irq_save(flags);
112 NCR_0 = (NCR_0 & ~ncr_mask) | ncr_set;
113 PA_DWR = (PA_DWR & ~pa_dwr_mask) | pa_dwr_set;
114 local_irq_restore(flags);
120 struct pcmcia_low_level neponset_pcmcia_ops = {
121 init: neponset_pcmcia_init,
122 shutdown: sa1111_pcmcia_shutdown,
123 socket_state: sa1111_pcmcia_socket_state,
124 get_irq_info: sa1111_pcmcia_get_irq_info,
125 configure_socket: neponset_pcmcia_configure_socket,
127 socket_init: sa1111_pcmcia_socket_init,
128 socket_suspend: sa1111_pcmcia_socket_suspend,