@@ -3843,6 +3843,79 @@ static void alc225_shutup(struct hda_codec *codec)
3843
3843
}
3844
3844
}
3845
3845
3846
+ static void alc222_init (struct hda_codec * codec )
3847
+ {
3848
+ struct alc_spec * spec = codec -> spec ;
3849
+ hda_nid_t hp_pin = alc_get_hp_pin (spec );
3850
+ bool hp1_pin_sense , hp2_pin_sense ;
3851
+
3852
+ if (!hp_pin )
3853
+ return ;
3854
+
3855
+ msleep (30 );
3856
+
3857
+ hp1_pin_sense = snd_hda_jack_detect (codec , hp_pin );
3858
+ hp2_pin_sense = snd_hda_jack_detect (codec , 0x14 );
3859
+
3860
+ if (hp1_pin_sense || hp2_pin_sense ) {
3861
+ msleep (2 );
3862
+
3863
+ if (hp1_pin_sense )
3864
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3865
+ AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
3866
+ if (hp2_pin_sense )
3867
+ snd_hda_codec_write (codec , 0x14 , 0 ,
3868
+ AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
3869
+ msleep (75 );
3870
+
3871
+ if (hp1_pin_sense )
3872
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3873
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
3874
+ if (hp2_pin_sense )
3875
+ snd_hda_codec_write (codec , 0x14 , 0 ,
3876
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
3877
+
3878
+ msleep (75 );
3879
+ }
3880
+ }
3881
+
3882
+ static void alc222_shutup (struct hda_codec * codec )
3883
+ {
3884
+ struct alc_spec * spec = codec -> spec ;
3885
+ hda_nid_t hp_pin = alc_get_hp_pin (spec );
3886
+ bool hp1_pin_sense , hp2_pin_sense ;
3887
+
3888
+ if (!hp_pin )
3889
+ hp_pin = 0x21 ;
3890
+
3891
+ hp1_pin_sense = snd_hda_jack_detect (codec , hp_pin );
3892
+ hp2_pin_sense = snd_hda_jack_detect (codec , 0x14 );
3893
+
3894
+ if (hp1_pin_sense || hp2_pin_sense ) {
3895
+ msleep (2 );
3896
+
3897
+ if (hp1_pin_sense )
3898
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3899
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3900
+ if (hp2_pin_sense )
3901
+ snd_hda_codec_write (codec , 0x14 , 0 ,
3902
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
3903
+
3904
+ msleep (75 );
3905
+
3906
+ if (hp1_pin_sense )
3907
+ snd_hda_codec_write (codec , hp_pin , 0 ,
3908
+ AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
3909
+ if (hp2_pin_sense )
3910
+ snd_hda_codec_write (codec , 0x14 , 0 ,
3911
+ AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
3912
+
3913
+ msleep (75 );
3914
+ }
3915
+ alc_auto_setup_eapd (codec , false);
3916
+ alc_shutup_pins (codec );
3917
+ }
3918
+
3846
3919
static void alc_default_init (struct hda_codec * codec )
3847
3920
{
3848
3921
struct alc_spec * spec = codec -> spec ;
@@ -11907,8 +11980,11 @@ static int patch_alc269(struct hda_codec *codec)
11907
11980
spec -> codec_variant = ALC269_TYPE_ALC300 ;
11908
11981
spec -> gen .mixer_nid = 0 ; /* no loopback on ALC300 */
11909
11982
break ;
11983
+ case 0x10ec0222 :
11910
11984
case 0x10ec0623 :
11911
11985
spec -> codec_variant = ALC269_TYPE_ALC623 ;
11986
+ spec -> shutup = alc222_shutup ;
11987
+ spec -> init_hook = alc222_init ;
11912
11988
break ;
11913
11989
case 0x10ec0700 :
11914
11990
case 0x10ec0701 :
0 commit comments