From b9368f5c10b15f2b79a58666849827edc1f2f3d4 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 17 Feb 2012 17:54:44 +0100
Subject: [PATCH] ALSA: hda/realtek - Replace ALC880 model=tcl with auto-parser
Git-commit: b9368f5c10b15f2b79a58666849827edc1f2f3d4
Patch-mainline: 3.4-rc3
References: FATE#314311

It needs a few extra setups for EAPD, but others look fairly
straightforward.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 Documentation/sound/alsa/HD-Audio-Models.txt |    3 ---
 sound/pci/hda/patch_realtek.c                |   13 +++++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -16,9 +16,6 @@ ALC880
   uniwill	3-jack
   fujitsu	Fujitsu Laptops (Pi1536)
   F1734		2-jack
-  lg-lw		LG LW20/LW25 laptop
-  tcl		TCL S700
-  medion	Medion Rim 2150
   test		for testing/debugging purpose, almost all controls can be
 		adjusted.  Appearing only when compiled with
 		$CONFIG_SND_DEBUG=y
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4410,6 +4410,7 @@ enum {
 	ALC880_FIXUP_LG,
 	ALC880_FIXUP_W810,
 	ALC880_FIXUP_EAPD_COEF,
+	ALC880_FIXUP_TCL_S700,
 };
 
 static const struct alc_fixup alc880_fixups[] = {
@@ -4456,6 +4457,17 @@ static const struct alc_fixup alc880_fix
 			{}
 		},
 	},
+	[ALC880_FIXUP_TCL_S700] = {
+		.type = ALC_FIXUP_VERBS,
+		.v.verbs = (const struct hda_verb[]) {
+			/* change to EAPD mode */
+			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
+			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3070 },
+			{}
+		},
+		.chained = true,
+		.chain_id = ALC880_FIXUP_GPIO2,
+	},
 };
 
 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
@@ -4466,6 +4478,7 @@ static const struct snd_pci_quirk alc880
 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
 	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
+	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
 	{}
 };
 
