]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[ALSA] oxygen: remove MIDI autodetection
authorClemens Ladisch <clemens@ladisch.de>
Mon, 21 Jan 2008 07:45:37 +0000 (08:45 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Jan 2008 16:30:06 +0000 (17:30 +0100)
The MIDI bit in the MISC register is set by default and cannot be used
to detect the presence of a MIDI port.  Instead, add a parameter to the
oxygen_pci_probe() function so that model drivers can specify this.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/pci/oxygen/oxygen.c
sound/pci/oxygen/oxygen.h
sound/pci/oxygen/oxygen_lib.c
sound/pci/oxygen/virtuoso.c

index e0e54ab51e5c7efb2f00f733a535d127097e62a8..b11341f01c1dd80a181eba492191c86570faeffa 100644 (file)
@@ -327,7 +327,7 @@ static int __devinit generic_oxygen_probe(struct pci_dev *pci,
                return -ENOENT;
        }
        model = pci_id->driver_data ? &model_meridian : &model_generic;
-       err = oxygen_pci_probe(pci, index[dev], id[dev], model);
+       err = oxygen_pci_probe(pci, index[dev], id[dev], 1, model);
        if (err >= 0)
                ++dev;
        return err;
index 98cccc6ce9dc55e2d908be465c37273b6a4adf52..1c402cbc1c37ac1110f8a7529597084f42b04dd2 100644 (file)
@@ -92,7 +92,7 @@ struct oxygen_model {
 
 /* oxygen_lib.c */
 
-int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
+int oxygen_pci_probe(struct pci_dev *pci, int index, char *id, int midi,
                     const struct oxygen_model *model);
 void oxygen_pci_remove(struct pci_dev *pci);
 
index bd0050b1214906d64bf2a6217ea6de34036caa9a..b7079adc3d926186ea06a8806719cd325a63c633 100644 (file)
@@ -306,7 +306,7 @@ static void oxygen_card_free(struct snd_card *card)
 }
 
 int __devinit oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
-                              const struct oxygen_model *model)
+                              int midi, const struct oxygen_model *model)
 {
        struct snd_card *card;
        struct oxygen *chip;
@@ -374,7 +374,9 @@ int __devinit oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
        if (err < 0)
                goto err_card;
 
-       if (oxygen_read8(chip, OXYGEN_MISC) & OXYGEN_MISC_MIDI) {
+       oxygen_write8_masked(chip, OXYGEN_MISC,
+                            midi ? OXYGEN_MISC_MIDI : 0, OXYGEN_MISC_MIDI);
+       if (midi) {
                err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI,
                                          chip->addr + OXYGEN_MPU401,
                                          MPU401_INFO_INTEGRATED, 0, 0,
index 1a0367b7ae35be76ac5250736f9858f9dd284766..73975711c0746a250c63e362b70ae757b5c7751a 100644 (file)
@@ -266,7 +266,7 @@ static int __devinit xonar_probe(struct pci_dev *pci,
                ++dev;
                return -ENOENT;
        }
-       err = oxygen_pci_probe(pci, index[dev], id[dev], &model_xonar);
+       err = oxygen_pci_probe(pci, index[dev], id[dev], 1, &model_xonar);
        if (err >= 0)
                ++dev;
        return err;