@@ -4930,6 +4930,30 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
49304930 }
49314931}
49324932
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+
49334957static const struct coef_fw alc225_pre_hsmode [] = {
49344958 UPDATE_COEF (0x4a , 1 <<8 , 0 ),
49354959 UPDATE_COEFEX (0x57 , 0x05 , 1 <<14 , 0 ),
@@ -5031,6 +5055,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
50315055 case 0x10ec0236 :
50325056 case 0x10ec0256 :
50335057 case 0x19e58326 :
5058+ alc_hp_mute_disable (codec , 75 );
50345059 alc_process_coef_fw (codec , coef0256 );
50355060 break ;
50365061 case 0x10ec0234 :
@@ -5065,6 +5090,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
50655090 case 0x10ec0295 :
50665091 case 0x10ec0289 :
50675092 case 0x10ec0299 :
5093+ alc_hp_mute_disable (codec , 75 );
50685094 alc_process_coef_fw (codec , alc225_pre_hsmode );
50695095 alc_process_coef_fw (codec , coef0225 );
50705096 break ;
@@ -5290,6 +5316,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
52905316 case 0x10ec0299 :
52915317 alc_process_coef_fw (codec , alc225_pre_hsmode );
52925318 alc_process_coef_fw (codec , coef0225 );
5319+ alc_hp_enable_unmute (codec , 75 );
52935320 break ;
52945321 case 0x10ec0255 :
52955322 alc_process_coef_fw (codec , coef0255 );
@@ -5302,6 +5329,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
53025329 alc_write_coef_idx (codec , 0x45 , 0xc089 );
53035330 msleep (50 );
53045331 alc_process_coef_fw (codec , coef0256 );
5332+ alc_hp_enable_unmute (codec , 75 );
53055333 break ;
53065334 case 0x10ec0234 :
53075335 case 0x10ec0274 :
@@ -5399,6 +5427,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
53995427 case 0x10ec0256 :
54005428 case 0x19e58326 :
54015429 alc_process_coef_fw (codec , coef0256 );
5430+ alc_hp_enable_unmute (codec , 75 );
54025431 break ;
54035432 case 0x10ec0234 :
54045433 case 0x10ec0274 :
@@ -5447,6 +5476,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
54475476 alc_process_coef_fw (codec , coef0225_2 );
54485477 else
54495478 alc_process_coef_fw (codec , coef0225_1 );
5479+ alc_hp_enable_unmute (codec , 75 );
54505480 break ;
54515481 case 0x10ec0867 :
54525482 alc_update_coefex_idx (codec , 0x57 , 0x5 , 1 <<14 , 0 );
@@ -5514,6 +5544,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
55145544 case 0x10ec0256 :
55155545 case 0x19e58326 :
55165546 alc_process_coef_fw (codec , coef0256 );
5547+ alc_hp_enable_unmute (codec , 75 );
55175548 break ;
55185549 case 0x10ec0234 :
55195550 case 0x10ec0274 :
@@ -5551,6 +5582,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
55515582 case 0x10ec0289 :
55525583 case 0x10ec0299 :
55535584 alc_process_coef_fw (codec , coef0225 );
5585+ alc_hp_enable_unmute (codec , 75 );
55545586 break ;
55555587 }
55565588 codec_dbg (codec , "Headset jack set to Nokia-style headset mode.\n" );
@@ -5619,25 +5651,21 @@ static void alc_determine_headset_type(struct hda_codec *codec)
56195651 alc_write_coef_idx (codec , 0x06 , 0x6104 );
56205652 alc_write_coefex_idx (codec , 0x57 , 0x3 , 0x09a3 );
56215653
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-
56285654 alc_process_coef_fw (codec , coef0255 );
56295655 msleep (300 );
56305656 val = alc_read_coef_idx (codec , 0x46 );
56315657 is_ctia = (val & 0x0070 ) == 0x0070 ;
5632-
5658+ if (!is_ctia ) {
5659+ alc_write_coef_idx (codec , 0x45 , 0xe089 );
5660+ msleep (100 );
5661+ val = alc_read_coef_idx (codec , 0x46 );
5662+ if ((val & 0x0070 ) == 0x0070 )
5663+ is_ctia = false;
5664+ else
5665+ is_ctia = true;
5666+ }
56335667 alc_write_coefex_idx (codec , 0x57 , 0x3 , 0x0da3 );
56345668 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 );
56415669 break ;
56425670 case 0x10ec0234 :
56435671 case 0x10ec0274 :
@@ -5714,12 +5742,6 @@ static void alc_determine_headset_type(struct hda_codec *codec)
57145742 case 0x10ec0295 :
57155743 case 0x10ec0289 :
57165744 case 0x10ec0299 :
5717- snd_hda_codec_write (codec , 0x21 , 0 ,
5718- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_MUTE );
5719- msleep (80 );
5720- snd_hda_codec_write (codec , 0x21 , 0 ,
5721- AC_VERB_SET_PIN_WIDGET_CONTROL , 0x0 );
5722-
57235745 alc_process_coef_fw (codec , alc225_pre_hsmode );
57245746 alc_update_coef_idx (codec , 0x67 , 0xf000 , 0x1000 );
57255747 val = alc_read_coef_idx (codec , 0x45 );
@@ -5736,15 +5758,19 @@ static void alc_determine_headset_type(struct hda_codec *codec)
57365758 val = alc_read_coef_idx (codec , 0x46 );
57375759 is_ctia = (val & 0x00f0 ) == 0x00f0 ;
57385760 }
5761+ if (!is_ctia ) {
5762+ alc_update_coef_idx (codec , 0x45 , 0x3f <<10 , 0x38 <<10 );
5763+ alc_update_coef_idx (codec , 0x49 , 3 <<8 , 1 <<8 );
5764+ msleep (100 );
5765+ val = alc_read_coef_idx (codec , 0x46 );
5766+ if ((val & 0x00f0 ) == 0x00f0 )
5767+ is_ctia = false;
5768+ else
5769+ is_ctia = true;
5770+ }
57395771 alc_update_coef_idx (codec , 0x4a , 7 <<6 , 7 <<6 );
57405772 alc_update_coef_idx (codec , 0x4a , 3 <<4 , 3 <<4 );
57415773 alc_update_coef_idx (codec , 0x67 , 0xf000 , 0x3000 );
5742-
5743- snd_hda_codec_write (codec , 0x21 , 0 ,
5744- AC_VERB_SET_PIN_WIDGET_CONTROL , PIN_OUT );
5745- msleep (80 );
5746- snd_hda_codec_write (codec , 0x21 , 0 ,
5747- AC_VERB_SET_AMP_GAIN_MUTE , AMP_OUT_UNMUTE );
57485774 break ;
57495775 case 0x10ec0867 :
57505776 is_ctia = true;
@@ -10315,6 +10341,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1031510341 SND_PCI_QUIRK (0x103c , 0x8c15 , "HP Spectre x360 2-in-1 Laptop 14-eu0xxx" , ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX ),
1031610342 SND_PCI_QUIRK (0x103c , 0x8c16 , "HP Spectre 16" , ALC287_FIXUP_CS35L41_I2C_2 ),
1031710343 SND_PCI_QUIRK (0x103c , 0x8c17 , "HP Spectre 16" , ALC287_FIXUP_CS35L41_I2C_2 ),
10344+ SND_PCI_QUIRK (0x103c , 0x8c21 , "HP Pavilion Plus Laptop 14-ey0XXX" , ALC245_FIXUP_HP_X360_MUTE_LEDS ),
1031810345 SND_PCI_QUIRK (0x103c , 0x8c46 , "HP EliteBook 830 G11" , ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ),
1031910346 SND_PCI_QUIRK (0x103c , 0x8c47 , "HP EliteBook 840 G11" , ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ),
1032010347 SND_PCI_QUIRK (0x103c , 0x8c48 , "HP EliteBook 860 G11" , ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ),
@@ -10353,6 +10380,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1035310380 SND_PCI_QUIRK (0x103c , 0x8ca2 , "HP ZBook Power" , ALC236_FIXUP_HP_GPIO_LED ),
1035410381 SND_PCI_QUIRK (0x103c , 0x8ca4 , "HP ZBook Fury" , ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ),
1035510382 SND_PCI_QUIRK (0x103c , 0x8ca7 , "HP ZBook Fury" , ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ),
10383+ SND_PCI_QUIRK (0x103c , 0x8cbd , "HP Pavilion Aero Laptop 13-bg0xxx" , ALC245_FIXUP_HP_X360_MUTE_LEDS ),
1035610384 SND_PCI_QUIRK (0x103c , 0x8cdd , "HP Spectre" , ALC287_FIXUP_CS35L41_I2C_2 ),
1035710385 SND_PCI_QUIRK (0x103c , 0x8cde , "HP Spectre" , ALC287_FIXUP_CS35L41_I2C_2 ),
1035810386 SND_PCI_QUIRK (0x103c , 0x8cdf , "HP SnowWhite" , ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED ),
@@ -10513,6 +10541,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1051310541 SND_PCI_QUIRK (0x144d , 0xca03 , "Samsung Galaxy Book2 Pro 360 (NP930QED)" , ALC298_FIXUP_SAMSUNG_AMP ),
1051410542 SND_PCI_QUIRK (0x144d , 0xc868 , "Samsung Galaxy Book2 Pro (NP930XED)" , ALC298_FIXUP_SAMSUNG_AMP ),
1051510543 SND_PCI_QUIRK (0x144d , 0xc1ca , "Samsung Galaxy Book3 Pro 360 (NP960QFG-KB1US)" , ALC298_FIXUP_SAMSUNG_AMP2 ),
10544+ SND_PCI_QUIRK (0x144d , 0xc1cc , "Samsung Galaxy Book3 Ultra (NT960XFH-XD92G))" , ALC298_FIXUP_SAMSUNG_AMP2 ),
1051610545 SND_PCI_QUIRK (0x1458 , 0xfa53 , "Gigabyte BXBT-2807" , ALC283_FIXUP_HEADSET_MIC ),
1051710546 SND_PCI_QUIRK (0x1462 , 0xb120 , "MSI Cubi MS-B120" , ALC283_FIXUP_HEADSET_MIC ),
1051810547 SND_PCI_QUIRK (0x1462 , 0xb171 , "Cubi N 8GL (MS-B171)" , ALC283_FIXUP_HEADSET_MIC ),
0 commit comments