@@ -4930,6 +4930,30 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4930
4930
}
4931
4931
}
4932
4932
4933
+ static void alc_hp_mute_disable (struct hda_codec * codec , unsigned int delay )
4934
+ {
4935
+ if (delay <= 0 )
4936
+ delay = 75 ;
4937
+ snd_hda_codec_write (codec , 0x21 , 0 ,
4938
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
4939
+ msleep (delay );
4940
+ snd_hda_codec_write (codec , 0x21 , 0 ,
4941
+ AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
4942
+ msleep (delay );
4943
+ }
4944
+
4945
+ static void alc_hp_enable_unmute (struct hda_codec * codec , unsigned int delay )
4946
+ {
4947
+ if (delay <= 0 )
4948
+ delay = 75 ;
4949
+ snd_hda_codec_write (codec , 0x21 , 0 ,
4950
+ AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
4951
+ msleep (delay );
4952
+ snd_hda_codec_write (codec , 0x21 , 0 ,
4953
+ AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
4954
+ msleep (delay );
4955
+ }
4956
+
4933
4957
static const struct coef_fw alc225_pre_hsmode [] = {
4934
4958
UPDATE_COEF (0x4a , 1 <<8 , 0 ),
4935
4959
UPDATE_COEFEX (0x57 , 0x05 , 1 <<14 , 0 ),
@@ -5031,6 +5055,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
5031
5055
case 0x10ec0236 :
5032
5056
case 0x10ec0256 :
5033
5057
case 0x19e58326 :
5058
+ alc_hp_mute_disable (codec , 75 );
5034
5059
alc_process_coef_fw (codec , coef0256 );
5035
5060
break ;
5036
5061
case 0x10ec0234 :
@@ -5302,6 +5327,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
5302
5327
alc_write_coef_idx (codec , 0x45 , 0xc089 );
5303
5328
msleep (50 );
5304
5329
alc_process_coef_fw (codec , coef0256 );
5330
+ alc_hp_enable_unmute (codec , 75 );
5305
5331
break ;
5306
5332
case 0x10ec0234 :
5307
5333
case 0x10ec0274 :
@@ -5399,6 +5425,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
5399
5425
case 0x10ec0256 :
5400
5426
case 0x19e58326 :
5401
5427
alc_process_coef_fw (codec , coef0256 );
5428
+ alc_hp_enable_unmute (codec , 75 );
5402
5429
break ;
5403
5430
case 0x10ec0234 :
5404
5431
case 0x10ec0274 :
@@ -5514,6 +5541,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
5514
5541
case 0x10ec0256 :
5515
5542
case 0x19e58326 :
5516
5543
alc_process_coef_fw (codec , coef0256 );
5544
+ alc_hp_enable_unmute (codec , 75 );
5517
5545
break ;
5518
5546
case 0x10ec0234 :
5519
5547
case 0x10ec0274 :
@@ -5619,25 +5647,21 @@ static void alc_determine_headset_type(struct hda_codec *codec)
5619
5647
alc_write_coef_idx (codec , 0x06 , 0x6104 );
5620
5648
alc_write_coefex_idx (codec , 0x57 , 0x3 , 0x09a3 );
5621
5649
5622
- snd_hda_codec_write (codec , 0x21 , 0 ,
5623
- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
5624
- msleep (80 );
5625
- snd_hda_codec_write (codec , 0x21 , 0 ,
5626
- AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
5627
-
5628
5650
alc_process_coef_fw (codec , coef0255 );
5629
5651
msleep (300 );
5630
5652
val = alc_read_coef_idx (codec , 0x46 );
5631
5653
is_ctia = (val & 0x0070 ) == 0x0070 ;
5632
-
5654
+ if (!is_ctia ) {
5655
+ alc_write_coef_idx (codec , 0x45 , 0xe089 );
5656
+ msleep (100 );
5657
+ val = alc_read_coef_idx (codec , 0x46 );
5658
+ if ((val & 0x0070 ) == 0x0070 )
5659
+ is_ctia = false;
5660
+ else
5661
+ is_ctia = true;
5662
+ }
5633
5663
alc_write_coefex_idx (codec , 0x57 , 0x3 , 0x0da3 );
5634
5664
alc_update_coefex_idx (codec , 0x57 , 0x5 , 1 <<14 , 0 );
5635
-
5636
- snd_hda_codec_write (codec , 0x21 , 0 ,
5637
- AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
5638
- msleep (80 );
5639
- snd_hda_codec_write (codec , 0x21 , 0 ,
5640
- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
5641
5665
break ;
5642
5666
case 0x10ec0234 :
5643
5667
case 0x10ec0274 :
0 commit comments