diff options
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 082b2db95056..c4a1b496d7bb 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -3130,6 +3130,67 @@ static void alc256_shutup(struct hda_codec *codec) | |||
3130 | snd_hda_shutup_pins(codec); | 3130 | snd_hda_shutup_pins(codec); |
3131 | } | 3131 | } |
3132 | 3132 | ||
3133 | static void alc_default_init(struct hda_codec *codec) | ||
3134 | { | ||
3135 | struct alc_spec *spec = codec->spec; | ||
3136 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; | ||
3137 | bool hp_pin_sense; | ||
3138 | |||
3139 | if (!hp_pin) | ||
3140 | return; | ||
3141 | |||
3142 | msleep(30); | ||
3143 | |||
3144 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | ||
3145 | |||
3146 | if (hp_pin_sense) | ||
3147 | msleep(2); | ||
3148 | |||
3149 | snd_hda_codec_write(codec, hp_pin, 0, | ||
3150 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | ||
3151 | |||
3152 | if (hp_pin_sense) | ||
3153 | msleep(85); | ||
3154 | |||
3155 | snd_hda_codec_write(codec, hp_pin, 0, | ||
3156 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | ||
3157 | |||
3158 | if (hp_pin_sense) | ||
3159 | msleep(100); | ||
3160 | } | ||
3161 | |||
3162 | static void alc_default_shutup(struct hda_codec *codec) | ||
3163 | { | ||
3164 | struct alc_spec *spec = codec->spec; | ||
3165 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; | ||
3166 | bool hp_pin_sense; | ||
3167 | |||
3168 | if (!hp_pin) { | ||
3169 | alc269_shutup(codec); | ||
3170 | return; | ||
3171 | } | ||
3172 | |||
3173 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | ||
3174 | |||
3175 | if (hp_pin_sense) | ||
3176 | msleep(2); | ||
3177 | |||
3178 | snd_hda_codec_write(codec, hp_pin, 0, | ||
3179 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | ||
3180 | |||
3181 | if (hp_pin_sense) | ||
3182 | msleep(85); | ||
3183 | |||
3184 | snd_hda_codec_write(codec, hp_pin, 0, | ||
3185 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | ||
3186 | |||
3187 | if (hp_pin_sense) | ||
3188 | msleep(100); | ||
3189 | |||
3190 | alc_auto_setup_eapd(codec, false); | ||
3191 | snd_hda_shutup_pins(codec); | ||
3192 | } | ||
3193 | |||
3133 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, | 3194 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
3134 | unsigned int val) | 3195 | unsigned int val) |
3135 | { | 3196 | { |
@@ -6536,7 +6597,8 @@ static int patch_alc269(struct hda_codec *codec) | |||
6536 | codec->patch_ops.suspend = alc269_suspend; | 6597 | codec->patch_ops.suspend = alc269_suspend; |
6537 | codec->patch_ops.resume = alc269_resume; | 6598 | codec->patch_ops.resume = alc269_resume; |
6538 | #endif | 6599 | #endif |
6539 | spec->shutup = alc269_shutup; | 6600 | spec->shutup = alc_default_shutup; |
6601 | spec->init_hook = alc_default_init; | ||
6540 | 6602 | ||
6541 | snd_hda_pick_fixup(codec, alc269_fixup_models, | 6603 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
6542 | alc269_fixup_tbl, alc269_fixups); | 6604 | alc269_fixup_tbl, alc269_fixups); |
@@ -6576,6 +6638,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
6576 | } | 6638 | } |
6577 | if (err < 0) | 6639 | if (err < 0) |
6578 | goto error; | 6640 | goto error; |
6641 | spec->shutup = alc269_shutup; | ||
6579 | spec->init_hook = alc269_fill_coef; | 6642 | spec->init_hook = alc269_fill_coef; |
6580 | alc269_fill_coef(codec); | 6643 | alc269_fill_coef(codec); |
6581 | break; | 6644 | break; |