@@ -515,6 +515,15 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type)
515
515
}
516
516
}
517
517
518
+ /* get a primary headphone pin if available */
519
+ static hda_nid_t alc_get_hp_pin (struct alc_spec * spec )
520
+ {
521
+ if (spec -> gen .autocfg .hp_pins [0 ])
522
+ return spec -> gen .autocfg .hp_pins [0 ];
523
+ if (spec -> gen .autocfg .line_out_type == AC_JACK_HP_OUT )
524
+ return spec -> gen .autocfg .line_out_pins [0 ];
525
+ return 0 ;
526
+ }
518
527
519
528
/*
520
529
* Realtek SSID verification
@@ -725,9 +734,7 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
725
734
* 15 : 1 --> enable the function "Mute internal speaker
726
735
* when the external headphone out jack is plugged"
727
736
*/
728
- if (!spec -> gen .autocfg .hp_pins [0 ] &&
729
- !(spec -> gen .autocfg .line_out_pins [0 ] &&
730
- spec -> gen .autocfg .line_out_type == AUTO_PIN_HP_OUT )) {
737
+ if (!alc_get_hp_pin (spec )) {
731
738
hda_nid_t nid ;
732
739
tmp = (ass >> 11 ) & 0x3 ; /* HP to chassis */
733
740
nid = ports [tmp ];
@@ -2959,7 +2966,7 @@ static void alc282_restore_default_value(struct hda_codec *codec)
2959
2966
static void alc282_init (struct hda_codec * codec )
2960
2967
{
2961
2968
struct alc_spec * spec = codec -> spec ;
2962
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
2969
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
2963
2970
bool hp_pin_sense ;
2964
2971
int coef78 ;
2965
2972
@@ -2996,7 +3003,7 @@ static void alc282_init(struct hda_codec *codec)
2996
3003
static void alc282_shutup (struct hda_codec * codec )
2997
3004
{
2998
3005
struct alc_spec * spec = codec -> spec ;
2999
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3006
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3000
3007
bool hp_pin_sense ;
3001
3008
int coef78 ;
3002
3009
@@ -3074,14 +3081,9 @@ static void alc283_restore_default_value(struct hda_codec *codec)
3074
3081
static void alc283_init (struct hda_codec * codec )
3075
3082
{
3076
3083
struct alc_spec * spec = codec -> spec ;
3077
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3084
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3078
3085
bool hp_pin_sense ;
3079
3086
3080
- if (!spec -> gen .autocfg .hp_outs ) {
3081
- if (spec -> gen .autocfg .line_out_type == AC_JACK_HP_OUT )
3082
- hp_pin = spec -> gen .autocfg .line_out_pins [0 ];
3083
- }
3084
-
3085
3087
alc283_restore_default_value (codec );
3086
3088
3087
3089
if (!hp_pin )
@@ -3115,14 +3117,9 @@ static void alc283_init(struct hda_codec *codec)
3115
3117
static void alc283_shutup (struct hda_codec * codec )
3116
3118
{
3117
3119
struct alc_spec * spec = codec -> spec ;
3118
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3120
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3119
3121
bool hp_pin_sense ;
3120
3122
3121
- if (!spec -> gen .autocfg .hp_outs ) {
3122
- if (spec -> gen .autocfg .line_out_type == AC_JACK_HP_OUT )
3123
- hp_pin = spec -> gen .autocfg .line_out_pins [0 ];
3124
- }
3125
-
3126
3123
if (!hp_pin ) {
3127
3124
alc269_shutup (codec );
3128
3125
return ;
@@ -3156,7 +3153,7 @@ static void alc283_shutup(struct hda_codec *codec)
3156
3153
static void alc256_init (struct hda_codec * codec )
3157
3154
{
3158
3155
struct alc_spec * spec = codec -> spec ;
3159
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3156
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3160
3157
bool hp_pin_sense ;
3161
3158
3162
3159
if (!hp_pin )
@@ -3192,7 +3189,7 @@ static void alc256_init(struct hda_codec *codec)
3192
3189
static void alc256_shutup (struct hda_codec * codec )
3193
3190
{
3194
3191
struct alc_spec * spec = codec -> spec ;
3195
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3192
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3196
3193
bool hp_pin_sense ;
3197
3194
3198
3195
if (!hp_pin ) {
@@ -3228,7 +3225,7 @@ static void alc256_shutup(struct hda_codec *codec)
3228
3225
static void alc225_init (struct hda_codec * codec )
3229
3226
{
3230
3227
struct alc_spec * spec = codec -> spec ;
3231
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3228
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3232
3229
bool hp1_pin_sense , hp2_pin_sense ;
3233
3230
3234
3231
if (!hp_pin )
@@ -3271,7 +3268,7 @@ static void alc225_init(struct hda_codec *codec)
3271
3268
static void alc225_shutup (struct hda_codec * codec )
3272
3269
{
3273
3270
struct alc_spec * spec = codec -> spec ;
3274
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3271
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3275
3272
bool hp1_pin_sense , hp2_pin_sense ;
3276
3273
3277
3274
if (!hp_pin ) {
@@ -3315,7 +3312,7 @@ static void alc225_shutup(struct hda_codec *codec)
3315
3312
static void alc_default_init (struct hda_codec * codec )
3316
3313
{
3317
3314
struct alc_spec * spec = codec -> spec ;
3318
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3315
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3319
3316
bool hp_pin_sense ;
3320
3317
3321
3318
if (!hp_pin )
@@ -3344,7 +3341,7 @@ static void alc_default_init(struct hda_codec *codec)
3344
3341
static void alc_default_shutup (struct hda_codec * codec )
3345
3342
{
3346
3343
struct alc_spec * spec = codec -> spec ;
3347
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3344
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3348
3345
bool hp_pin_sense ;
3349
3346
3350
3347
if (!hp_pin ) {
@@ -3376,7 +3373,7 @@ static void alc_default_shutup(struct hda_codec *codec)
3376
3373
static void alc294_hp_init (struct hda_codec * codec )
3377
3374
{
3378
3375
struct alc_spec * spec = codec -> spec ;
3379
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
3376
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
3380
3377
int i , val ;
3381
3378
3382
3379
if (!hp_pin )
@@ -4780,7 +4777,7 @@ static void alc_update_headset_mode(struct hda_codec *codec)
4780
4777
struct alc_spec * spec = codec -> spec ;
4781
4778
4782
4779
hda_nid_t mux_pin = spec -> gen .imux_pins [spec -> gen .cur_mux [0 ]];
4783
- hda_nid_t hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
4780
+ hda_nid_t hp_pin = alc_get_hp_pin ( spec ) ;
4784
4781
4785
4782
int new_headset_mode ;
4786
4783
@@ -5059,7 +5056,7 @@ static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5059
5056
static void alc_shutup_dell_xps13 (struct hda_codec * codec )
5060
5057
{
5061
5058
struct alc_spec * spec = codec -> spec ;
5062
- int hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
5059
+ int hp_pin = alc_get_hp_pin ( spec ) ;
5063
5060
5064
5061
/* Prevent pop noises when headphones are plugged in */
5065
5062
snd_hda_codec_write (codec , hp_pin , 0 ,
@@ -5152,7 +5149,7 @@ static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5152
5149
5153
5150
if (action == HDA_FIXUP_ACT_PROBE ) {
5154
5151
int mic_pin = find_ext_mic_pin (codec );
5155
- int hp_pin = spec -> gen . autocfg . hp_pins [ 0 ] ;
5152
+ int hp_pin = alc_get_hp_pin ( spec ) ;
5156
5153
5157
5154
if (snd_BUG_ON (!mic_pin || !hp_pin ))
5158
5155
return ;
@@ -5634,6 +5631,7 @@ enum {
5634
5631
ALC294_FIXUP_ASUS_HEADSET_MIC ,
5635
5632
ALC294_FIXUP_ASUS_SPK ,
5636
5633
ALC225_FIXUP_HEADSET_JACK ,
5634
+ ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ,
5637
5635
};
5638
5636
5639
5637
static const struct hda_fixup alc269_fixups [] = {
@@ -6580,6 +6578,15 @@ static const struct hda_fixup alc269_fixups[] = {
6580
6578
.type = HDA_FIXUP_FUNC ,
6581
6579
.v .func = alc_fixup_headset_jack ,
6582
6580
},
6581
+ [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ] = {
6582
+ .type = HDA_FIXUP_PINS ,
6583
+ .v .pins = (const struct hda_pintbl []) {
6584
+ { 0x1a , 0x01a1913c }, /* use as headset mic, without its own jack detect */
6585
+ { }
6586
+ },
6587
+ .chained = true,
6588
+ .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6589
+ },
6583
6590
};
6584
6591
6585
6592
static const struct snd_pci_quirk alc269_fixup_tbl [] = {
@@ -6758,6 +6765,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6758
6765
SND_PCI_QUIRK (0x1458 , 0xfa53 , "Gigabyte BXBT-2807" , ALC283_FIXUP_HEADSET_MIC ),
6759
6766
SND_PCI_QUIRK (0x1462 , 0xb120 , "MSI Cubi MS-B120" , ALC283_FIXUP_HEADSET_MIC ),
6760
6767
SND_PCI_QUIRK (0x1462 , 0xb171 , "Cubi N 8GL (MS-B171)" , ALC283_FIXUP_HEADSET_MIC ),
6768
+ SND_PCI_QUIRK (0x1558 , 0x1325 , "System76 Darter Pro (darp5)" , ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ),
6761
6769
SND_PCI_QUIRK (0x17aa , 0x1036 , "Lenovo P520" , ALC233_FIXUP_LENOVO_MULTI_CODECS ),
6762
6770
SND_PCI_QUIRK (0x17aa , 0x20f2 , "Thinkpad SL410/510" , ALC269_FIXUP_SKU_IGNORE ),
6763
6771
SND_PCI_QUIRK (0x17aa , 0x215e , "Thinkpad L512" , ALC269_FIXUP_SKU_IGNORE ),
0 commit comments