diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index ad4cb38109fc..8cbe3bf1e317 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1625,19 +1625,26 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | |||
1625 | 1625 | ||
1626 | nid = codec->start_nid; | 1626 | nid = codec->start_nid; |
1627 | for (i = 0; i < codec->num_nodes; i++, nid++) { | 1627 | for (i = 0; i < codec->num_nodes; i++, nid++) { |
1628 | if (get_wcaps(codec, nid) & AC_WCAP_POWER) { | 1628 | unsigned int wcaps = get_wcaps(codec, nid); |
1629 | unsigned int pincap; | 1629 | if (wcaps & AC_WCAP_POWER) { |
1630 | /* | 1630 | unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >> |
1631 | * don't power down the widget if it controls eapd | 1631 | AC_WCAP_TYPE_SHIFT; |
1632 | * and EAPD_BTLENABLE is set. | 1632 | if (wid_type == AC_WID_PIN) { |
1633 | */ | 1633 | unsigned int pincap; |
1634 | pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); | 1634 | /* |
1635 | if (pincap & AC_PINCAP_EAPD) { | 1635 | * don't power down the widget if it controls |
1636 | int eapd = snd_hda_codec_read(codec, nid, | 1636 | * eapd and EAPD_BTLENABLE is set. |
1637 | 0, AC_VERB_GET_EAPD_BTLENABLE, 0); | 1637 | */ |
1638 | eapd &= 0x02; | 1638 | pincap = snd_hda_param_read(codec, nid, |
1639 | if (power_state == AC_PWRST_D3 && eapd) | 1639 | AC_PAR_PIN_CAP); |
1640 | continue; | 1640 | if (pincap & AC_PINCAP_EAPD) { |
1641 | int eapd = snd_hda_codec_read(codec, | ||
1642 | nid, 0, | ||
1643 | AC_VERB_GET_EAPD_BTLENABLE, 0); | ||
1644 | eapd &= 0x02; | ||
1645 | if (power_state == AC_PWRST_D3 && eapd) | ||
1646 | continue; | ||
1647 | } | ||
1641 | } | 1648 | } |
1642 | snd_hda_codec_write(codec, nid, 0, | 1649 | snd_hda_codec_write(codec, nid, 0, |
1643 | AC_VERB_SET_POWER_STATE, | 1650 | AC_VERB_SET_POWER_STATE, |
@@ -2485,13 +2492,14 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, | |||
2485 | /* front */ | 2492 | /* front */ |
2486 | snd_hda_codec_setup_stream(codec, nids[HDA_FRONT], stream_tag, | 2493 | snd_hda_codec_setup_stream(codec, nids[HDA_FRONT], stream_tag, |
2487 | 0, format); | 2494 | 0, format); |
2488 | if (mout->hp_nid && mout->hp_nid != nids[HDA_FRONT]) | 2495 | if (!mout->no_share_stream && |
2496 | mout->hp_nid && mout->hp_nid != nids[HDA_FRONT]) | ||
2489 | /* headphone out will just decode front left/right (stereo) */ | 2497 | /* headphone out will just decode front left/right (stereo) */ |
2490 | snd_hda_codec_setup_stream(codec, mout->hp_nid, stream_tag, | 2498 | snd_hda_codec_setup_stream(codec, mout->hp_nid, stream_tag, |
2491 | 0, format); | 2499 | 0, format); |
2492 | /* extra outputs copied from front */ | 2500 | /* extra outputs copied from front */ |
2493 | for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++) | 2501 | for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++) |
2494 | if (mout->extra_out_nid[i]) | 2502 | if (!mout->no_share_stream && mout->extra_out_nid[i]) |
2495 | snd_hda_codec_setup_stream(codec, | 2503 | snd_hda_codec_setup_stream(codec, |
2496 | mout->extra_out_nid[i], | 2504 | mout->extra_out_nid[i], |
2497 | stream_tag, 0, format); | 2505 | stream_tag, 0, format); |
@@ -2501,7 +2509,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, | |||
2501 | if (chs >= (i + 1) * 2) /* independent out */ | 2509 | if (chs >= (i + 1) * 2) /* independent out */ |
2502 | snd_hda_codec_setup_stream(codec, nids[i], stream_tag, | 2510 | snd_hda_codec_setup_stream(codec, nids[i], stream_tag, |
2503 | i * 2, format); | 2511 | i * 2, format); |
2504 | else /* copy front */ | 2512 | else if (!mout->no_share_stream) /* copy front */ |
2505 | snd_hda_codec_setup_stream(codec, nids[i], stream_tag, | 2513 | snd_hda_codec_setup_stream(codec, nids[i], stream_tag, |
2506 | 0, format); | 2514 | 0, format); |
2507 | } | 2515 | } |