28 #include <linux/module.h>
30 #include <linux/resource.h>
31 #include <linux/slab.h>
39 #define MEM_MAP_SIZE 0x400000
40 #define IO_MAP_SIZE 0x1000
60 #define BOARD_TYPE_DEFAULT 0
61 #define BOARD_TYPE_DB1200 1
62 #define BOARD_TYPE_PB1100 2
63 #define BOARD_TYPE_DB1300 3
67 #define to_db1x_socket(x) container_of(x, struct db1x_pcmcia_sock, socket)
77 unsigned short sigstat;
80 return sigstat & 1 << (8 + 2 * sock->
nr);
93 return db1200_card_inserted(sock);
95 return db1300_card_inserted(sock);
97 return db1000_card_inserted(sock);
161 0,
"pcmcia_stschg", sock);
175 0,
"pcmcia_insert", sock);
180 0,
"pcmcia_eject", sock);
187 if (db1x_card_inserted(sock))
197 0,
"pcmcia_carddetect", sock);
239 unsigned short cr_clr, cr_set;
244 cr_clr = (0xf << (sock->
nr * 8));
248 switch (state->
Vcc) {
257 sock->
nr, state->
Vcc);
260 switch (state->
Vpp) {
270 sock->
nr, state->
Vpp);
274 if (((state->
Vcc == 33) && (state->
Vpp == 50)) ||
275 ((state->
Vcc == 50) && (state->
Vpp == 33))) {
284 cr_set |= ((v << 2) | p) << (sock->
nr * 8);
289 if (state->
flags & SS_RESET) {
292 cr_clr |= (1 << (7 + (sock->
nr * 8)));
293 cr_clr |= (1 << (4 + (sock->
nr * 8)));
296 cr_set |= 1 << (7 + (sock->
nr * 8));
297 cr_set |= 1 << (4 + (sock->
nr * 8));
307 if ((changed & SS_RESET) && !(state->
flags & SS_RESET)) {
316 #define GET_VCC(cr, socknr) \
317 ((((cr) >> 2) >> ((socknr) * 8)) & 3)
320 #define GET_VS(sr, socknr) \
321 (((sr) >> (2 * (socknr))) & 3)
324 #define GET_RESET(cr, socknr) \
325 ((cr) & (1 << (7 + (8 * (socknr)))))
331 unsigned short cr,
sr;
334 status = db1x_card_inserted(sock) ?
SS_DETECT : 0;
374 static int db1x_pcmcia_sock_suspend(
struct pcmcia_socket *skt)
379 static int au1x00_pcmcia_set_io_map(
struct pcmcia_socket *skt,
390 static int au1x00_pcmcia_set_mem_map(
struct pcmcia_socket *skt,
404 .init = db1x_pcmcia_sock_init,
405 .suspend = db1x_pcmcia_sock_suspend,
406 .get_status = db1x_pcmcia_get_status,
407 .set_socket = db1x_pcmcia_configure,
408 .set_io_map = au1x00_pcmcia_set_io_map,
409 .set_mem_map = au1x00_pcmcia_set_mem_map,
519 sock->
socket.ops = &db1x_pcmcia_operations;
528 platform_set_drvdata(pdev, sock);
530 ret = db1x_pcmcia_setup_irqs(sock);
546 "(%p) %09llx %09llx card/insert/stschg/eject irqs @ %d "
554 db1x_pcmcia_free_irqs(sock);
566 db1x_pcmcia_free_irqs(sock);
576 .name =
"db1xxx_pcmcia",
579 .probe = db1x_pcmcia_socket_probe,