diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2008-07-31 15:03:41 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-06 09:39:49 -0400 |
commit | 7779f75f072784d3fccf721b8ec43107f93619a0 (patch) | |
tree | ada616dd3efdea7192aef3cd4ddb743f980bc39b /sound/isa/gus | |
parent | 61ef19d7e771ce021edb0dff0da134b6d688d4aa (diff) |
ALSA: wss_lib: rename cs4321_foo to wss_foo
Rename functions and structures from the former
cs4321_lib to names more corresponding with the
new name: wss_lib.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/isa/gus')
-rw-r--r-- | sound/isa/gus/gusmax.c | 48 | ||||
-rw-r--r-- | sound/isa/gus/interwave.c | 65 |
2 files changed, 64 insertions, 49 deletions
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index cd82891db80a..f94c1976e632 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c | |||
@@ -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 ) \ | 143 | static int __devinit snd_gusmax_mixer(struct snd_wss *chip) |
144 | ((left << 24)|(right << 16)|(shift<<8)|mute) | ||
145 | |||
146 | static 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; |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index eac8cc77e338..5faecfb602d3 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -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 | ||
500 | static struct snd_kcontrol_new snd_interwave_controls[] = { | 500 | static struct snd_kcontrol_new snd_interwave_controls[] = { |
501 | CS4231_DOUBLE("Master Playback Switch", 0, CS4231_LINE_LEFT_OUTPUT, CS4231_LINE_RIGHT_OUTPUT, 7, 7, 1, 1), | 501 | WSS_DOUBLE("Master Playback Switch", 0, |
502 | CS4231_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), |
503 | CS4231_DOUBLE("Mic Playback Switch", 0, CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 7, 7, 1, 1), | 503 | WSS_DOUBLE("Master Playback Volume", 0, |
504 | CS4231_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), |
505 | WSS_DOUBLE("Mic Playback Switch", 0, | ||
506 | CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 7, 7, 1, 1), | ||
507 | WSS_DOUBLE("Mic Playback Volume", 0, | ||
508 | CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 0, 0, 31, 1) | ||
505 | }; | 509 | }; |
506 | 510 | ||
507 | static int __devinit snd_interwave_mixer(struct snd_cs4231 *chip) | 511 | static 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 | } |