ALSA: cs5535audio: invert EAPD for OLPC (newer than B3)

Fix an audible pop described in <http://dev.laptop.org/ticket/977>.  Originally
based upon fixes by Mitch Bradley and Chris Ball.

Signed-off-by: Andres Salomon <dilinger@debian.org>
diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c
index 9073fb3..ff7b68b 100644
--- a/sound/pci/cs5535audio/cs5535audio_olpc.c
+++ b/sound/pci/cs5535audio/cs5535audio_olpc.c
@@ -103,6 +103,17 @@
 	.private_value = 0
 };
 
+void __devinit olpc_prequirks(struct snd_card *card,
+		struct snd_ac97_template *ac97)
+{
+	if (!machine_is_olpc())
+		return;
+
+	/* invert EAPD if on an OLPC B3 or higher */
+	if (olpc_board_at_least(olpc_board_pre(0xb3)))
+		ac97->scaps |= AC97_SCAP_INV_EAPD;
+}
+
 int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
 {
 	if (!machine_is_olpc())