aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus/gusmax.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/gus/gusmax.c')
-rw-r--r--sound/isa/gus/gusmax.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index f87c6236661c..f94c1976e632 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -28,7 +28,7 @@
28#include <asm/dma.h> 28#include <asm/dma.h>
29#include <sound/core.h> 29#include <sound/core.h>
30#include <sound/gus.h> 30#include <sound/gus.h>
31#include <sound/cs4231.h> 31#include <sound/wss.h>
32#define SNDRV_LEGACY_FIND_FREE_IRQ 32#define SNDRV_LEGACY_FIND_FREE_IRQ
33#define SNDRV_LEGACY_FIND_FREE_DMA 33#define SNDRV_LEGACY_FIND_FREE_DMA
34#include <sound/initval.h> 34#include <sound/initval.h>
@@ -75,7 +75,7 @@ struct snd_gusmax {
75 int irq; 75 int irq;
76 struct snd_card *card; 76 struct snd_card *card;
77 struct snd_gus_card *gus; 77 struct snd_gus_card *gus;
78 struct snd_cs4231 *cs4231; 78 struct snd_wss *wss;
79 unsigned short gus_status_reg; 79 unsigned short gus_status_reg;
80 unsigned short pcm_status_reg; 80 unsigned short pcm_status_reg;
81}; 81};
@@ -117,7 +117,7 @@ static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id)
117 } 117 }
118 if (inb(maxcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ 118 if (inb(maxcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */
119 handled = 1; 119 handled = 1;
120 snd_cs4231_interrupt(irq, maxcard->cs4231); 120 snd_wss_interrupt(irq, maxcard->wss);
121 loop++; 121 loop++;
122 } 122 }
123 } while (loop && --max > 0); 123 } while (loop && --max > 0);
@@ -140,10 +140,7 @@ static void __devinit snd_gusmax_init(int dev, struct snd_card *card,
140 outb(gus->max_cntrl_val, GUSP(gus, MAXCNTRLPORT)); 140 outb(gus->max_cntrl_val, GUSP(gus, MAXCNTRLPORT));
141} 141}
142 142
143#define CS4231_PRIVATE( left, right, shift, mute ) \ 143static int __devinit snd_gusmax_mixer(struct snd_wss *chip)
144 ((left << 24)|(right << 16)|(shift<<8)|mute)
145
146static int __devinit snd_gusmax_mixer(struct snd_cs4231 *chip)
147{ 144{
148 struct snd_card *card = chip->card; 145 struct snd_card *card = chip->card;
149 struct snd_ctl_elem_id id1, id2; 146 struct snd_ctl_elem_id id1, id2;
@@ -214,7 +211,7 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
214 int xirq, xdma1, xdma2, err; 211 int xirq, xdma1, xdma2, err;
215 struct snd_card *card; 212 struct snd_card *card;
216 struct snd_gus_card *gus = NULL; 213 struct snd_gus_card *gus = NULL;
217 struct snd_cs4231 *cs4231; 214 struct snd_wss *wss;
218 struct snd_gusmax *maxcard; 215 struct snd_gusmax *maxcard;
219 216
220 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 217 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
@@ -301,33 +298,39 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
301 } 298 }
302 maxcard->irq = xirq; 299 maxcard->irq = xirq;
303 300
304 if ((err = snd_cs4231_create(card, 301 err = snd_wss_create(card,
305 gus->gf1.port + 0x10c, -1, xirq, 302 gus->gf1.port + 0x10c, -1, xirq,
306 xdma2 < 0 ? xdma1 : xdma2, xdma1, 303 xdma2 < 0 ? xdma1 : xdma2, xdma1,
307 CS4231_HW_DETECT, 304 WSS_HW_DETECT,
308 CS4231_HWSHARE_IRQ | 305 WSS_HWSHARE_IRQ |
309 CS4231_HWSHARE_DMA1 | 306 WSS_HWSHARE_DMA1 |
310 CS4231_HWSHARE_DMA2, 307 WSS_HWSHARE_DMA2,
311 &cs4231)) < 0) 308 &wss);
309 if (err < 0)
312 goto _err; 310 goto _err;
313 311
314 if ((err = snd_cs4231_pcm(cs4231, 0, NULL)) < 0) 312 err = snd_wss_pcm(wss, 0, NULL);
313 if (err < 0)
315 goto _err; 314 goto _err;
316 315
317 if ((err = snd_cs4231_mixer(cs4231)) < 0) 316 err = snd_wss_mixer(wss);
317 if (err < 0)
318 goto _err; 318 goto _err;
319 319
320 if ((err = snd_cs4231_timer(cs4231, 2, NULL)) < 0) 320 err = snd_wss_timer(wss, 2, NULL);
321 if (err < 0)
321 goto _err; 322 goto _err;
322 323
323 if (pcm_channels[dev] > 0) { 324 if (pcm_channels[dev] > 0) {
324 if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0) 325 if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0)
325 goto _err; 326 goto _err;
326 } 327 }
327 if ((err = snd_gusmax_mixer(cs4231)) < 0) 328 err = snd_gusmax_mixer(wss);
329 if (err < 0)
328 goto _err; 330 goto _err;
329 331
330 if ((err = snd_gf1_rawmidi_new(gus, 0, NULL)) < 0) 332 err = snd_gf1_rawmidi_new(gus, 0, NULL);
333 if (err < 0)
331 goto _err; 334 goto _err;
332 335
333 sprintf(card->longname + strlen(card->longname), " at 0x%lx, irq %i, dma %i", gus->gf1.port, xirq, xdma1); 336 sprintf(card->longname + strlen(card->longname), " at 0x%lx, irq %i, dma %i", gus->gf1.port, xirq, xdma1);
@@ -336,11 +339,12 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
336 339
337 snd_card_set_dev(card, pdev); 340 snd_card_set_dev(card, pdev);
338 341
339 if ((err = snd_card_register(card)) < 0) 342 err = snd_card_register(card);
343 if (err < 0)
340 goto _err; 344 goto _err;
341 345
342 maxcard->gus = gus; 346 maxcard->gus = gus;
343 maxcard->cs4231 = cs4231; 347 maxcard->wss = wss;
344 348
345 dev_set_drvdata(pdev, card); 349 dev_set_drvdata(pdev, card);
346 return 0; 350 return 0;