From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH V2 4/4] ALSA HDA: Force HDMI pins enabled Date: Tue, 31 Jul 2012 13:18:20 +0200 Message-ID: References: <1343702825-15439-1-git-send-email-xingchao.wang@intel.com> <1343702825-15439-5-git-send-email-xingchao.wang@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id 0ABDD9EC15 for ; Tue, 31 Jul 2012 04:18:22 -0700 (PDT) In-Reply-To: <1343702825-15439-5-git-send-email-xingchao.wang@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Wang Xingchao Cc: intel-gfx@lists.freedesktop.org, paulo.r.zanoni@intel.com List-Id: intel-gfx@lists.freedesktop.org At Tue, 31 Jul 2012 10:47:05 +0800, Wang Xingchao wrote: > > 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 Oh no, this is a bad workaround. Please be more exact at which timing the pin must be set. Setting all the time is just a wrong approach. Also, at the next time, please Cc to alsa-devel and other developers. I don't want that such a patch is merged secretly through drm tree :) > --- > 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); Don't put debug prints unconditionally. > + > /* 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); Ditto. thanks, Takashi > 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); > } > > -- > 1.7.9.5 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx >