aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus/interwave.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/gus/interwave.c')
-rw-r--r--sound/isa/gus/interwave.c67
1 files changed, 39 insertions, 28 deletions
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index ca0d7ace0c75..5faecfb602d3 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -32,7 +32,7 @@
32#include <asm/dma.h> 32#include <asm/dma.h>
33#include <sound/core.h> 33#include <sound/core.h>
34#include <sound/gus.h> 34#include <sound/gus.h>
35#include <sound/cs4231.h> 35#include <sound/wss.h>
36#ifdef SNDRV_STB 36#ifdef SNDRV_STB
37#include <sound/tea6330t.h> 37#include <sound/tea6330t.h>
38#endif 38#endif
@@ -118,7 +118,7 @@ struct snd_interwave {
118 int irq; 118 int irq;
119 struct snd_card *card; 119 struct snd_card *card;
120 struct snd_gus_card *gus; 120 struct snd_gus_card *gus;
121 struct snd_cs4231 *cs4231; 121 struct snd_wss *wss;
122#ifdef SNDRV_STB 122#ifdef SNDRV_STB
123 struct resource *i2c_res; 123 struct resource *i2c_res;
124#endif 124#endif
@@ -312,7 +312,7 @@ static irqreturn_t snd_interwave_interrupt(int irq, void *dev_id)
312 } 312 }
313 if (inb(iwcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ 313 if (inb(iwcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */
314 handled = 1; 314 handled = 1;
315 snd_cs4231_interrupt(irq, iwcard->cs4231); 315 snd_wss_interrupt(irq, iwcard->wss);
316 loop++; 316 loop++;
317 } 317 }
318 } while (loop && --max > 0); 318 } while (loop && --max > 0);
@@ -498,13 +498,17 @@ static void __devinit snd_interwave_init(int dev, struct snd_gus_card * gus)
498} 498}
499 499
500static struct snd_kcontrol_new snd_interwave_controls[] = { 500static struct snd_kcontrol_new snd_interwave_controls[] = {
501CS4231_DOUBLE("Master Playback Switch", 0, CS4231_LINE_LEFT_OUTPUT, CS4231_LINE_RIGHT_OUTPUT, 7, 7, 1, 1), 501WSS_DOUBLE("Master Playback Switch", 0,
502CS4231_DOUBLE("Master Playback Volume", 0, CS4231_LINE_LEFT_OUTPUT, CS4231_LINE_RIGHT_OUTPUT, 0, 0, 31, 1), 502 CS4231_LINE_LEFT_OUTPUT, CS4231_LINE_RIGHT_OUTPUT, 7, 7, 1, 1),
503CS4231_DOUBLE("Mic Playback Switch", 0, CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 7, 7, 1, 1), 503WSS_DOUBLE("Master Playback Volume", 0,
504CS4231_DOUBLE("Mic Playback Volume", 0, CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 0, 0, 31, 1) 504 CS4231_LINE_LEFT_OUTPUT, CS4231_LINE_RIGHT_OUTPUT, 0, 0, 31, 1),
505WSS_DOUBLE("Mic Playback Switch", 0,
506 CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 7, 7, 1, 1),
507WSS_DOUBLE("Mic Playback Volume", 0,
508 CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 0, 0, 31, 1)
505}; 509};
506 510
507static int __devinit snd_interwave_mixer(struct snd_cs4231 *chip) 511static int __devinit snd_interwave_mixer(struct snd_wss *chip)
508{ 512{
509 struct snd_card *card = chip->card; 513 struct snd_card *card = chip->card;
510 struct snd_ctl_elem_id id1, id2; 514 struct snd_ctl_elem_id id1, id2;
@@ -527,10 +531,10 @@ static int __devinit snd_interwave_mixer(struct snd_cs4231 *chip)
527 for (idx = 0; idx < ARRAY_SIZE(snd_interwave_controls); idx++) 531 for (idx = 0; idx < ARRAY_SIZE(snd_interwave_controls); idx++)
528 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_interwave_controls[idx], chip))) < 0) 532 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_interwave_controls[idx], chip))) < 0)
529 return err; 533 return err;
530 snd_cs4231_out(chip, CS4231_LINE_LEFT_OUTPUT, 0x9f); 534 snd_wss_out(chip, CS4231_LINE_LEFT_OUTPUT, 0x9f);
531 snd_cs4231_out(chip, CS4231_LINE_RIGHT_OUTPUT, 0x9f); 535 snd_wss_out(chip, CS4231_LINE_RIGHT_OUTPUT, 0x9f);
532 snd_cs4231_out(chip, CS4231_LEFT_MIC_INPUT, 0x9f); 536 snd_wss_out(chip, CS4231_LEFT_MIC_INPUT, 0x9f);
533 snd_cs4231_out(chip, CS4231_RIGHT_MIC_INPUT, 0x9f); 537 snd_wss_out(chip, CS4231_RIGHT_MIC_INPUT, 0x9f);
534 /* reassign AUXA to SYNTHESIZER */ 538 /* reassign AUXA to SYNTHESIZER */
535 strcpy(id1.name, "Aux Playback Switch"); 539 strcpy(id1.name, "Aux Playback Switch");
536 strcpy(id2.name, "Synth Playback Switch"); 540 strcpy(id2.name, "Synth Playback Switch");
@@ -642,7 +646,7 @@ static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
642{ 646{
643 int xirq, xdma1, xdma2; 647 int xirq, xdma1, xdma2;
644 struct snd_interwave *iwcard = card->private_data; 648 struct snd_interwave *iwcard = card->private_data;
645 struct snd_cs4231 *cs4231; 649 struct snd_wss *wss;
646 struct snd_gus_card *gus; 650 struct snd_gus_card *gus;
647#ifdef SNDRV_STB 651#ifdef SNDRV_STB
648 struct snd_i2c_bus *i2c_bus; 652 struct snd_i2c_bus *i2c_bus;
@@ -684,33 +688,39 @@ static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
684 } 688 }
685 iwcard->irq = xirq; 689 iwcard->irq = xirq;
686 690
687 if ((err = snd_cs4231_create(card, 691 err = snd_wss_create(card,
688 gus->gf1.port + 0x10c, -1, xirq, 692 gus->gf1.port + 0x10c, -1, xirq,
689 xdma2 < 0 ? xdma1 : xdma2, xdma1, 693 xdma2 < 0 ? xdma1 : xdma2, xdma1,
690 CS4231_HW_INTERWAVE, 694 WSS_HW_INTERWAVE,
691 CS4231_HWSHARE_IRQ | 695 WSS_HWSHARE_IRQ |
692 CS4231_HWSHARE_DMA1 | 696 WSS_HWSHARE_DMA1 |
693 CS4231_HWSHARE_DMA2, 697 WSS_HWSHARE_DMA2,
694 &cs4231)) < 0) 698 &wss);
699 if (err < 0)
695 return err; 700 return err;
696 701
697 if ((err = snd_cs4231_pcm(cs4231, 0, &pcm)) < 0) 702 err = snd_wss_pcm(wss, 0, &pcm);
703 if (err < 0)
698 return err; 704 return err;
699 705
700 sprintf(pcm->name + strlen(pcm->name), " rev %c", gus->revision + 'A'); 706 sprintf(pcm->name + strlen(pcm->name), " rev %c", gus->revision + 'A');
701 strcat(pcm->name, " (codec)"); 707 strcat(pcm->name, " (codec)");
702 708
703 if ((err = snd_cs4231_timer(cs4231, 2, NULL)) < 0) 709 err = snd_wss_timer(wss, 2, NULL);
710 if (err < 0)
704 return err; 711 return err;
705 712
706 if ((err = snd_cs4231_mixer(cs4231)) < 0) 713 err = snd_wss_mixer(wss);
714 if (err < 0)
707 return err; 715 return err;
708 716
709 if (pcm_channels[dev] > 0) { 717 if (pcm_channels[dev] > 0) {
710 if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0) 718 err = snd_gf1_pcm_new(gus, 1, 1, NULL);
719 if (err < 0)
711 return err; 720 return err;
712 } 721 }
713 if ((err = snd_interwave_mixer(cs4231)) < 0) 722 err = snd_interwave_mixer(wss);
723 if (err < 0)
714 return err; 724 return err;
715 725
716#ifdef SNDRV_STB 726#ifdef SNDRV_STB
@@ -754,10 +764,11 @@ static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
754 if (xdma2 >= 0) 764 if (xdma2 >= 0)
755 sprintf(card->longname + strlen(card->longname), "&%d", xdma2); 765 sprintf(card->longname + strlen(card->longname), "&%d", xdma2);
756 766
757 if ((err = snd_card_register(card)) < 0) 767 err = snd_card_register(card);
768 if (err < 0)
758 return err; 769 return err;
759 770
760 iwcard->cs4231 = cs4231; 771 iwcard->wss = wss;
761 iwcard->gus = gus; 772 iwcard->gus = gus;
762 return 0; 773 return 0;
763} 774}