aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt4
-rw-r--r--sound/pci/cmipci.c18
2 files changed, 14 insertions, 8 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index e127751d17c2..db398a6441c1 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -370,7 +370,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
370 mpu_port - 0x300,0x310,0x320,0x330 = legacy port, 370 mpu_port - 0x300,0x310,0x320,0x330 = legacy port,
371 1 = integrated PCI port, 371 1 = integrated PCI port,
372 0 = disable (default) 372 0 = disable (default)
373 fm_port - 0x388 (default), 0 = disable (default) 373 fm_port - 0x388 = legacy port,
374 1 = integrated PCI port (default),
375 0 = disable
374 soft_ac3 - Software-conversion of raw SPDIF packets (model 033 only) 376 soft_ac3 - Software-conversion of raw SPDIF packets (model 033 only)
375 (default = 1) 377 (default = 1)
376 joystick_port - Joystick port address (0 = disable, 1 = auto-detect) 378 joystick_port - Joystick port address (0 = disable, 1 = auto-detect)
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 70face7e1048..7d3c5ee0005c 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -57,7 +57,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
58static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ 58static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */
59static long mpu_port[SNDRV_CARDS]; 59static long mpu_port[SNDRV_CARDS];
60static long fm_port[SNDRV_CARDS]; 60static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
61static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; 61static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
62#ifdef SUPPORT_JOYSTICK 62#ifdef SUPPORT_JOYSTICK
63static int joystick_port[SNDRV_CARDS]; 63static int joystick_port[SNDRV_CARDS];
@@ -2779,6 +2779,9 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2779 struct snd_opl3 *opl3; 2779 struct snd_opl3 *opl3;
2780 int err; 2780 int err;
2781 2781
2782 if (!fm_port)
2783 goto disable_fm;
2784
2782 /* first try FM regs in PCI port range */ 2785 /* first try FM regs in PCI port range */
2783 iosynth = cm->iobase + CM_REG_FM_PCI; 2786 iosynth = cm->iobase + CM_REG_FM_PCI;
2784 err = snd_opl3_create(cm->card, iosynth, iosynth + 2, 2787 err = snd_opl3_create(cm->card, iosynth, iosynth + 2,
@@ -2793,7 +2796,7 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2793 case 0x3C8: val |= CM_FMSEL_3C8; break; 2796 case 0x3C8: val |= CM_FMSEL_3C8; break;
2794 case 0x388: val |= CM_FMSEL_388; break; 2797 case 0x388: val |= CM_FMSEL_388; break;
2795 default: 2798 default:
2796 return 0; 2799 goto disable_fm;
2797 } 2800 }
2798 snd_cmipci_write(cm, CM_REG_LEGACY_CTRL, val); 2801 snd_cmipci_write(cm, CM_REG_LEGACY_CTRL, val);
2799 /* enable FM */ 2802 /* enable FM */
@@ -2803,11 +2806,7 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2803 OPL3_HW_OPL3, 0, &opl3) < 0) { 2806 OPL3_HW_OPL3, 0, &opl3) < 0) {
2804 printk(KERN_ERR "cmipci: no OPL device at %#lx, " 2807 printk(KERN_ERR "cmipci: no OPL device at %#lx, "
2805 "skipping...\n", iosynth); 2808 "skipping...\n", iosynth);
2806 /* disable FM */ 2809 goto disable_fm;
2807 snd_cmipci_write(cm, CM_REG_LEGACY_CTRL,
2808 val & ~CM_FMSEL_MASK);
2809 snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_FM_EN);
2810 return 0;
2811 } 2810 }
2812 } 2811 }
2813 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 2812 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
@@ -2815,6 +2814,11 @@ static int __devinit snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2815 return err; 2814 return err;
2816 } 2815 }
2817 return 0; 2816 return 0;
2817
2818 disable_fm:
2819 snd_cmipci_clear_bit(cm, CM_REG_LEGACY_CTRL, CM_FMSEL_MASK);
2820 snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_FM_EN);
2821 return 0;
2818} 2822}
2819 2823
2820static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pci, 2824static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,