Lenovo Legion 7 sound not working fix

Hello. So, I love Manjaro, been coming back to it every time I needed to use linux for anything. Recently I fully switched to it permanently because I was fed up with Windows.

But, there is a problem with my sound. Speakers do not work. They seem to be discovered by the system and pavucontrol lets me change settings regarding them, same for alsamixer. Speakers are never muted and when trying to play anything, sound bar goes up, indicating that it’s trying to play a sound on them.

I was trying to find a solution to the problem but even ArchWiki didn’t seem to have a workaround for this laptop’s problem. Until I found this thread: (bugzilla . kernel . org show_bug.cgi ? id = 208555 # c97) (sorry for spaces, couldn’t place a link here and it was the only way i could do it)

By the end of it, people figured out how to fix this issue and made a kernel patch for it. I tried the patch on manjaros gitlab kernel and sound actually worked but it messed up my video drivers somehow so I had to revert back to repo version of the kernel.

I didn’t know how else I could contact devs about this so if putting this in feature request is wrong, I’m sorry about that.


mod. note: moved to Support | Sound

Patch:

diff --git a/sound/pci/hda/legion_15imhg05_speakers.c b/sound/pci/hda/legion_15imhg05_speakers.c
new file mode 100644
index 000000000000..e64761d949c8
--- /dev/null
+++ b/sound/pci/hda/legion_15imhg05_speakers.c
@@ -0,0 +1,495 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Fixes for Lenovo Legion 15IMHg05 speaker output. */
+
+static const struct hda_verb alc287_legion_15imhg05_coefs[] = {
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x41 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, 0x4b0, 0x20 },
+
+    // Set right speaker for Legion 7i.
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x42 },
+
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xc },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2a },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, 0x4b0, 0x20 },
+    {}
+};
+
+static const struct hda_verb alc287_yoga7_14itl5_coefs[] = {
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x41 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, 0x4b0, 0x20 },
+
+    // set right speaker Yoga 7i.
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x46 },
+
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xc },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2a },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, 0x4b0, 0x20 },
+    {}
+};
+
+static const struct hda_verb alc287_13s_gen2_itl_coefs[] = {
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x41 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x11 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x11 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xc },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1a },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xc },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1a },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xf },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x42 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xf },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x42 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x10 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x40 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x10 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x40 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x9 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x9 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4c },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4c },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1d },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4e },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1d },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4e },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1b },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1b },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x19 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x25 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x19 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x25 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x18 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x37 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x18 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x37 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1a },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x40 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1a },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x40 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x16 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x76 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x16 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x76 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x7 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x86 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x7 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x86 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x42 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x42 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x11 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x11 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xc },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2a },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xc },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2a },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xf },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x46 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0xf },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x46 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x10 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x44 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x10 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x44 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x9 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x3 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x9 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4c },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1c },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4c },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1d },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4e },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1d },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x4e },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1b },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1b },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x19 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x25 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x19 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x25 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x18 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x37 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x18 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x37 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1a },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x40 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1a },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x40 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x16 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x76 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x16 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x76 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x17 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x10 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x17 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x10 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x15 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x7 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x86 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x7 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x86 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x1 },
+    {0x20, 0x4b0, 0x20 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x29 },
+    {0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x2 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, AC_VERB_SET_PROC_COEF, 0x0 },
+    {0x20, 0x4b0, 0x20 },
+    {}
+};
+
+static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
+						  const struct hda_fixup *fix,
+						  int action) {
+    struct alc_spec *spec = codec->spec;
+
+    switch (action) {
+    case HDA_FIXUP_ACT_INIT:
+	spec->gen.automute_speaker = 0;
+	//snd_hda_add_verbs(codec, alc287_legion_15imhg05_coefs);
+	break;
+    }
+}
+
+static void alc287_fixup_legion_yoga7_speakers(struct hda_codec *codec,
+					       const struct hda_fixup *fix,
+					       int action) {
+    struct alc_spec *spec = codec->spec;
+
+    switch (action) {
+    case HDA_FIXUP_ACT_INIT:
+	//spec->gen.automute_speaker = 0;
+	snd_hda_add_verbs(codec, alc287_yoga7_14itl5_coefs);
+	break;
+    }
+}
+
+static void alc287_fixup_lenovo_13s_gen2_itl_speakers(struct hda_codec *codec,
+						      const struct hda_fixup *fix,
+						      int action) {
+    struct alc_spec *spec = codec->spec;
+
+    switch (action) {
+    case HDA_FIXUP_ACT_INIT:
+	snd_hda_add_verbs(codec, alc287_13s_gen2_itl_coefs);
+	break;
+    }
+}
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e46e43dac6bf..d9fa4e4ceb5b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6352,6 +6352,9 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
 /* for alc285_fixup_ideapad_s740_coef() */
 #include "ideapad_s740_helper.c"
 
+/* For alc287_fixup_legion_15imhg05_speakers() */
+#include "legion_15imhg05_speakers.c"
+
 enum {
 	ALC269_FIXUP_GPIO2,
 	ALC269_FIXUP_SONY_VAIO,
@@ -6561,6 +6564,10 @@ enum {
 	ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
 	ALC623_FIXUP_LENOVO_THINKSTATION_P340,
 	ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
+	ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
+	ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
+	ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
+	ALC287_FIXUP_13S_GEN2_SPEAKERS,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -8088,6 +8095,30 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
 	},
+	[ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
+		.type = HDA_FIXUP_VERBS,
+		.v.verbs = alc287_legion_15imhg05_coefs,
+		.chained = true,
+		.chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
+	},
+	[ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc287_fixup_legion_15imhg05_speakers,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_HEADSET_MODE,
+	},
+	[ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
+		.type = HDA_FIXUP_VERBS,
+		.v.verbs = alc287_yoga7_14itl5_coefs,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_HEADSET_MODE,
+	},
+	[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc287_fixup_lenovo_13s_gen2_itl_speakers,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_HEADSET_MODE,
+	},
 	[ALC295_FIXUP_ASUS_DACS] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc295_fixup_asus_dacs,
@@ -8520,6 +8551,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
 	SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
 	SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
+	SND_PCI_QUIRK(0x17aa, 0x3813, "Lenovo Legion 7", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
+	SND_PCI_QUIRK(0x17aa, 0x3847, "Lenovo Legion 7 16ACHg6", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
+	SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
+	SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),