]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.5.1/alsa-hda-add-dock-support-for-thinkpad-x230-tablet.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.5.1 / alsa-hda-add-dock-support-for-thinkpad-x230-tablet.patch
CommitLineData
a993e515
GKH
1From 108cc108a3bb42fe4705df1317ff98e1e29428a6 Mon Sep 17 00:00:00 2001
2From: David Henningsson <david.henningsson@canonical.com>
3Date: Fri, 20 Jul 2012 10:37:25 +0200
4Subject: ALSA: hda - add dock support for Thinkpad X230 Tablet
5
6From: David Henningsson <david.henningsson@canonical.com>
7
8commit 108cc108a3bb42fe4705df1317ff98e1e29428a6 upstream.
9
10Also add a model/fixup string "lenovo-dock", so that other Thinkpad
11users will be able to test this fixup easily, to see if it enables
12dock I/O for them as well.
13
14BugLink: https://bugs.launchpad.net/bugs/1026953
15Tested-by: John McCarron <john.mccarron@canonical.com>
16Signed-off-by: David Henningsson <david.henningsson@canonical.com>
17Signed-off-by: Takashi Iwai <tiwai@suse.de>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 Documentation/sound/alsa/HD-Audio-Models.txt | 3 ++-
22 sound/pci/hda/patch_realtek.c | 27 +++++++++++++++++++++++++++
23 2 files changed, 29 insertions(+), 1 deletion(-)
24
25--- a/Documentation/sound/alsa/HD-Audio-Models.txt
26+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
27@@ -21,10 +21,11 @@ ALC267/268
28 ==========
29 N/A
30
31-ALC269
32+ALC269/270/275/276/280/282
33 ======
34 laptop-amic Laptops with analog-mic input
35 laptop-dmic Laptops with digital-mic input
36+ lenovo-dock Enables docking station I/O for some Lenovos
37
38 ALC662/663/272
39 ==============
40--- a/sound/pci/hda/patch_realtek.c
41+++ b/sound/pci/hda/patch_realtek.c
42@@ -5704,6 +5704,15 @@ static int alc269_resume(struct hda_code
43 }
44 #endif /* CONFIG_PM */
45
46+static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
47+ const struct alc_fixup *fix, int action)
48+{
49+ struct alc_spec *spec = codec->spec;
50+
51+ if (action == ALC_FIXUP_ACT_PRE_PROBE)
52+ spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
53+}
54+
55 static void alc269_fixup_hweq(struct hda_codec *codec,
56 const struct alc_fixup *fix, int action)
57 {
58@@ -5828,6 +5837,8 @@ enum {
59 ALC269VB_FIXUP_AMIC,
60 ALC269VB_FIXUP_DMIC,
61 ALC269_FIXUP_MIC2_MUTE_LED,
62+ ALC269_FIXUP_LENOVO_DOCK,
63+ ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
64 };
65
66 static const struct alc_fixup alc269_fixups[] = {
67@@ -5952,6 +5963,20 @@ static const struct alc_fixup alc269_fix
68 .type = ALC_FIXUP_FUNC,
69 .v.func = alc269_fixup_mic2_mute,
70 },
71+ [ALC269_FIXUP_LENOVO_DOCK] = {
72+ .type = ALC_FIXUP_PINS,
73+ .v.pins = (const struct alc_pincfg[]) {
74+ { 0x19, 0x23a11040 }, /* dock mic */
75+ { 0x1b, 0x2121103f }, /* dock headphone */
76+ { }
77+ },
78+ .chained = true,
79+ .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
80+ },
81+ [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
82+ .type = ALC_FIXUP_FUNC,
83+ .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
84+ },
85 };
86
87 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
88@@ -5975,6 +6000,7 @@ static const struct snd_pci_quirk alc269
89 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
90 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
91 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
92+ SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
93 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
94 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),
95 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
96@@ -6033,6 +6059,7 @@ static const struct snd_pci_quirk alc269
97 static const struct alc_model_fixup alc269_fixup_models[] = {
98 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
99 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
100+ {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
101 {}
102 };
103