]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.11/alsa-hda-realtek-move-to-act_init-state.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.11 / alsa-hda-realtek-move-to-act_init-state.patch
1 From ebe8c5500e361bb8083a820c77e92b6e4b42deff Mon Sep 17 00:00:00 2001
2 From: Kailang Yang <kailang@realtek.com>
3 Date: Wed, 3 Apr 2019 15:31:49 +0800
4 Subject: ALSA: hda/realtek - Move to ACT_INIT state
5
6 [ Upstream commit 8983eb602af511fc5822f5ff4a82074c68816fd9 ]
7
8 It will be lose Mic JD state when Chrome OS boot and headset was plugged.
9 Just Implement of reset combo jack JD verb for ACT_PRE_PROBE state.
10 Intel test result was also failed.
11 It test passed until changed the initial state to ACT_INIT.
12 Mic JD will show every time.
13 This patch also changed the model name as 'alc-chrome-book' for
14 application of Chrome OS.
15
16 Fixes: 10f5b1b85ed1 ("ALSA: hda/realtek - Fixed Headset Mic JD not stable")
17 Signed-off-by: Kailang Yang <kailang@realtek.com>
18 Signed-off-by: Takashi Iwai <tiwai@suse.de>
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 ---
21 sound/pci/hda/patch_realtek.c | 41 +++++++++++++++++++++++++----------
22 1 file changed, 29 insertions(+), 12 deletions(-)
23
24 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
25 index f061167062bc..a9f69c3a3e0b 100644
26 --- a/sound/pci/hda/patch_realtek.c
27 +++ b/sound/pci/hda/patch_realtek.c
28 @@ -5490,7 +5490,7 @@ static void alc_headset_btn_callback(struct hda_codec *codec,
29 jack->jack->button_state = report;
30 }
31
32 -static void alc295_fixup_chromebook(struct hda_codec *codec,
33 +static void alc_fixup_headset_jack(struct hda_codec *codec,
34 const struct hda_fixup *fix, int action)
35 {
36
37 @@ -5500,16 +5500,6 @@ static void alc295_fixup_chromebook(struct hda_codec *codec,
38 alc_headset_btn_callback);
39 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false,
40 SND_JACK_HEADSET, alc_headset_btn_keymap);
41 - switch (codec->core.vendor_id) {
42 - case 0x10ec0295:
43 - alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
44 - alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
45 - break;
46 - case 0x10ec0236:
47 - alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
48 - alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
49 - break;
50 - }
51 break;
52 case HDA_FIXUP_ACT_INIT:
53 switch (codec->core.vendor_id) {
54 @@ -5530,6 +5520,25 @@ static void alc295_fixup_chromebook(struct hda_codec *codec,
55 }
56 }
57
58 +static void alc295_fixup_chromebook(struct hda_codec *codec,
59 + const struct hda_fixup *fix, int action)
60 +{
61 + switch (action) {
62 + case HDA_FIXUP_ACT_INIT:
63 + switch (codec->core.vendor_id) {
64 + case 0x10ec0295:
65 + alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
66 + alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
67 + break;
68 + case 0x10ec0236:
69 + alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
70 + alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
71 + break;
72 + }
73 + break;
74 + }
75 +}
76 +
77 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
78 const struct hda_fixup *fix, int action)
79 {
80 @@ -5684,6 +5693,7 @@ enum {
81 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
82 ALC255_FIXUP_ACER_HEADSET_MIC,
83 ALC295_FIXUP_CHROME_BOOK,
84 + ALC225_FIXUP_HEADSET_JACK,
85 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
86 ALC225_FIXUP_WYSE_AUTO_MUTE,
87 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
88 @@ -6645,6 +6655,12 @@ static const struct hda_fixup alc269_fixups[] = {
89 [ALC295_FIXUP_CHROME_BOOK] = {
90 .type = HDA_FIXUP_FUNC,
91 .v.func = alc295_fixup_chromebook,
92 + .chained = true,
93 + .chain_id = ALC225_FIXUP_HEADSET_JACK
94 + },
95 + [ALC225_FIXUP_HEADSET_JACK] = {
96 + .type = HDA_FIXUP_FUNC,
97 + .v.func = alc_fixup_headset_jack,
98 },
99 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
100 .type = HDA_FIXUP_PINS,
101 @@ -7143,7 +7159,8 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
102 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
103 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
104 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
105 - {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-sense-combo"},
106 + {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
107 + {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
108 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
109 {}
110 };
111 --
112 2.19.1
113