@@ -3613,25 +3613,22 @@ static void alc256_init(struct hda_codec *codec)
3613
3613
3614
3614
hp_pin_sense = snd_hda_jack_detect (codec , hp_pin );
3615
3615
3616
- if (hp_pin_sense )
3616
+ if (hp_pin_sense ) {
3617
3617
msleep (2 );
3618
+ alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x1 ); /* Low power */
3618
3619
3619
- alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x1 ); /* Low power */
3620
-
3621
- snd_hda_codec_write (codec , hp_pin , 0 ,
3622
- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3623
-
3624
- if (hp_pin_sense || spec -> ultra_low_power )
3625
- msleep (85 );
3626
-
3627
- snd_hda_codec_write (codec , hp_pin , 0 ,
3620
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3628
3621
AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
3629
3622
3630
- if (hp_pin_sense || spec -> ultra_low_power )
3631
- msleep (100 );
3623
+ msleep (75 );
3624
+
3625
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3626
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
3632
3627
3628
+ msleep (75 );
3629
+ alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x4 ); /* Hight power */
3630
+ }
3633
3631
alc_update_coef_idx (codec , 0x46 , 3 << 12 , 0 );
3634
- alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x4 ); /* Hight power */
3635
3632
alc_update_coefex_idx (codec , 0x53 , 0x02 , 0x8000 , 1 << 15 ); /* Clear bit */
3636
3633
alc_update_coefex_idx (codec , 0x53 , 0x02 , 0x8000 , 0 << 15 );
3637
3634
/*
@@ -3655,29 +3652,28 @@ static void alc256_shutup(struct hda_codec *codec)
3655
3652
alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x1 ); /* Low power */
3656
3653
hp_pin_sense = snd_hda_jack_detect (codec , hp_pin );
3657
3654
3658
- if (hp_pin_sense )
3655
+ if (hp_pin_sense ) {
3659
3656
msleep (2 );
3660
3657
3661
- snd_hda_codec_write (codec , hp_pin , 0 ,
3658
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3662
3659
AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3663
3660
3664
- if (hp_pin_sense || spec -> ultra_low_power )
3665
- msleep (85 );
3661
+ msleep (75 );
3666
3662
3667
3663
/* 3k pull low control for Headset jack. */
3668
3664
/* NOTE: call this before clearing the pin, otherwise codec stalls */
3669
3665
/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3670
3666
* when booting with headset plugged. So skip setting it for the codec alc257
3671
3667
*/
3672
- if (spec -> en_3kpull_low )
3673
- alc_update_coef_idx (codec , 0x46 , 0 , 3 << 12 );
3668
+ if (spec -> en_3kpull_low )
3669
+ alc_update_coef_idx (codec , 0x46 , 0 , 3 << 12 );
3674
3670
3675
- if (!spec -> no_shutup_pins )
3676
- snd_hda_codec_write (codec , hp_pin , 0 ,
3671
+ if (!spec -> no_shutup_pins )
3672
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3677
3673
AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
3678
3674
3679
- if ( hp_pin_sense || spec -> ultra_low_power )
3680
- msleep ( 100 );
3675
+ msleep ( 75 );
3676
+ }
3681
3677
3682
3678
alc_auto_setup_eapd (codec , false);
3683
3679
alc_shutup_pins (codec );
0 commit comments