diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index f560051a949e..1c65cc5e3a31 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1209,6 +1209,9 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
1209 | kfree(codec); | 1209 | kfree(codec); |
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, | ||
1213 | hda_nid_t fg, unsigned int power_state); | ||
1214 | |||
1212 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | 1215 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, |
1213 | unsigned int power_state); | 1216 | unsigned int power_state); |
1214 | 1217 | ||
@@ -1317,6 +1320,10 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, | |||
1317 | AC_VERB_GET_SUBSYSTEM_ID, 0); | 1320 | AC_VERB_GET_SUBSYSTEM_ID, 0); |
1318 | } | 1321 | } |
1319 | 1322 | ||
1323 | codec->epss = snd_hda_codec_get_supported_ps(codec, | ||
1324 | codec->afg ? codec->afg : codec->mfg, | ||
1325 | AC_PWRST_EPSS); | ||
1326 | |||
1320 | /* power-up all before initialization */ | 1327 | /* power-up all before initialization */ |
1321 | hda_set_power_state(codec, | 1328 | hda_set_power_state(codec, |
1322 | codec->afg ? codec->afg : codec->mfg, | 1329 | codec->afg ? codec->afg : codec->mfg, |
@@ -2346,6 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
2346 | } | 2353 | } |
2347 | if (codec->patch_ops.free) | 2354 | if (codec->patch_ops.free) |
2348 | codec->patch_ops.free(codec); | 2355 | codec->patch_ops.free(codec); |
2356 | memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); | ||
2349 | snd_hda_jack_tbl_clear(codec); | 2357 | snd_hda_jack_tbl_clear(codec); |
2350 | codec->proc_widget_hook = NULL; | 2358 | codec->proc_widget_hook = NULL; |
2351 | codec->spec = NULL; | 2359 | codec->spec = NULL; |
@@ -2361,7 +2369,6 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
2361 | codec->num_pcms = 0; | 2369 | codec->num_pcms = 0; |
2362 | codec->pcm_info = NULL; | 2370 | codec->pcm_info = NULL; |
2363 | codec->preset = NULL; | 2371 | codec->preset = NULL; |
2364 | memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); | ||
2365 | codec->slave_dig_outs = NULL; | 2372 | codec->slave_dig_outs = NULL; |
2366 | codec->spdif_status_reset = 0; | 2373 | codec->spdif_status_reset = 0; |
2367 | module_put(codec->owner); | 2374 | module_put(codec->owner); |
@@ -3543,8 +3550,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | |||
3543 | /* this delay seems necessary to avoid click noise at power-down */ | 3550 | /* this delay seems necessary to avoid click noise at power-down */ |
3544 | if (power_state == AC_PWRST_D3) { | 3551 | if (power_state == AC_PWRST_D3) { |
3545 | /* transition time less than 10ms for power down */ | 3552 | /* transition time less than 10ms for power down */ |
3546 | bool epss = snd_hda_codec_get_supported_ps(codec, fg, AC_PWRST_EPSS); | 3553 | msleep(codec->epss ? 10 : 100); |
3547 | msleep(epss ? 10 : 100); | ||
3548 | } | 3554 | } |
3549 | 3555 | ||
3550 | /* repeat power states setting at most 10 times*/ | 3556 | /* repeat power states setting at most 10 times*/ |