Skip to content

Commit d561aa0

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek - Fix lose hp_pins for disable auto mute
When auto_mute = no or spec->suppress_auto_mute = 1, cfg->hp_pins will lose value. Add this patch to find hp_pins value. I add fixed for ALC282 ALC225 ALC256 ALC294 and alc_default_init() alc_default_shutup(). Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 89e3a56 commit d561aa0

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,6 +2963,11 @@ static void alc282_init(struct hda_codec *codec)
29632963
bool hp_pin_sense;
29642964
int coef78;
29652965

2966+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
2967+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
2968+
hp_pin = spec->gen.autocfg.line_out_pins[0];
2969+
}
2970+
29662971
alc282_restore_default_value(codec);
29672972

29682973
if (!hp_pin)
@@ -3000,6 +3005,11 @@ static void alc282_shutup(struct hda_codec *codec)
30003005
bool hp_pin_sense;
30013006
int coef78;
30023007

3008+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3009+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3010+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3011+
}
3012+
30033013
if (!hp_pin) {
30043014
alc269_shutup(codec);
30053015
return;
@@ -3159,6 +3169,11 @@ static void alc256_init(struct hda_codec *codec)
31593169
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
31603170
bool hp_pin_sense;
31613171

3172+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3173+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3174+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3175+
}
3176+
31623177
if (!hp_pin)
31633178
return;
31643179

@@ -3195,6 +3210,11 @@ static void alc256_shutup(struct hda_codec *codec)
31953210
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
31963211
bool hp_pin_sense;
31973212

3213+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3214+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3215+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3216+
}
3217+
31983218
if (!hp_pin) {
31993219
alc269_shutup(codec);
32003220
return;
@@ -3231,6 +3251,11 @@ static void alc225_init(struct hda_codec *codec)
32313251
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
32323252
bool hp1_pin_sense, hp2_pin_sense;
32333253

3254+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3255+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3256+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3257+
}
3258+
32343259
if (!hp_pin)
32353260
return;
32363261

@@ -3274,6 +3299,11 @@ static void alc225_shutup(struct hda_codec *codec)
32743299
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
32753300
bool hp1_pin_sense, hp2_pin_sense;
32763301

3302+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3303+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3304+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3305+
}
3306+
32773307
if (!hp_pin) {
32783308
alc269_shutup(codec);
32793309
return;
@@ -3318,6 +3348,11 @@ static void alc_default_init(struct hda_codec *codec)
33183348
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
33193349
bool hp_pin_sense;
33203350

3351+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3352+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3353+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3354+
}
3355+
33213356
if (!hp_pin)
33223357
return;
33233358

@@ -3347,6 +3382,11 @@ static void alc_default_shutup(struct hda_codec *codec)
33473382
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
33483383
bool hp_pin_sense;
33493384

3385+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3386+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3387+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3388+
}
3389+
33503390
if (!hp_pin) {
33513391
alc269_shutup(codec);
33523392
return;
@@ -3379,6 +3419,11 @@ static void alc294_hp_init(struct hda_codec *codec)
33793419
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
33803420
int i, val;
33813421

3422+
if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) {
3423+
if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3424+
hp_pin = spec->gen.autocfg.line_out_pins[0];
3425+
}
3426+
33823427
if (!hp_pin)
33833428
return;
33843429

0 commit comments

Comments
 (0)