@@ -3768,33 +3768,28 @@ static void alc225_init(struct hda_codec *codec)
3768
3768
hp1_pin_sense = snd_hda_jack_detect (codec , hp_pin );
3769
3769
hp2_pin_sense = snd_hda_jack_detect (codec , 0x16 );
3770
3770
3771
- if (hp1_pin_sense || hp2_pin_sense )
3771
+ if (hp1_pin_sense || hp2_pin_sense ) {
3772
3772
msleep (2 );
3773
+ alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x1 ); /* Low power */
3773
3774
3774
- alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x1 ); /* Low power */
3775
-
3776
- if (hp1_pin_sense || spec -> ultra_low_power )
3777
- snd_hda_codec_write (codec , hp_pin , 0 ,
3778
- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3779
- if (hp2_pin_sense )
3780
- snd_hda_codec_write (codec , 0x16 , 0 ,
3781
- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3782
-
3783
- if (hp1_pin_sense || hp2_pin_sense || spec -> ultra_low_power )
3784
- msleep (85 );
3785
-
3786
- if (hp1_pin_sense || spec -> ultra_low_power )
3787
- snd_hda_codec_write (codec , hp_pin , 0 ,
3788
- AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
3789
- if (hp2_pin_sense )
3790
- snd_hda_codec_write (codec , 0x16 , 0 ,
3791
- AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
3775
+ if (hp1_pin_sense )
3776
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3777
+ AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
3778
+ if (hp2_pin_sense )
3779
+ snd_hda_codec_write (codec , 0x16 , 0 ,
3780
+ AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
3781
+ msleep (75 );
3792
3782
3793
- if (hp1_pin_sense || hp2_pin_sense || spec -> ultra_low_power )
3794
- msleep (100 );
3783
+ if (hp1_pin_sense )
3784
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3785
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
3786
+ if (hp2_pin_sense )
3787
+ snd_hda_codec_write (codec , 0x16 , 0 ,
3788
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
3795
3789
3796
- alc_update_coef_idx (codec , 0x4a , 3 << 10 , 0 );
3797
- alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x4 ); /* Hight power */
3790
+ msleep (75 );
3791
+ alc_update_coefex_idx (codec , 0x57 , 0x04 , 0x0007 , 0x4 ); /* Hight power */
3792
+ }
3798
3793
}
3799
3794
3800
3795
static void alc225_shutup (struct hda_codec * codec )
@@ -3806,36 +3801,35 @@ static void alc225_shutup(struct hda_codec *codec)
3806
3801
if (!hp_pin )
3807
3802
hp_pin = 0x21 ;
3808
3803
3809
- alc_disable_headset_jack_key (codec );
3810
- /* 3k pull low control for Headset jack. */
3811
- alc_update_coef_idx (codec , 0x4a , 0 , 3 << 10 );
3812
-
3813
3804
hp1_pin_sense = snd_hda_jack_detect (codec , hp_pin );
3814
3805
hp2_pin_sense = snd_hda_jack_detect (codec , 0x16 );
3815
3806
3816
- if (hp1_pin_sense || hp2_pin_sense )
3807
+ if (hp1_pin_sense || hp2_pin_sense ) {
3808
+ alc_disable_headset_jack_key (codec );
3809
+ /* 3k pull low control for Headset jack. */
3810
+ alc_update_coef_idx (codec , 0x4a , 0 , 3 << 10 );
3817
3811
msleep (2 );
3818
3812
3819
- if (hp1_pin_sense || spec -> ultra_low_power )
3820
- snd_hda_codec_write (codec , hp_pin , 0 ,
3821
- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3822
- if (hp2_pin_sense )
3823
- snd_hda_codec_write (codec , 0x16 , 0 ,
3824
- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3825
-
3826
- if (hp1_pin_sense || hp2_pin_sense || spec -> ultra_low_power )
3827
- msleep (85 );
3813
+ if (hp1_pin_sense )
3814
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3815
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3816
+ if (hp2_pin_sense )
3817
+ snd_hda_codec_write (codec , 0x16 , 0 ,
3818
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3828
3819
3829
- if (hp1_pin_sense || spec -> ultra_low_power )
3830
- snd_hda_codec_write (codec , hp_pin , 0 ,
3831
- AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
3832
- if (hp2_pin_sense )
3833
- snd_hda_codec_write (codec , 0x16 , 0 ,
3834
- AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
3820
+ msleep (75 );
3835
3821
3836
- if (hp1_pin_sense || hp2_pin_sense || spec -> ultra_low_power )
3837
- msleep (100 );
3822
+ if (hp1_pin_sense )
3823
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3824
+ AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
3825
+ if (hp2_pin_sense )
3826
+ snd_hda_codec_write (codec , 0x16 , 0 ,
3827
+ AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
3838
3828
3829
+ msleep (75 );
3830
+ alc_update_coef_idx (codec , 0x4a , 3 << 10 , 0 );
3831
+ alc_enable_headset_jack_key (codec );
3832
+ }
3839
3833
alc_auto_setup_eapd (codec , false);
3840
3834
alc_shutup_pins (codec );
3841
3835
if (spec -> ultra_low_power ) {
@@ -3846,9 +3840,6 @@ static void alc225_shutup(struct hda_codec *codec)
3846
3840
alc_update_coef_idx (codec , 0x4a , 3 <<4 , 2 <<4 );
3847
3841
msleep (30 );
3848
3842
}
3849
-
3850
- alc_update_coef_idx (codec , 0x4a , 3 << 10 , 0 );
3851
- alc_enable_headset_jack_key (codec );
3852
3843
}
3853
3844
3854
3845
static void alc_default_init (struct hda_codec * codec )
0 commit comments