From patchwork Tue Jul 31 02:47:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Xingchao X-Patchwork-Id: 1256981 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 486C4DF24C for ; Tue, 31 Jul 2012 03:02:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 420AD9EB35 for ; Mon, 30 Jul 2012 20:02:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 412989EB35 for ; Mon, 30 Jul 2012 19:58:59 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 30 Jul 2012 19:58:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="179583544" Received: from wxc-intel.bj.intel.com ([10.238.145.98]) by orsmga002.jf.intel.com with ESMTP; 30 Jul 2012 19:58:57 -0700 From: Wang Xingchao To: intel-gfx@lists.freedesktop.org Date: Tue, 31 Jul 2012 10:47:05 +0800 Message-Id: <1343702825-15439-5-git-send-email-xingchao.wang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343702825-15439-1-git-send-email-xingchao.wang@intel.com> References: <1343702825-15439-1-git-send-email-xingchao.wang@intel.com> Cc: paulo.r.zanoni@intel.com Subject: [Intel-gfx] [PATCH V2 4/4] ALSA HDA: Force HDMI pins enabled X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org There's one issue for HDMI pins, even the related pin will be enabled when the stream is active but the GPU registers show the PIN is not in active state, so we force all pins in active state and donot close it when the stream is closed. Signed-off-by: Wang Xingchao --- sound/pci/hda/patch_hdmi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index ad319d4..64cc9e0 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -421,13 +421,17 @@ static void hdmi_write_dip_byte(struct hda_codec *codec, hda_nid_t pin_nid, static void hdmi_init_pin(struct hda_codec *codec, hda_nid_t pin_nid) { + /* Force all output Pins enabled */ + snd_printk(KERN_DEBUG "HDMI: enable all output\n"); + snd_hda_codec_write(codec, pin_nid, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40); + /* Unmute */ - if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP) + if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP) { + snd_printk(KERN_DEBUG "HDMI: unmute pin %d\n", pin_nid); snd_hda_codec_write(codec, pin_nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); - /* Disable pin out until stream is active*/ - snd_hda_codec_write(codec, pin_nid, 0, - AC_VERB_SET_PIN_WIDGET_CONTROL, 0); + } } static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t cvt_nid) @@ -1190,9 +1194,6 @@ static int generic_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0); - snd_hda_codec_write(codec, per_pin->pin_nid, 0, - AC_VERB_SET_PIN_WIDGET_CONTROL, - pinctl & ~PIN_OUT); snd_hda_spdif_ctls_unassign(codec, pin_idx); }