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

ALC880 model=lg could work fine with the auto-parser due to the recent
rewrite, but it still needs the manual adjustment; namely, the BIOS leaves
unused pins as some real active jacks.  This confuses the parser.
Thus we just cover these pins and override the pin-configs as a fix-up.

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

---
 Documentation/sound/alsa/HD-Audio-Models.txt |    1 -
 sound/pci/hda/patch_realtek.c                |   14 ++++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -17,7 +17,6 @@ ALC880
   uniwill	3-jack
   fujitsu	Fujitsu Laptops (Pi1536)
   F1734		2-jack
-  lg		LG laptop (m1 express dual)
   lg-lw		LG LW20/LW25 laptop
   tcl		TCL S700
   clevo		Clevo laptops (m520G, m665n)
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4407,6 +4407,7 @@ static const struct hda_amp_list alc880_
 enum {
 	ALC880_FIXUP_GPIO2,
 	ALC880_FIXUP_MEDION_RIM,
+	ALC880_FIXUP_LG,
 };
 
 static const struct alc_fixup alc880_fixups[] = {
@@ -4424,10 +4425,23 @@ static const struct alc_fixup alc880_fix
 		.chained = true,
 		.chain_id = ALC880_FIXUP_GPIO2,
 	},
+	[ALC880_FIXUP_LG] = {
+		.type = ALC_FIXUP_PINS,
+		.v.pins = (const struct alc_pincfg[]) {
+			/* disable bogus unused pins */
+			{ 0x16, 0x411111f0 },
+			{ 0x18, 0x411111f0 },
+			{ 0x1a, 0x411111f0 },
+			{ }
+		}
+	},
 };
 
 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
+	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),
 	{}
 };
 
