From patchwork Wed Jul 15 07:39:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 6794421 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 012029F380 for ; Wed, 15 Jul 2015 07:58:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26D1D2053B for ; Wed, 15 Jul 2015 07:58:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 93E242052D for ; Wed, 15 Jul 2015 07:58:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A7C5D26588F; Wed, 15 Jul 2015 09:58:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 556AC2658C8; Wed, 15 Jul 2015 09:50:25 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 96A4A2658C8; Wed, 15 Jul 2015 09:50:24 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 9D3C2265CF4 for ; Wed, 15 Jul 2015 09:39:49 +0200 (CEST) Received: from c83-254-138-200.bredband.comhem.se ([83.254.138.200] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZFHHz-0002rR-7e; Wed, 15 Jul 2015 07:39:35 +0000 From: David Henningsson To: tiwai@suse.de, alsa-devel@alsa-project.org Date: Wed, 15 Jul 2015 09:39:35 +0200 Message-Id: <1436945975-3279-1-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 Cc: hui.wang@canonical.com, mengdong.lin@intel.com, David Henningsson Subject: [alsa-devel] [PATCH] ALSA: hda - Fix Skylake codec timeouts X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP When the controller is powered up but the HDMI codec is powered down on Skylake, the power well is turned off. When the codec is then powered up again, we need to poke the codec a little extra to make sure it wakes up. Otherwise we'll get sad "no response from codec" messages and broken audio. Signed-off-by: David Henningsson Tested-by: Woodrow Shen --- * It would good to have an ack from Intel on this patch, since they have better hardware knowledge than I. * Also I haven't really kept track of all recent reorganisation of the hda driver so I'm not totally sure how many kernels back (if any) that this applies to sound/pci/hda/hda_intel.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index ca151b4..872e9a7 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -567,9 +567,17 @@ static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev) /* Enable/disable i915 display power for the link */ static int azx_intel_link_power(struct azx *chip, bool enable) { + int err; struct hdac_bus *bus = azx_bus(chip); - return snd_hdac_display_power(bus, enable); + err = snd_hdac_display_power(bus, enable); + if (err < 0) + return err; + if (enable && (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)) { + snd_hdac_set_codec_wakeup(bus, true); + snd_hdac_set_codec_wakeup(bus, false); + } + return 0; } /*