From 27e917f82bfcf8c51a2c025ddfb69e0b5947f50b Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 17 Feb 2012 17:49:54 +0100
Subject: [PATCH] ALSA: hda/realtek - Drop ALC880 model=clevo
Git-commit: 27e917f82bfcf8c51a2c025ddfb69e0b5947f50b
Patch-mainline: 3.4-rc3
References: FATE#314311

Clevo machines with ALC880 are all well with proper BIOS setup.
It seems still requiring the additional COEF setup for the EAPD.

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

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

--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -18,7 +18,6 @@ ALC880
   F1734		2-jack
   lg-lw		LG LW20/LW25 laptop
   tcl		TCL S700
-  clevo		Clevo laptops (m520G, m665n)
   medion	Medion Rim 2150
   test		for testing/debugging purpose, almost all controls can be
 		adjusted.  Appearing only when compiled with
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4409,6 +4409,7 @@ enum {
 	ALC880_FIXUP_MEDION_RIM,
 	ALC880_FIXUP_LG,
 	ALC880_FIXUP_W810,
+	ALC880_FIXUP_EAPD_COEF,
 };
 
 static const struct alc_fixup alc880_fixups[] = {
@@ -4446,10 +4447,20 @@ static const struct alc_fixup alc880_fix
 		.chained = true,
 		.chain_id = ALC880_FIXUP_GPIO2,
 	},
+	[ALC880_FIXUP_EAPD_COEF] = {
+		.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,  0x3060 },
+			{}
+		},
+	},
 };
 
 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
+	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
