diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-03-21 05:24:42 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:40:14 -0500 |
commit | 82bc955f6379135e6ce35ff90c7ac411fd412c4c (patch) | |
tree | 314610afb5a469ac6a5a9f4d5e947436bb2c0538 /sound/pci/hda/patch_analog.c | |
parent | 19739fef0203d2f3eecc9c4b1ef25b57d85f2b30 (diff) |
[ALSA] hda-codec - Fix BIOS auto-configuration
Modules: HDA Codec driver,HDA generic driver
- Fix autoconfig speaker/hp detection
Now it allows multiple speaker pins (e.g. Dell laptops have such config)
- Use speaker or hp pins if no line-outs are available
This fixes the silence output on recent Dell laptops with STAC9200
(ALSA bug#1843)
- Fix analog/realtek/sigmatel autoconfig parser
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 2b14fa74a8fd..7fbe71e69cfc 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -786,6 +786,8 @@ enum { AD1986A_6STACK, AD1986A_3STACK, AD1986A_LAPTOP, AD1986A_LAPTOP_EAPD }; | |||
786 | static struct hda_board_config ad1986a_cfg_tbl[] = { | 786 | static struct hda_board_config ad1986a_cfg_tbl[] = { |
787 | { .modelname = "6stack", .config = AD1986A_6STACK }, | 787 | { .modelname = "6stack", .config = AD1986A_6STACK }, |
788 | { .modelname = "3stack", .config = AD1986A_3STACK }, | 788 | { .modelname = "3stack", .config = AD1986A_3STACK }, |
789 | { .pci_subvendor = 0x10de, .pci_subdevice = 0xcb84, | ||
790 | .config = AD1986A_3STACK }, /* ASUS A8N-VM CSM */ | ||
789 | { .modelname = "laptop", .config = AD1986A_LAPTOP }, | 791 | { .modelname = "laptop", .config = AD1986A_LAPTOP }, |
790 | { .pci_subvendor = 0x144d, .pci_subdevice = 0xc01e, | 792 | { .pci_subvendor = 0x144d, .pci_subdevice = 0xc01e, |
791 | .config = AD1986A_LAPTOP }, /* FSC V2060 */ | 793 | .config = AD1986A_LAPTOP }, /* FSC V2060 */ |
@@ -2253,14 +2255,11 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, | |||
2253 | 2255 | ||
2254 | idx = ad1988_pin_idx(pin); | 2256 | idx = ad1988_pin_idx(pin); |
2255 | nid = ad1988_idx_to_dac(codec, idx); | 2257 | nid = ad1988_idx_to_dac(codec, idx); |
2256 | if (! spec->multiout.dac_nids[0]) { | 2258 | /* specify the DAC as the extra output */ |
2257 | /* use this as the primary output */ | 2259 | if (! spec->multiout.hp_nid) |
2258 | spec->multiout.dac_nids[0] = nid; | ||
2259 | if (! spec->multiout.num_dacs) | ||
2260 | spec->multiout.num_dacs = 1; | ||
2261 | } else | ||
2262 | /* specify the DAC as the extra output */ | ||
2263 | spec->multiout.hp_nid = nid; | 2260 | spec->multiout.hp_nid = nid; |
2261 | else | ||
2262 | spec->multiout.extra_out_nid[0] = nid; | ||
2264 | /* control HP volume/switch on the output mixer amp */ | 2263 | /* control HP volume/switch on the output mixer amp */ |
2265 | sprintf(name, "%s Playback Volume", pfx); | 2264 | sprintf(name, "%s Playback Volume", pfx); |
2266 | if ((err = add_control(spec, AD_CTL_WIDGET_VOL, name, | 2265 | if ((err = add_control(spec, AD_CTL_WIDGET_VOL, name, |
@@ -2379,7 +2378,7 @@ static void ad1988_auto_init_extra_out(struct hda_codec *codec) | |||
2379 | struct ad198x_spec *spec = codec->spec; | 2378 | struct ad198x_spec *spec = codec->spec; |
2380 | hda_nid_t pin; | 2379 | hda_nid_t pin; |
2381 | 2380 | ||
2382 | pin = spec->autocfg.speaker_pin; | 2381 | pin = spec->autocfg.speaker_pins[0]; |
2383 | if (pin) /* connect to front */ | 2382 | if (pin) /* connect to front */ |
2384 | ad1988_auto_set_output_and_unmute(codec, pin, PIN_OUT, 0); | 2383 | ad1988_auto_set_output_and_unmute(codec, pin, PIN_OUT, 0); |
2385 | pin = spec->autocfg.hp_pin; | 2384 | pin = spec->autocfg.hp_pin; |
@@ -2428,13 +2427,13 @@ static int ad1988_parse_auto_config(struct hda_codec *codec) | |||
2428 | return err; | 2427 | return err; |
2429 | if ((err = ad1988_auto_fill_dac_nids(codec, &spec->autocfg)) < 0) | 2428 | if ((err = ad1988_auto_fill_dac_nids(codec, &spec->autocfg)) < 0) |
2430 | return err; | 2429 | return err; |
2431 | if (! spec->autocfg.line_outs && ! spec->autocfg.speaker_pin && | 2430 | if (! spec->autocfg.line_outs) |
2432 | ! spec->autocfg.hp_pin) | ||
2433 | return 0; /* can't find valid BIOS pin config */ | 2431 | return 0; /* can't find valid BIOS pin config */ |
2434 | if ((err = ad1988_auto_create_multi_out_ctls(spec, &spec->autocfg)) < 0 || | 2432 | if ((err = ad1988_auto_create_multi_out_ctls(spec, &spec->autocfg)) < 0 || |
2435 | (err = ad1988_auto_create_extra_out(codec, spec->autocfg.speaker_pin, | 2433 | (err = ad1988_auto_create_extra_out(codec, |
2434 | spec->autocfg.speaker_pins[0], | ||
2436 | "Speaker")) < 0 || | 2435 | "Speaker")) < 0 || |
2437 | (err = ad1988_auto_create_extra_out(codec, spec->autocfg.speaker_pin, | 2436 | (err = ad1988_auto_create_extra_out(codec, spec->autocfg.hp_pin, |
2438 | "Headphone")) < 0 || | 2437 | "Headphone")) < 0 || |
2439 | (err = ad1988_auto_create_analog_input_ctls(spec, &spec->autocfg)) < 0) | 2438 | (err = ad1988_auto_create_analog_input_ctls(spec, &spec->autocfg)) < 0) |
2440 | return err; | 2439 | return err; |