diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2012-06-15 14:55:54 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-06-18 03:39:38 -0400 |
commit | 10a3061accd897c9e4e3821cbd501660ac482497 (patch) | |
tree | deda467c56c6371c6fd49f7187307c5d75d9c866 /sound/isa | |
parent | 4be77a530be1ea62574f31c20dd9848e7e2ab0f6 (diff) |
ALSA: snd-opti9xx: fixes for MED3931 card (opti931)
MED3931 card did not work (failed with "OPTI chip not found") because
snd-opti9xx gets mc_indir_index from pnp by adding 2 to the pnp-reported port.
It probably works for some cards but not for this one. Datasheet says that
the port is always at 0xe?e so just force the lowest nibble to be 0xe.
Also this card powers up with (ugly) 3D sound enabled. As there's no mixer
control for this, just disable it.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index d7ccf28bd66a..ecc68dfe7b54 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -135,7 +135,6 @@ struct snd_opti9xx { | |||
135 | unsigned long mc_base_size; | 135 | unsigned long mc_base_size; |
136 | #ifdef OPTi93X | 136 | #ifdef OPTi93X |
137 | unsigned long mc_indir_index; | 137 | unsigned long mc_indir_index; |
138 | unsigned long mc_indir_size; | ||
139 | struct resource *res_mc_indir; | 138 | struct resource *res_mc_indir; |
140 | struct snd_wss *codec; | 139 | struct snd_wss *codec; |
141 | #endif /* OPTi93X */ | 140 | #endif /* OPTi93X */ |
@@ -245,10 +244,8 @@ static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, | |||
245 | case OPTi9XX_HW_82C931: | 244 | case OPTi9XX_HW_82C931: |
246 | case OPTi9XX_HW_82C933: | 245 | case OPTi9XX_HW_82C933: |
247 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; | 246 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; |
248 | if (!chip->mc_indir_index) { | 247 | if (!chip->mc_indir_index) |
249 | chip->mc_indir_index = 0xe0e; | 248 | chip->mc_indir_index = 0xe0e; |
250 | chip->mc_indir_size = 2; | ||
251 | } | ||
252 | chip->password = 0xe4; | 249 | chip->password = 0xe4; |
253 | chip->pwd_reg = 0; | 250 | chip->pwd_reg = 0; |
254 | break; | 251 | break; |
@@ -403,7 +400,9 @@ static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip, | |||
403 | 400 | ||
404 | #else /* OPTi93X */ | 401 | #else /* OPTi93X */ |
405 | case OPTi9XX_HW_82C931: | 402 | case OPTi9XX_HW_82C931: |
406 | case OPTi9XX_HW_82C933: | 403 | /* disable 3D sound (set GPIO1 as output, low) */ |
404 | snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(20), 0x04, 0x0c); | ||
405 | case OPTi9XX_HW_82C933: /* FALL THROUGH */ | ||
407 | /* | 406 | /* |
408 | * The BTC 1817DW has QS1000 wavetable which is connected | 407 | * The BTC 1817DW has QS1000 wavetable which is connected |
409 | * to the serial digital input of the OPTI931. | 408 | * to the serial digital input of the OPTI931. |
@@ -696,8 +695,7 @@ static int __devinit snd_opti9xx_read_check(struct snd_opti9xx *chip) | |||
696 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) | 695 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) |
697 | return 0; | 696 | return 0; |
698 | #else /* OPTi93X */ | 697 | #else /* OPTi93X */ |
699 | chip->res_mc_indir = request_region(chip->mc_indir_index, | 698 | chip->res_mc_indir = request_region(chip->mc_indir_index, 2, |
700 | chip->mc_indir_size, | ||
701 | "OPTi93x MC"); | 699 | "OPTi93x MC"); |
702 | if (chip->res_mc_indir == NULL) | 700 | if (chip->res_mc_indir == NULL) |
703 | return -EBUSY; | 701 | return -EBUSY; |
@@ -770,8 +768,9 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
770 | #ifdef OPTi93X | 768 | #ifdef OPTi93X |
771 | port = pnp_port_start(pdev, 0) - 4; | 769 | port = pnp_port_start(pdev, 0) - 4; |
772 | fm_port = pnp_port_start(pdev, 1) + 8; | 770 | fm_port = pnp_port_start(pdev, 1) + 8; |
773 | chip->mc_indir_index = pnp_port_start(pdev, 3) + 2; | 771 | /* adjust mc_indir_index - some cards report it at 0xe?d, |
774 | chip->mc_indir_size = pnp_port_len(pdev, 3) - 2; | 772 | other at 0xe?c but it really is always at 0xe?e */ |
773 | chip->mc_indir_index = (pnp_port_start(pdev, 3) & ~0xf) | 0xe; | ||
775 | #else | 774 | #else |
776 | devmc = pnp_request_card_device(card, pid->devs[2].id, NULL); | 775 | devmc = pnp_request_card_device(card, pid->devs[2].id, NULL); |
777 | if (devmc == NULL) | 776 | if (devmc == NULL) |