V4L/DVB (13534): ir-common: Remove some unused fields/structs
[safe/jmp/linux-2.6] / sound / isa / gus / gusmax.c
index 4922f5d..f26eac8 100644 (file)
@@ -19,7 +19,6 @@
  *
  */
 
-#include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/err.h>
 #include <linux/isa.h>
@@ -29,7 +28,7 @@
 #include <asm/dma.h>
 #include <sound/core.h>
 #include <sound/gus.h>
-#include <sound/cs4231.h>
+#include <sound/wss.h>
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
 #include <sound/initval.h>
@@ -76,7 +75,7 @@ struct snd_gusmax {
        int irq;
        struct snd_card *card;
        struct snd_gus_card *gus;
-       struct snd_cs4231 *cs4231;
+       struct snd_wss *wss;
        unsigned short gus_status_reg;
        unsigned short pcm_status_reg;
 };
@@ -118,7 +117,7 @@ static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id)
                }
                if (inb(maxcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */
                        handled = 1;
-                       snd_cs4231_interrupt(irq, maxcard->cs4231);
+                       snd_wss_interrupt(irq, maxcard->wss);
                        loop++;
                }
        } while (loop && --max > 0);
@@ -141,10 +140,7 @@ static void __devinit snd_gusmax_init(int dev, struct snd_card *card,
        outb(gus->max_cntrl_val, GUSP(gus, MAXCNTRLPORT));
 }
 
-#define CS4231_PRIVATE( left, right, shift, mute ) \
-                       ((left << 24)|(right << 16)|(shift<<8)|mute)
-
-static int __devinit snd_gusmax_mixer(struct snd_cs4231 *chip)
+static int __devinit snd_gusmax_mixer(struct snd_wss *chip)
 {
        struct snd_card *card = chip->card;
        struct snd_ctl_elem_id id1, id2;
@@ -215,13 +211,13 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
        int xirq, xdma1, xdma2, err;
        struct snd_card *card;
        struct snd_gus_card *gus = NULL;
-       struct snd_cs4231 *cs4231;
+       struct snd_wss *wss;
        struct snd_gusmax *maxcard;
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct snd_gusmax));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct snd_gusmax), &card);
+       if (err < 0)
+               return err;
        card->private_free = snd_gusmax_free;
        maxcard = (struct snd_gusmax *)card->private_data;
        maxcard->card = card;
@@ -302,33 +298,39 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
        }
        maxcard->irq = xirq;
        
-       if ((err = snd_cs4231_create(card,
-                                    gus->gf1.port + 0x10c, -1, xirq,
-                                    xdma2 < 0 ? xdma1 : xdma2, xdma1,
-                                    CS4231_HW_DETECT,
-                                    CS4231_HWSHARE_IRQ |
-                                    CS4231_HWSHARE_DMA1 |
-                                    CS4231_HWSHARE_DMA2,
-                                    &cs4231)) < 0)
+       err = snd_wss_create(card,
+                            gus->gf1.port + 0x10c, -1, xirq,
+                            xdma2 < 0 ? xdma1 : xdma2, xdma1,
+                            WSS_HW_DETECT,
+                            WSS_HWSHARE_IRQ |
+                            WSS_HWSHARE_DMA1 |
+                            WSS_HWSHARE_DMA2,
+                            &wss);
+       if (err < 0)
                goto _err;
 
-       if ((err = snd_cs4231_pcm(cs4231, 0, NULL)) < 0)
+       err = snd_wss_pcm(wss, 0, NULL);
+       if (err < 0)
                goto _err;
 
-       if ((err = snd_cs4231_mixer(cs4231)) < 0)
+       err = snd_wss_mixer(wss);
+       if (err < 0)
                goto _err;
 
-       if ((err = snd_cs4231_timer(cs4231, 2, NULL)) < 0)
+       err = snd_wss_timer(wss, 2, NULL);
+       if (err < 0)
                goto _err;
 
        if (pcm_channels[dev] > 0) {
                if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0)
                        goto _err;
        }
-       if ((err = snd_gusmax_mixer(cs4231)) < 0)
+       err = snd_gusmax_mixer(wss);
+       if (err < 0)
                goto _err;
 
-       if ((err = snd_gf1_rawmidi_new(gus, 0, NULL)) < 0)
+       err = snd_gf1_rawmidi_new(gus, 0, NULL);
+       if (err < 0)
                goto _err;
 
        sprintf(card->longname + strlen(card->longname), " at 0x%lx, irq %i, dma %i", gus->gf1.port, xirq, xdma1);
@@ -337,11 +339,12 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
 
        snd_card_set_dev(card, pdev);
 
-       if ((err = snd_card_register(card)) < 0)
+       err = snd_card_register(card);
+       if (err < 0)
                goto _err;
                
        maxcard->gus = gus;
-       maxcard->cs4231 = cs4231;
+       maxcard->wss = wss;
 
        dev_set_drvdata(pdev, card);
        return 0;