2 * drivers/pcmcia/sa1100_cerf.c
4 * PCMCIA implementation routines for CerfBoard
5 * Based off the Assabet.
8 #include <linux/module.h>
9 #include <linux/kernel.h>
10 #include <linux/device.h>
11 #include <linux/init.h>
12 #include <linux/delay.h>
13 #include <linux/gpio.h>
15 #include <mach/hardware.h>
16 #include <asm/mach-types.h>
18 #include <mach/cerf.h>
19 #include "sa1100_generic.h"
23 static int cerf_pcmcia_hw_init(struct soc_pcmcia_socket
*skt
)
27 ret
= gpio_request_one(CERF_GPIO_CF_RESET
, GPIOF_OUT_INIT_LOW
, "CF_RESET");
31 skt
->stat
[SOC_STAT_CD
].gpio
= CERF_GPIO_CF_CD
;
32 skt
->stat
[SOC_STAT_CD
].name
= "CF_CD";
33 skt
->stat
[SOC_STAT_BVD1
].gpio
= CERF_GPIO_CF_BVD1
;
34 skt
->stat
[SOC_STAT_BVD1
].name
= "CF_BVD1";
35 skt
->stat
[SOC_STAT_BVD2
].gpio
= CERF_GPIO_CF_BVD2
;
36 skt
->stat
[SOC_STAT_BVD2
].name
= "CF_BVD2";
37 skt
->stat
[SOC_STAT_RDY
].gpio
= CERF_GPIO_CF_IRQ
;
38 skt
->stat
[SOC_STAT_RDY
].name
= "CF_IRQ";
43 static void cerf_pcmcia_hw_shutdown(struct soc_pcmcia_socket
*skt
)
45 gpio_free(CERF_GPIO_CF_RESET
);
49 cerf_pcmcia_configure_socket(struct soc_pcmcia_socket
*skt
,
50 const socket_state_t
*state
)
59 printk(KERN_ERR
"%s(): unrecognized Vcc %u\n",
60 __func__
, state
->Vcc
);
64 gpio_set_value(CERF_GPIO_CF_RESET
, !!(state
->flags
& SS_RESET
));
69 static struct pcmcia_low_level cerf_pcmcia_ops
= {
71 .hw_init
= cerf_pcmcia_hw_init
,
72 .hw_shutdown
= cerf_pcmcia_hw_shutdown
,
73 .socket_state
= soc_common_cf_socket_state
,
74 .configure_socket
= cerf_pcmcia_configure_socket
,
77 int pcmcia_cerf_init(struct device
*dev
)
81 if (machine_is_cerf())
82 ret
= sa11xx_drv_pcmcia_probe(dev
, &cerf_pcmcia_ops
, CERF_SOCKET
, 1);