aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pcmcia')
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c43
-rw-r--r--sound/pcmcia/vx/vxpocket.c47
2 files changed, 38 insertions, 52 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index b4158201e9e6..0431b8b0c1f5 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -57,12 +57,12 @@ static struct snd_card *card_list[SNDRV_CARDS];
57/* 57/*
58 * prototypes 58 * prototypes
59 */ 59 */
60static void pdacf_config(dev_link_t *link); 60static void pdacf_config(struct pcmcia_device *link);
61static void snd_pdacf_detach(struct pcmcia_device *p_dev); 61static void snd_pdacf_detach(struct pcmcia_device *p_dev);
62 62
63static void pdacf_release(dev_link_t *link) 63static void pdacf_release(struct pcmcia_device *link)
64{ 64{
65 pcmcia_disable_device(link->handle); 65 pcmcia_disable_device(link);
66} 66}
67 67
68/* 68/*
@@ -70,7 +70,7 @@ static void pdacf_release(dev_link_t *link)
70 */ 70 */
71static int snd_pdacf_free(struct snd_pdacf *pdacf) 71static int snd_pdacf_free(struct snd_pdacf *pdacf)
72{ 72{
73 dev_link_t *link = pdacf->p_dev; 73 struct pcmcia_device *link = pdacf->p_dev;
74 74
75 pdacf_release(link); 75 pdacf_release(link);
76 76
@@ -90,18 +90,15 @@ static int snd_pdacf_dev_free(struct snd_device *device)
90/* 90/*
91 * snd_pdacf_attach - attach callback for cs 91 * snd_pdacf_attach - attach callback for cs
92 */ 92 */
93static int snd_pdacf_attach(struct pcmcia_device *p_dev) 93static int snd_pdacf_attach(struct pcmcia_device *link)
94{ 94{
95 int i; 95 int i;
96 dev_link_t *link; /* Info for cardmgr */
97 struct snd_pdacf *pdacf; 96 struct snd_pdacf *pdacf;
98 struct snd_card *card; 97 struct snd_card *card;
99 static struct snd_device_ops ops = { 98 static struct snd_device_ops ops = {
100 .dev_free = snd_pdacf_dev_free, 99 .dev_free = snd_pdacf_dev_free,
101 }; 100 };
102 101
103 link = dev_to_instance(p_dev);
104
105 snd_printdd(KERN_DEBUG "pdacf_attach called\n"); 102 snd_printdd(KERN_DEBUG "pdacf_attach called\n");
106 /* find an empty slot from the card list */ 103 /* find an empty slot from the card list */
107 for (i = 0; i < SNDRV_CARDS; i++) { 104 for (i = 0; i < SNDRV_CARDS; i++) {
@@ -135,7 +132,7 @@ static int snd_pdacf_attach(struct pcmcia_device *p_dev)
135 pdacf->index = i; 132 pdacf->index = i;
136 card_list[i] = card; 133 card_list[i] = card;
137 134
138 pdacf->p_dev = p_dev; 135 pdacf->p_dev = link;
139 link->priv = pdacf; 136 link->priv = pdacf;
140 137
141 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 138 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
@@ -201,9 +198,8 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq
201/* 198/*
202 * snd_pdacf_detach - detach callback for cs 199 * snd_pdacf_detach - detach callback for cs
203 */ 200 */
204static void snd_pdacf_detach(struct pcmcia_device *p_dev) 201static void snd_pdacf_detach(struct pcmcia_device *link)
205{ 202{
206 dev_link_t *link = dev_to_instance(p_dev);
207 struct snd_pdacf *chip = link->priv; 203 struct snd_pdacf *chip = link->priv;
208 204
209 snd_printdd(KERN_DEBUG "pdacf_detach called\n"); 205 snd_printdd(KERN_DEBUG "pdacf_detach called\n");
@@ -222,9 +218,8 @@ static void snd_pdacf_detach(struct pcmcia_device *p_dev)
222#define CS_CHECK(fn, ret) \ 218#define CS_CHECK(fn, ret) \
223do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 219do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
224 220
225static void pdacf_config(dev_link_t *link) 221static void pdacf_config(struct pcmcia_device *link)
226{ 222{
227 client_handle_t handle = link->handle;
228 struct snd_pdacf *pdacf = link->priv; 223 struct snd_pdacf *pdacf = link->priv;
229 tuple_t tuple; 224 tuple_t tuple;
230 cisparse_t *parse = NULL; 225 cisparse_t *parse = NULL;
@@ -243,9 +238,9 @@ static void pdacf_config(dev_link_t *link)
243 tuple.TupleDataMax = sizeof(buf); 238 tuple.TupleDataMax = sizeof(buf);
244 tuple.TupleOffset = 0; 239 tuple.TupleOffset = 0;
245 tuple.DesiredTuple = CISTPL_CONFIG; 240 tuple.DesiredTuple = CISTPL_CONFIG;
246 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 241 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
247 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 242 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
248 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, parse)); 243 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
249 link->conf.ConfigBase = parse->config.base; 244 link->conf.ConfigBase = parse->config.base;
250 link->conf.ConfigIndex = 0x5; 245 link->conf.ConfigIndex = 0x5;
251 kfree(parse); 246 kfree(parse);
@@ -253,9 +248,9 @@ static void pdacf_config(dev_link_t *link)
253 /* Configure card */ 248 /* Configure card */
254 link->state |= DEV_CONFIG; 249 link->state |= DEV_CONFIG;
255 250
256 CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io)); 251 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
257 CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 252 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
258 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 253 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
259 254
260 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 255 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
261 goto failed; 256 goto failed;
@@ -265,16 +260,15 @@ static void pdacf_config(dev_link_t *link)
265 return; 260 return;
266 261
267cs_failed: 262cs_failed:
268 cs_error(link->handle, last_fn, last_ret); 263 cs_error(link, last_fn, last_ret);
269failed: 264failed:
270 pcmcia_disable_device(link->handle); 265 pcmcia_disable_device(link);
271} 266}
272 267
273#ifdef CONFIG_PM 268#ifdef CONFIG_PM
274 269
275static int pdacf_suspend(struct pcmcia_device *dev) 270static int pdacf_suspend(struct pcmcia_device *link)
276{ 271{
277 dev_link_t *link = dev_to_instance(dev);
278 struct snd_pdacf *chip = link->priv; 272 struct snd_pdacf *chip = link->priv;
279 273
280 snd_printdd(KERN_DEBUG "SUSPEND\n"); 274 snd_printdd(KERN_DEBUG "SUSPEND\n");
@@ -286,9 +280,8 @@ static int pdacf_suspend(struct pcmcia_device *dev)
286 return 0; 280 return 0;
287} 281}
288 282
289static int pdacf_resume(struct pcmcia_device *dev) 283static int pdacf_resume(struct pcmcia_device *link)
290{ 284{
291 dev_link_t *link = dev_to_instance(dev);
292 struct snd_pdacf *chip = link->priv; 285 struct snd_pdacf *chip = link->priv;
293 286
294 snd_printdd(KERN_DEBUG "RESUME\n"); 287 snd_printdd(KERN_DEBUG "RESUME\n");
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 87ec48c6af28..f6eed4259d17 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -59,9 +59,9 @@ static unsigned int card_alloc;
59 59
60/* 60/*
61 */ 61 */
62static void vxpocket_release(dev_link_t *link) 62static void vxpocket_release(struct pcmcia_device *link)
63{ 63{
64 pcmcia_disable_device(link->handle); 64 pcmcia_disable_device(link);
65} 65}
66 66
67/* 67/*
@@ -127,17 +127,14 @@ static struct snd_vx_hardware vxp440_hw = {
127 * create vxpocket instance 127 * create vxpocket instance
128 */ 128 */
129static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl, 129static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl,
130 struct pcmcia_device *p_dev) 130 struct pcmcia_device *link)
131{ 131{
132 dev_link_t *link; /* Info for cardmgr */
133 struct vx_core *chip; 132 struct vx_core *chip;
134 struct snd_vxpocket *vxp; 133 struct snd_vxpocket *vxp;
135 static struct snd_device_ops ops = { 134 static struct snd_device_ops ops = {
136 .dev_free = snd_vxpocket_dev_free, 135 .dev_free = snd_vxpocket_dev_free,
137 }; 136 };
138 137
139 link = dev_to_instance(p_dev);
140
141 chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops, 138 chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops,
142 sizeof(struct snd_vxpocket) - sizeof(struct vx_core)); 139 sizeof(struct snd_vxpocket) - sizeof(struct vx_core));
143 if (! chip) 140 if (! chip)
@@ -151,7 +148,7 @@ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl,
151 148
152 vxp = (struct snd_vxpocket *)chip; 149 vxp = (struct snd_vxpocket *)chip;
153 150
154 vxp->p_dev = p_dev; 151 vxp->p_dev = link;
155 link->priv = chip; 152 link->priv = chip;
156 153
157 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 154 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
@@ -211,9 +208,8 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq
211#define CS_CHECK(fn, ret) \ 208#define CS_CHECK(fn, ret) \
212do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 209do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
213 210
214static void vxpocket_config(dev_link_t *link) 211static void vxpocket_config(struct pcmcia_device *link)
215{ 212{
216 client_handle_t handle = link->handle;
217 struct vx_core *chip = link->priv; 213 struct vx_core *chip = link->priv;
218 struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; 214 struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
219 tuple_t tuple; 215 tuple_t tuple;
@@ -232,17 +228,17 @@ static void vxpocket_config(dev_link_t *link)
232 tuple.TupleDataMax = sizeof(buf); 228 tuple.TupleDataMax = sizeof(buf);
233 tuple.TupleOffset = 0; 229 tuple.TupleOffset = 0;
234 tuple.DesiredTuple = CISTPL_CONFIG; 230 tuple.DesiredTuple = CISTPL_CONFIG;
235 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 231 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
236 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 232 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
237 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, parse)); 233 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
238 link->conf.ConfigBase = parse->config.base; 234 link->conf.ConfigBase = parse->config.base;
239 link->conf.Present = parse->config.rmask[0]; 235 link->conf.Present = parse->config.rmask[0];
240 236
241 /* redefine hardware record according to the VERSION1 string */ 237 /* redefine hardware record according to the VERSION1 string */
242 tuple.DesiredTuple = CISTPL_VERS_1; 238 tuple.DesiredTuple = CISTPL_VERS_1;
243 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 239 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
244 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 240 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
245 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, parse)); 241 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
246 if (! strcmp(parse->version_1.str + parse->version_1.ofs[1], "VX-POCKET")) { 242 if (! strcmp(parse->version_1.str + parse->version_1.ofs[1], "VX-POCKET")) {
247 snd_printdd("VX-pocket is detected\n"); 243 snd_printdd("VX-pocket is detected\n");
248 } else { 244 } else {
@@ -256,11 +252,11 @@ static void vxpocket_config(dev_link_t *link)
256 /* Configure card */ 252 /* Configure card */
257 link->state |= DEV_CONFIG; 253 link->state |= DEV_CONFIG;
258 254
259 CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io)); 255 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
260 CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 256 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
261 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 257 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
262 258
263 chip->dev = &handle_to_dev(link->handle); 259 chip->dev = &handle_to_dev(link);
264 snd_card_set_dev(chip->card, chip->dev); 260 snd_card_set_dev(chip->card, chip->dev);
265 261
266 if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 262 if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
@@ -272,17 +268,16 @@ static void vxpocket_config(dev_link_t *link)
272 return; 268 return;
273 269
274cs_failed: 270cs_failed:
275 cs_error(link->handle, last_fn, last_ret); 271 cs_error(link, last_fn, last_ret);
276failed: 272failed:
277 pcmcia_disable_device(link->handle); 273 pcmcia_disable_device(link);
278 kfree(parse); 274 kfree(parse);
279} 275}
280 276
281#ifdef CONFIG_PM 277#ifdef CONFIG_PM
282 278
283static int vxp_suspend(struct pcmcia_device *dev) 279static int vxp_suspend(struct pcmcia_device *link)
284{ 280{
285 dev_link_t *link = dev_to_instance(dev);
286 struct vx_core *chip = link->priv; 281 struct vx_core *chip = link->priv;
287 282
288 snd_printdd(KERN_DEBUG "SUSPEND\n"); 283 snd_printdd(KERN_DEBUG "SUSPEND\n");
@@ -294,9 +289,8 @@ static int vxp_suspend(struct pcmcia_device *dev)
294 return 0; 289 return 0;
295} 290}
296 291
297static int vxp_resume(struct pcmcia_device *dev) 292static int vxp_resume(struct pcmcia_device *link)
298{ 293{
299 dev_link_t *link = dev_to_instance(dev);
300 struct vx_core *chip = link->priv; 294 struct vx_core *chip = link->priv;
301 295
302 snd_printdd(KERN_DEBUG "RESUME\n"); 296 snd_printdd(KERN_DEBUG "RESUME\n");
@@ -360,9 +354,8 @@ static int vxpocket_attach(struct pcmcia_device *p_dev)
360 return 0; 354 return 0;
361} 355}
362 356
363static void vxpocket_detach(struct pcmcia_device *p_dev) 357static void vxpocket_detach(struct pcmcia_device *link)
364{ 358{
365 dev_link_t *link = dev_to_instance(p_dev);
366 struct snd_vxpocket *vxp; 359 struct snd_vxpocket *vxp;
367 struct vx_core *chip; 360 struct vx_core *chip;
368 361