diff options
author | Raymond Yau <superquad.vortex2@gmail.com> | 2012-01-17 07:41:47 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-01-24 18:28:05 +0400 |
commit | 4d20bb1d5fe1afbdbff951c06cd3d3654fa5ceed (patch) | |
tree | 4700066adcfd73ed0501841e574334cda30d7a74 /sound/pci/ymfpci/ymfpci.c | |
parent | b4ead019afc201f71c39cd0dfcaafed4a97b3dd2 (diff) | |
download | linux-4d20bb1d5fe1afbdbff951c06cd3d3654fa5ceed.tar.xz |
ALSA: ymfpci - Don't create invalid PCM & mixers when AC97 doesn't support
- check SDAC bit of AC97 primary codec when create "rear" device 3,
"4ch" device 2 and "4ch Duplication" switch as the card need a four channels
AC97 codec to support surround40.
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ymfpci/ymfpci.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c index e57b89e8aa89..94ab728f5ca8 100644 --- a/sound/pci/ymfpci/ymfpci.c +++ b/sound/pci/ymfpci/ymfpci.c @@ -286,17 +286,22 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, snd_card_free(card); return err; } - if ((err = snd_ymfpci_pcm_4ch(chip, 2, NULL)) < 0) { + err = snd_ymfpci_mixer(chip, rear_switch[dev]); + if (err < 0) { snd_card_free(card); return err; } - if ((err = snd_ymfpci_pcm2(chip, 3, NULL)) < 0) { - snd_card_free(card); - return err; - } - if ((err = snd_ymfpci_mixer(chip, rear_switch[dev])) < 0) { - snd_card_free(card); - return err; + if (chip->ac97->ext_id & AC97_EI_SDAC) { + err = snd_ymfpci_pcm_4ch(chip, 2, NULL); + if (err < 0) { + snd_card_free(card); + return err; + } + err = snd_ymfpci_pcm2(chip, 3, NULL); + if (err < 0) { + snd_card_free(card); + return err; + } } if ((err = snd_ymfpci_timer(chip, 0)) < 0) { snd_card_free(card); |