diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-05-15 09:02:26 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-15 09:02:26 +0200 |
commit | bfc89dec97a3db0f14393a86b2fc3d8e13b33c86 (patch) | |
tree | e854ed3aa0bdcd49a03d9625226f7ed6cfd1639f /sound/pci | |
parent | Merge branch 'fix/hda' into topic/hda (diff) | |
download | linux-bfc89dec97a3db0f14393a86b2fc3d8e13b33c86.tar.xz linux-bfc89dec97a3db0f14393a86b2fc3d8e13b33c86.zip |
ALSA: hda/idt - Clean up power-map check code
Turn off the power-map for unused ports and check the jack-detection
capability in the first place.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 3808f37bf15e..1f6f5202e7b1 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4365,10 +4365,18 @@ static int stac92xx_init(struct hda_codec *codec) hda_nid_t nid = spec->pwr_nids[i]; int pinctl, def_conf; + def_conf = snd_hda_codec_get_pincfg(codec, nid); + def_conf = get_defcfg_connect(def_conf); + if (def_conf == AC_JACK_PORT_NONE) { + /* power off unused ports */ + stac_toggle_power_map(codec, nid, 0); + continue; + } /* power on when no jack detection is available */ /* or when the VREF is used for controlling LED */ if (!spec->hp_detect || - spec->vref_mute_led_nid == nid) { + spec->vref_mute_led_nid == nid || + !is_jack_detectable(codec, nid)) { stac_toggle_power_map(codec, nid, 1); continue; } @@ -4386,15 +4394,6 @@ static int stac92xx_init(struct hda_codec *codec) stac_toggle_power_map(codec, nid, 1); continue; } - def_conf = snd_hda_codec_get_pincfg(codec, nid); - def_conf = get_defcfg_connect(def_conf); - /* skip any ports that don't have jacks since presence - * detection is useless */ - if (def_conf != AC_JACK_PORT_NONE && - !is_jack_detectable(codec, nid)) { - stac_toggle_power_map(codec, nid, 1); - continue; - } if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { stac_issue_unsol_event(codec, nid); continue; |