2 * drivers/pcmcia/sa1100_adsbitsy.c
4 * PCMCIA implementation routines for ADS Bitsy
7 * Fixed wrong PCMCIA voltage setting
9 * 7/5/01 Woojung Huh <whuh@applieddata.net>
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/sched.h>
15 #include <linux/device.h>
16 #include <linux/init.h>
18 #include <asm/hardware.h>
19 #include <asm/mach-types.h>
21 #include "sa1111_generic.h"
23 static int adsbitsy_pcmcia_hw_init(struct soc_pcmcia_socket
*skt
)
25 /* Set GPIO_A<3:0> to be outputs for PCMCIA/CF power controller: */
26 PA_DDR
&= ~(GPIO_GPIO0
| GPIO_GPIO1
| GPIO_GPIO2
| GPIO_GPIO3
);
28 /* Disable Power 3.3V/5V for PCMCIA/CF */
29 PA_DWR
|= GPIO_GPIO0
| GPIO_GPIO1
| GPIO_GPIO2
| GPIO_GPIO3
;
34 return sa1111_pcmcia_init(skt
);
38 adsbitsy_pcmcia_configure_socket(struct soc_pcmcia_socket
*skt
, const socket_state_t
*state
)
40 unsigned int pa_dwr_mask
, pa_dwr_set
;
45 pa_dwr_mask
= GPIO_GPIO0
| GPIO_GPIO1
;
49 case 0: pa_dwr_set
= GPIO_GPIO0
| GPIO_GPIO1
; break;
50 case 33: pa_dwr_set
= GPIO_GPIO1
; break;
51 case 50: pa_dwr_set
= GPIO_GPIO0
; break;
56 pa_dwr_mask
= GPIO_GPIO2
| GPIO_GPIO3
;
60 case 0: pa_dwr_set
= 0; break;
61 case 33: pa_dwr_set
= GPIO_GPIO2
; break;
62 case 50: pa_dwr_set
= GPIO_GPIO3
; break;
69 if (state
->Vpp
!= state
->Vcc
&& state
->Vpp
!= 0) {
70 printk(KERN_ERR
"%s(): CF slot cannot support VPP %u\n",
71 __FUNCTION__
, state
->Vpp
);
75 ret
= sa1111_pcmcia_configure_socket(skt
, state
);
79 local_irq_save(flags
);
80 PA_DWR
= (PA_DWR
& ~pa_dwr_mask
) | pa_dwr_set
;
81 local_irq_restore(flags
);
87 static struct pcmcia_low_level adsbitsy_pcmcia_ops
= {
89 .hw_init
= adsbitsy_pcmcia_hw_init
,
90 .hw_shutdown
= sa1111_pcmcia_hw_shutdown
,
91 .socket_state
= sa1111_pcmcia_socket_state
,
92 .configure_socket
= adsbitsy_pcmcia_configure_socket
,
93 .socket_init
= sa1111_pcmcia_socket_init
,
94 .socket_suspend
= sa1111_pcmcia_socket_suspend
,
97 int __init
pcmcia_adsbitsy_init(struct device
*dev
)
100 if (machine_is_adsbitsy())
101 ret
= sa11xx_drv_pcmcia_probe(dev
, &adsbitsy_pcmcia_ops
, 0, 2);