Skip to content

Commit c8a9afa

Browse files
perexgtiwai
authored andcommitted
ALSA: hda/realtek: merge alc_fixup_headset_jack to alc295_fixup_chromebook
The ALC225_FIXUP_HEADSET_JACK fixup can be merged to alc295_fixup_chromebook. There are no other users for ALC225_FIXUP_HEADSET_JACK other than the chromebook hardware. Fixes: 10f5b1b ("ALSA: hda/realtek - Fixed Headset Mic JD not stable") Cc: Kailang Yang <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent c24a126 commit c8a9afa

File tree

1 file changed

+13
-30
lines changed

1 file changed

+13
-30
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5491,7 +5491,7 @@ static void alc_headset_btn_callback(struct hda_codec *codec,
54915491
jack->jack->button_state = report;
54925492
}
54935493

5494-
static void alc_fixup_headset_jack(struct hda_codec *codec,
5494+
static void alc295_fixup_chromebook(struct hda_codec *codec,
54955495
const struct hda_fixup *fix, int action)
54965496
{
54975497

@@ -5501,6 +5501,16 @@ static void alc_fixup_headset_jack(struct hda_codec *codec,
55015501
alc_headset_btn_callback);
55025502
snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false,
55035503
SND_JACK_HEADSET, alc_headset_btn_keymap);
5504+
switch (codec->core.vendor_id) {
5505+
case 0x10ec0295:
5506+
alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
5507+
alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
5508+
break;
5509+
case 0x10ec0236:
5510+
alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
5511+
alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
5512+
break;
5513+
}
55045514
break;
55055515
case HDA_FIXUP_ACT_INIT:
55065516
switch (codec->core.vendor_id) {
@@ -5521,26 +5531,6 @@ static void alc_fixup_headset_jack(struct hda_codec *codec,
55215531
}
55225532
}
55235533

5524-
static void alc295_fixup_chromebook(struct hda_codec *codec,
5525-
const struct hda_fixup *fix, int action)
5526-
{
5527-
5528-
switch (action) {
5529-
case HDA_FIXUP_ACT_PRE_PROBE:
5530-
switch (codec->core.vendor_id) {
5531-
case 0x10ec0295:
5532-
alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
5533-
alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
5534-
break;
5535-
case 0x10ec0236:
5536-
alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
5537-
alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
5538-
break;
5539-
}
5540-
break;
5541-
}
5542-
}
5543-
55445534
static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
55455535
const struct hda_fixup *fix, int action)
55465536
{
@@ -5690,7 +5680,6 @@ enum {
56905680
ALC294_FIXUP_ASUS_MIC,
56915681
ALC294_FIXUP_ASUS_HEADSET_MIC,
56925682
ALC294_FIXUP_ASUS_SPK,
5693-
ALC225_FIXUP_HEADSET_JACK,
56945683
ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
56955684
ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
56965685
ALC255_FIXUP_ACER_HEADSET_MIC,
@@ -6637,9 +6626,9 @@ static const struct hda_fixup alc269_fixups[] = {
66376626
.chained = true,
66386627
.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
66396628
},
6640-
[ALC225_FIXUP_HEADSET_JACK] = {
6629+
[ALC295_FIXUP_CHROME_BOOK] = {
66416630
.type = HDA_FIXUP_FUNC,
6642-
.v.func = alc_fixup_headset_jack,
6631+
.v.func = alc295_fixup_chromebook,
66436632
},
66446633
[ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
66456634
.type = HDA_FIXUP_PINS,
@@ -6671,12 +6660,6 @@ static const struct hda_fixup alc269_fixups[] = {
66716660
.chained = true,
66726661
.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
66736662
},
6674-
[ALC295_FIXUP_CHROME_BOOK] = {
6675-
.type = HDA_FIXUP_FUNC,
6676-
.v.func = alc295_fixup_chromebook,
6677-
.chained = true,
6678-
.chain_id = ALC225_FIXUP_HEADSET_JACK
6679-
},
66806663
};
66816664

66826665
static const struct snd_pci_quirk alc269_fixup_tbl[] = {

0 commit comments

Comments
 (0)