ALSA: hda - enable SPDIF output for Intel DX58SO board
[safe/jmp/linux-2.6] / sound / pci / sonicvibes.c
index 2d66a09..cd408b8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Driver for S3 SonicVibes soundcard
- *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  *
  *  BUGS:
  *    It looks like 86c617 rev 3 doesn't supports DDMA buffers above 16MB?
@@ -22,7 +22,6 @@
  *
  */
 
-#include <sound/driver.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -42,7 +41,7 @@
 
 #include <asm/io.h>
 
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
 MODULE_DESCRIPTION("S3 SonicVibes PCI");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}");
@@ -54,8 +53,8 @@ MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}");
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;     /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;      /* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;     /* Enable this card */
-static int reverb[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
-static int mge[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int reverb[SNDRV_CARDS];
+static int mge[SNDRV_CARDS];
 static unsigned int dmaio = 0x7a00;    /* DDMA i/o address */
 
 module_param_array(index, int, NULL, 0444);
@@ -535,8 +534,8 @@ static int snd_sonicvibes_hw_constraint_dac_rate(struct snd_pcm_hw_params *param
                        params->rate_den = 1;
                } else {
                        snd_sonicvibes_pll(rate, &r, &m, &n);
-                       snd_assert((SV_REFFREQUENCY % 16) == 0, return -EINVAL);
-                       snd_assert((SV_ADCMULT % 512) == 0, return -EINVAL);
+                       snd_BUG_ON(SV_REFFREQUENCY % 16);
+                       snd_BUG_ON(SV_ADCMULT % 512);
                        params->rate_num = (SV_REFFREQUENCY/16) * (n+2) * r;
                        params->rate_den = (SV_ADCMULT/512) * (m+2);
                }
@@ -580,7 +579,7 @@ static int snd_sonicvibes_trigger(struct sonicvibes * sonic, int what, int cmd)
        return result;
 }
 
-static irqreturn_t snd_sonicvibes_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_sonicvibes_interrupt(int irq, void *dev_id)
 {
        struct sonicvibes *sonic = dev_id;
        unsigned char status;
@@ -601,7 +600,7 @@ static irqreturn_t snd_sonicvibes_interrupt(int irq, void *dev_id, struct pt_reg
        }
        if (sonic->rmidi) {
                if (status & SV_MIDI_IRQ)
-                       snd_mpu401_uart_interrupt(irq, sonic->rmidi->private_data, regs);
+                       snd_mpu401_uart_interrupt(irq, sonic->rmidi->private_data);
        }
        if (status & SV_UD_IRQ) {
                unsigned char udreg;
@@ -850,7 +849,8 @@ static int __devinit snd_sonicvibes_pcm(struct sonicvibes * sonic, int device, s
 
        if ((err = snd_pcm_new(sonic->card, "s3_86c617", device, 1, 1, &pcm)) < 0)
                return err;
-       snd_assert(pcm != NULL, return -EINVAL);
+       if (snd_BUG_ON(!pcm))
+               return -EINVAL;
 
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sonicvibes_playback_ops);
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sonicvibes_capture_ops);
@@ -1090,7 +1090,8 @@ static int __devinit snd_sonicvibes_mixer(struct sonicvibes * sonic)
        unsigned int idx;
        int err;
 
-       snd_assert(sonic != NULL && sonic->card != NULL, return -EINVAL);
+       if (snd_BUG_ON(!sonic || !sonic->card))
+               return -EINVAL;
        card = sonic->card;
        strcpy(card->mixername, "S3 SonicVibes");
 
@@ -1144,7 +1145,7 @@ static void __devinit snd_sonicvibes_proc_init(struct sonicvibes * sonic)
        struct snd_info_entry *entry;
 
        if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry))
-               snd_info_set_text_ops(entry, sonic, 1024, snd_sonicvibes_proc_read);
+               snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read);
 }
 
 /*
@@ -1195,7 +1196,7 @@ static int snd_sonicvibes_free(struct sonicvibes *sonic)
        pci_write_config_dword(sonic->pci, 0x40, sonic->dmaa_port);
        pci_write_config_dword(sonic->pci, 0x48, sonic->dmac_port);
        if (sonic->irq >= 0)
-               free_irq(sonic->irq, (void *)sonic);
+               free_irq(sonic->irq, sonic);
        release_and_free_resource(sonic->res_dmaa);
        release_and_free_resource(sonic->res_dmac);
        pci_release_regions(sonic->pci);
@@ -1257,7 +1258,8 @@ static int __devinit snd_sonicvibes_create(struct snd_card *card,
        sonic->midi_port = pci_resource_start(pci, 3);
        sonic->game_port = pci_resource_start(pci, 4);
 
-       if (request_irq(pci->irq, snd_sonicvibes_interrupt, SA_INTERRUPT|SA_SHIRQ, "S3 SonicVibes", (void *)sonic)) {
+       if (request_irq(pci->irq, snd_sonicvibes_interrupt, IRQF_SHARED,
+                       "S3 SonicVibes", sonic)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_sonicvibes_free(sonic);
                return -EBUSY;
@@ -1441,10 +1443,10 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
 
        strcpy(card->driver, "SonicVibes");
        strcpy(card->shortname, "S3 SonicVibes");
-       sprintf(card->longname, "%s rev %i at 0x%lx, irq %i",
+       sprintf(card->longname, "%s rev %i at 0x%llx, irq %i",
                card->shortname,
                sonic->revision,
-               pci_resource_start(pci, 1),
+               (unsigned long long)pci_resource_start(pci, 1),
                sonic->irq);
 
        if ((err = snd_sonicvibes_pcm(sonic, 0, NULL)) < 0) {
@@ -1456,7 +1458,7 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
                return err;
        }
        if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES,
-                                      sonic->midi_port, 1,
+                                      sonic->midi_port, MPU401_INFO_INTEGRATED,
                                       sonic->irq, 0,
                                       &midi_uart)) < 0) {
                snd_card_free(card);