aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/sedlbauer_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/sedlbauer_cs.c')
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 9e5c4fd08671..360204bc2777 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -63,26 +63,9 @@ MODULE_LICENSE("Dual MPL/GPL");
63static int protocol = 2; /* EURO-ISDN Default */ 63static int protocol = 2; /* EURO-ISDN Default */
64module_param(protocol, int, 0); 64module_param(protocol, int, 0);
65 65
66/*====================================================================*/
67
68/*
69 The event() function is this driver's Card Services event handler.
70 It will be called by Card Services when an appropriate card status
71 event is received. The config() and release() entry points are
72 used to configure or release a socket, in response to card
73 insertion and ejection events. They are invoked from the sedlbauer
74 event handler.
75*/
76
77static int sedlbauer_config(struct pcmcia_device *link) __devinit ; 66static int sedlbauer_config(struct pcmcia_device *link) __devinit ;
78static void sedlbauer_release(struct pcmcia_device *link); 67static void sedlbauer_release(struct pcmcia_device *link);
79 68
80/*
81 The attach() and detach() entry points are used to create and destroy
82 "instances" of the driver, where each instance represents everything
83 needed to manage one actual PCMCIA card.
84*/
85
86static void sedlbauer_detach(struct pcmcia_device *p_dev) __devexit; 69static void sedlbauer_detach(struct pcmcia_device *p_dev) __devexit;
87 70
88typedef struct local_info_t { 71typedef struct local_info_t {
@@ -91,18 +74,6 @@ typedef struct local_info_t {
91 int cardnr; 74 int cardnr;
92} local_info_t; 75} local_info_t;
93 76
94/*======================================================================
95
96 sedlbauer_attach() creates an "instance" of the driver, allocating
97 local data structures for one device. The device is registered
98 with Card Services.
99
100 The dev_link structure is initialized, but we don't actually
101 configure the card at this point -- we wait until we receive a
102 card insertion event.
103
104======================================================================*/
105
106static int __devinit sedlbauer_probe(struct pcmcia_device *link) 77static int __devinit sedlbauer_probe(struct pcmcia_device *link)
107{ 78{
108 local_info_t *local; 79 local_info_t *local;
@@ -117,30 +88,9 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)
117 local->p_dev = link; 88 local->p_dev = link;
118 link->priv = local; 89 link->priv = local;
119 90
120 /*
121 General socket configuration defaults can go here. In this
122 client, we assume very little, and rely on the CIS for almost
123 everything. In most clients, many details (i.e., number, sizes,
124 and attributes of IO windows) are fixed by the nature of the
125 device, and can be hard-wired here.
126 */
127
128 /* from old sedl_cs
129 */
130 /* The io structure describes IO port mapping */
131
132 return sedlbauer_config(link); 91 return sedlbauer_config(link);
133} /* sedlbauer_attach */ 92} /* sedlbauer_attach */
134 93
135/*======================================================================
136
137 This deletes a driver "instance". The device is de-registered
138 with Card Services. If it has been released, all local data
139 structures are freed. Otherwise, the structures will be freed
140 when the device is released.
141
142======================================================================*/
143
144static void __devexit sedlbauer_detach(struct pcmcia_device *link) 94static void __devexit sedlbauer_detach(struct pcmcia_device *link)
145{ 95{
146 dev_dbg(&link->dev, "sedlbauer_detach(0x%p)\n", link); 96 dev_dbg(&link->dev, "sedlbauer_detach(0x%p)\n", link);
@@ -152,13 +102,6 @@ static void __devexit sedlbauer_detach(struct pcmcia_device *link)
152 kfree(link->priv); 102 kfree(link->priv);
153} /* sedlbauer_detach */ 103} /* sedlbauer_detach */
154 104
155/*======================================================================
156
157 sedlbauer_config() is scheduled to run after a CARD_INSERTION event
158 is received, to configure the PCMCIA socket, and to make the
159 device available to the system.
160
161======================================================================*/
162static int sedlbauer_config_check(struct pcmcia_device *p_dev, void *priv_data) 105static int sedlbauer_config_check(struct pcmcia_device *p_dev, void *priv_data)
163{ 106{
164 if (p_dev->config_index == 0) 107 if (p_dev->config_index == 0)
@@ -168,8 +111,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, void *priv_data)
168 return pcmcia_request_io(p_dev); 111 return pcmcia_request_io(p_dev);
169} 112}
170 113
171
172
173static int __devinit sedlbauer_config(struct pcmcia_device *link) 114static int __devinit sedlbauer_config(struct pcmcia_device *link)
174{ 115{
175 int ret; 116 int ret;
@@ -180,27 +121,10 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link)
180 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC | 121 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC |
181 CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO | CONF_AUTO_SET_IO; 122 CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO | CONF_AUTO_SET_IO;
182 123
183 /*
184 In this loop, we scan the CIS for configuration table entries,
185 each of which describes a valid card configuration, including
186 voltage, IO window, memory window, and interrupt settings.
187
188 We make no assumptions about the card to be configured: we use
189 just the information available in the CIS. In an ideal world,
190 this would work for any PCMCIA card, but it requires a complete
191 and accurate CIS. In practice, a driver usually "knows" most of
192 these things without consulting the CIS, and most client drivers
193 will only use the CIS to fill in implementation-defined details.
194 */
195 ret = pcmcia_loop_config(link, sedlbauer_config_check, NULL); 124 ret = pcmcia_loop_config(link, sedlbauer_config_check, NULL);
196 if (ret) 125 if (ret)
197 goto failed; 126 goto failed;
198 127
199 /*
200 This actually configures the PCMCIA socket -- setting up
201 the I/O windows and the interrupt mapping, and putting the
202 card and host interface into "Memory and IO" mode.
203 */
204 ret = pcmcia_enable_device(link); 128 ret = pcmcia_enable_device(link);
205 if (ret) 129 if (ret)
206 goto failed; 130 goto failed;
@@ -228,14 +152,6 @@ failed:
228 152
229} /* sedlbauer_config */ 153} /* sedlbauer_config */
230 154
231/*======================================================================
232
233 After a card is removed, sedlbauer_release() will unregister the
234 device, and release the PCMCIA configuration. If the device is
235 still open, this will be postponed until it is closed.
236
237======================================================================*/
238
239static void sedlbauer_release(struct pcmcia_device *link) 155static void sedlbauer_release(struct pcmcia_device *link)
240{ 156{
241 local_info_t *local = link->priv; 157 local_info_t *local = link->priv;