2 * drivers/pcmcia/sa1100_system3.c
4 * PT Diagital Board PCMCIA specific routines
6 * Copyright (C) 2001 Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
8 * $Id: sa1100_system3.c,v 1.1.4.2 2002/02/25 13:56:45 seletz Exp $
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * $Log: sa1100_system3.c,v $
15 * Revision 1.1.4.2 2002/02/25 13:56:45 seletz
17 * - setup interrupts for CF card only ATM
19 * Revision 1.1.4.1 2002/02/14 02:23:27 seletz
20 * - 2.5.2-rmk6 PCMCIA changes
22 * Revision 1.1.2.1 2002/02/13 23:49:33 seletz
23 * - added from 2.4.16-rmk2
28 #include <linux/module.h>
29 #include <linux/kernel.h>
30 #include <linux/sched.h>
31 #include <linux/init.h>
32 #include <linux/device.h>
33 #include <linux/ioport.h>
35 #include <asm/hardware.h>
36 #include <asm/mach-types.h>
38 #include <asm/hardware/sa1111.h>
40 #include "sa1111_generic.h"
45 # define DPRINTK( x, args... ) printk( "%s: line %d: "x, __FUNCTION__, __LINE__, ## args );
47 # define DPRINTK( x, args... ) /* nix */
50 static int system3_pcmcia_hw_init(struct sa1100_pcmcia_socket
*skt
)
52 skt
->irq
= skt
->nr
? IRQ_S1_READY_NINT
: IRQ_S0_READY_NINT
;
54 /* Don't need no CD and BVD* interrupts */
58 void system3_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket
*skt
)
63 system3_pcmcia_socket_state(struct sa1100_pcmcia_socket
*skt
, struct pcmcia_state
*state
)
65 unsigned long status
= PCSR
;
68 #if 0 /* PCMCIA socket not yet connected */
70 state
->detect
= status
& PCSR_S0_DETECT
? 0 : 1;
71 state
->ready
= status
& PCSR_S0_READY
? 1 : 0;
72 state
->bvd1
= status
& PCSR_S0_BVD1
? 1 : 0;
74 state
->wrprot
= status
& PCSR_S0_WP
? 1 : 0;
81 state
->detect
= status
& PCSR_S1_DETECT
? 0 : 1;
82 state
->ready
= status
& PCSR_S1_READY
? 1 : 0;
83 state
->bvd1
= status
& PCSR_S1_BVD1
? 1 : 0;
85 state
->wrprot
= status
& PCSR_S1_WP
? 1 : 0;
91 DPRINTK("Sock %d PCSR=0x%08lx, Sx_RDY_nIREQ=%d\n",
92 skt
->nr
, status
, state
->ready
);
95 struct pcmcia_low_level system3_pcmcia_ops
= {
97 .init
= system3_pcmcia_hw_init
,
98 .shutdown
= system3_pcmcia_hw_shutdown
,
99 .socket_state
= system3_pcmcia_socket_state
,
100 .configure_socket
= sa1111_pcmcia_configure_socket
,
102 .socket_init
= sa1111_pcmcia_socket_init
,
103 .socket_suspend
= sa1111_pcmcia_socket_suspend
,
106 int __init
pcmcia_system3_init(struct device
*dev
)
110 if (machine_is_pt_system3())
112 ret
= sa11xx_drv_pcmcia_probe(dev
, &system3_pcmcia_ops
, 1, 1);