From patchwork Wed Jan 2 09:17:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 208975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 1929E2C009A for ; Wed, 2 Jan 2013 20:17:54 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TqKSD-0000HQ-6R; Wed, 02 Jan 2013 09:17:41 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TqKSA-0000HL-Kj for kernel-team@lists.ubuntu.com; Wed, 02 Jan 2013 09:17:38 +0000 Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TqKSA-0001tq-50; Wed, 02 Jan 2013 09:17:38 +0000 From: David Henningsson To: kernel-team@lists.ubuntu.com Subject: [PATCH (Quantal SRU)] ALSA: hda - bug fix for invalid connection list of Haswell HDMI codec pins Date: Wed, 2 Jan 2013 10:17:35 +0100 Message-Id: <1357118255-3200-1-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.7.9.5 Cc: Takashi Iwai , Mengdong Lin , 1095242@bugs.launchpad.net, Xingchao Wang X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Mengdong Lin Haswell HDMI codec pins may report invalid connection list entries, which will cause failure to play audio via HDMI or Display Port. So this patch adds fixup for Haswell to workaround this hardware issue: enable DP1.2 mode and override the pins' connection list entries with proper value. Signed-off-by: Mengdong Lin Signed-off-by: Xingchao Wang Signed-off-by: Takashi Iwai (cherry picked from commit 6ffe168f822cf7f777987cddc00ade542fd73bf0) BugLink: https://bugs.launchpad.net/bugs/1095242 Signed-off-by: David Henningsson Acked-by: Colin Ian King Acked-by: Andy Whitcroft --- We're being advised by Intel to include the following patch for the Quantal kernel, to fix a Haswell/Sharkbay HDMI/DP audio issue. As there are no sharkbay machines out there yet, and the patch contains a "if codec->vendor_id == 80862807" I assume this will cause no regressions. The commit is already in the 3.8 kernel, so this is just for the 3.5 SRU. sound/pci/hda/patch_hdmi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index dc249b2..a7e4da4 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1323,6 +1323,30 @@ static const struct hda_codec_ops generic_hdmi_patch_ops = { .unsol_event = hdmi_unsol_event, }; +static void intel_haswell_fixup_connect_list(struct hda_codec *codec) +{ + unsigned int vendor_param; + hda_nid_t list[3] = {0x2, 0x3, 0x4}; + + vendor_param = snd_hda_codec_read(codec, 0x08, 0, 0xf81, 0); + if (vendor_param == -1 || vendor_param & 0x02) + return; + + /* enable DP1.2 mode */ + vendor_param |= 0x02; + snd_hda_codec_read(codec, 0x08, 0, 0x781, vendor_param); + + vendor_param = snd_hda_codec_read(codec, 0x08, 0, 0xf81, 0); + if (vendor_param == -1 || !(vendor_param & 0x02)) + return; + + /* override 3 pins connection list */ + snd_hda_override_conn_list(codec, 0x05, 3, list); + snd_hda_override_conn_list(codec, 0x06, 3, list); + snd_hda_override_conn_list(codec, 0x07, 3, list); +} + + static int patch_generic_hdmi(struct hda_codec *codec) { struct hdmi_spec *spec; @@ -1332,6 +1356,10 @@ static int patch_generic_hdmi(struct hda_codec *codec) return -ENOMEM; codec->spec = spec; + + if (codec->vendor_id == 0x80862807) + intel_haswell_fixup_connect_list(codec); + if (hdmi_parse_codec(codec) < 0) { codec->spec = NULL; kfree(spec);