diff options
| author | Takashi Iwai <tiwai@suse.de> | 2012-05-15 03:02:26 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2012-05-15 03:02:26 -0400 |
| commit | bfc89dec97a3db0f14393a86b2fc3d8e13b33c86 (patch) | |
| tree | e854ed3aa0bdcd49a03d9625226f7ed6cfd1639f | |
| parent | f153c6af87401fdae3bb2dfbfc6284eb0d537a05 (diff) | |
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>
| -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) | |||
| 4365 | hda_nid_t nid = spec->pwr_nids[i]; | 4365 | hda_nid_t nid = spec->pwr_nids[i]; |
| 4366 | int pinctl, def_conf; | 4366 | int pinctl, def_conf; |
| 4367 | 4367 | ||
| 4368 | def_conf = snd_hda_codec_get_pincfg(codec, nid); | ||
| 4369 | def_conf = get_defcfg_connect(def_conf); | ||
| 4370 | if (def_conf == AC_JACK_PORT_NONE) { | ||
| 4371 | /* power off unused ports */ | ||
| 4372 | stac_toggle_power_map(codec, nid, 0); | ||
| 4373 | continue; | ||
| 4374 | } | ||
| 4368 | /* power on when no jack detection is available */ | 4375 | /* power on when no jack detection is available */ |
| 4369 | /* or when the VREF is used for controlling LED */ | 4376 | /* or when the VREF is used for controlling LED */ |
| 4370 | if (!spec->hp_detect || | 4377 | if (!spec->hp_detect || |
| 4371 | spec->vref_mute_led_nid == nid) { | 4378 | spec->vref_mute_led_nid == nid || |
| 4379 | !is_jack_detectable(codec, nid)) { | ||
| 4372 | stac_toggle_power_map(codec, nid, 1); | 4380 | stac_toggle_power_map(codec, nid, 1); |
| 4373 | continue; | 4381 | continue; |
| 4374 | } | 4382 | } |
| @@ -4386,15 +4394,6 @@ static int stac92xx_init(struct hda_codec *codec) | |||
| 4386 | stac_toggle_power_map(codec, nid, 1); | 4394 | stac_toggle_power_map(codec, nid, 1); |
| 4387 | continue; | 4395 | continue; |
| 4388 | } | 4396 | } |
| 4389 | def_conf = snd_hda_codec_get_pincfg(codec, nid); | ||
| 4390 | def_conf = get_defcfg_connect(def_conf); | ||
| 4391 | /* skip any ports that don't have jacks since presence | ||
| 4392 | * detection is useless */ | ||
| 4393 | if (def_conf != AC_JACK_PORT_NONE && | ||
| 4394 | !is_jack_detectable(codec, nid)) { | ||
| 4395 | stac_toggle_power_map(codec, nid, 1); | ||
| 4396 | continue; | ||
| 4397 | } | ||
| 4398 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { | 4397 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { |
| 4399 | stac_issue_unsol_event(codec, nid); | 4398 | stac_issue_unsol_event(codec, nid); |
| 4400 | continue; | 4399 | continue; |
