提交 09617ce4 编写于 作者: W Wang Xingchao 提交者: Takashi Iwai

ALSA: hda - power setting error check

codec may reject power state transition requests(reporting PS-ERROR set),
in that case we re-issue a power state setting and check error bit again.
Signed-off-by: NWang Xingchao <xingchao.wang@intel.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 e076eb5c
...@@ -3526,6 +3526,9 @@ static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg ...@@ -3526,6 +3526,9 @@ static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg
static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
unsigned int power_state) unsigned int power_state)
{ {
int count;
unsigned int state;
if (codec->patch_ops.set_power_state) { if (codec->patch_ops.set_power_state) {
codec->patch_ops.set_power_state(codec, fg, power_state); codec->patch_ops.set_power_state(codec, fg, power_state);
return; return;
...@@ -3537,9 +3540,17 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, ...@@ -3537,9 +3540,17 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
bool epss = snd_hda_codec_get_supported_ps(codec, fg, AC_PWRST_EPSS); bool epss = snd_hda_codec_get_supported_ps(codec, fg, AC_PWRST_EPSS);
msleep(epss ? 10 : 100); msleep(epss ? 10 : 100);
} }
/* repeat power states setting at most 10 times*/
for (count = 0; count < 10; count++) {
snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE,
power_state); power_state);
snd_hda_codec_set_power_to_all(codec, fg, power_state, true); snd_hda_codec_set_power_to_all(codec, fg, power_state, true);
state = snd_hda_codec_read(codec, fg, 0,
AC_VERB_GET_POWER_STATE, 0);
if (!(state & AC_PWRST_ERROR))
break;
}
} }
#ifdef CONFIG_SND_HDA_HWDEP #ifdef CONFIG_SND_HDA_HWDEP
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册