From patchwork Tue Jun 9 06:05:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 6569981 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E2CB1C0020 for ; Tue, 9 Jun 2015 06:14:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E3A120497 for ; Tue, 9 Jun 2015 06:14:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C73B9203E1 for ; Tue, 9 Jun 2015 06:14:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 77094264F33; Tue, 9 Jun 2015 08:14:10 +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 739A0260508; Tue, 9 Jun 2015 08:14:02 +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 5D4D22606FD; Tue, 9 Jun 2015 08:14:01 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 13A5B260442 for ; Tue, 9 Jun 2015 08:13:53 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 08 Jun 2015 23:13:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,577,1427785200"; d="scan'208";a="743430582" Received: from younglee-grantley.sh.intel.com ([10.239.159.178]) by orsmga002.jf.intel.com with ESMTP; 08 Jun 2015 23:13:52 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Tue, 9 Jun 2015 14:05:18 +0800 Message-Id: <1433829918-5807-1-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Libin Yang Subject: [alsa-devel] [PATCH] ALSA: hda - PCH HDA controller not controlled by i915 power 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 From: Libin Yang On some Intel platforms, the HDMI codec is connected to PCH HDA controller. In this case, AZX_DCAPS_I915_POWERWELL is set and the i915 power well failure should not block the hda controller initialization. Signed-off-by: Libin Yang --- sound/hda/hdac_i915.c | 6 +++--- sound/pci/hda/hda_intel.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index cb78c25..4f4036a 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -27,7 +27,7 @@ int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable) { struct i915_audio_component *acomp = bus->audio_component; - if (!acomp->ops) + if (!acomp || !acomp->ops) return -ENODEV; if (!acomp->ops->codec_wake_override) { @@ -49,7 +49,7 @@ int snd_hdac_display_power(struct hdac_bus *bus, bool enable) { struct i915_audio_component *acomp = bus->audio_component; - if (!acomp->ops) + if (!acomp || !acomp->ops) return -ENODEV; dev_dbg(bus->dev, "display power %s\n", @@ -72,7 +72,7 @@ int snd_hdac_get_display_clk(struct hdac_bus *bus) { struct i915_audio_component *acomp = bus->audio_component; - if (!acomp->ops) + if (!acomp || !acomp->ops) return -ENODEV; return acomp->ops->get_cdclk_freq(acomp->dev); diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 7933fb0..775e020 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1986,14 +1986,21 @@ static int azx_probe_continue(struct azx *chip) hda->need_i915_power = 1; err = snd_hdac_i915_init(bus); + /* if controller is located in powerwell, + * the initialization should be stopped. + * if only codec is located in powerwell, + * the hd audio is still ok for analog audio + */ if (err < 0) - goto i915_power_fail; + if (hda->need_i915_power) + goto i915_power_fail; err = snd_hdac_display_power(bus, true); if (err < 0) { dev_err(chip->card->dev, "Cannot turn on display power on i915\n"); - goto i915_power_fail; + if (hda->need_i915_power) + goto i915_power_fail; } }