Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	"Wu Fengguang" <fengguang.wu@intel.com>,
	"Shane W" <shane-alsa@csy.ca>,
	"David Härdeman" <david@hardeman.nu>
Subject: [PATCH 05/11] intelhdmi - probe for monitor/eld presence at module init time
Date: Sun, 15 Nov 2009 19:32:24 +0800	[thread overview]
Message-ID: <20091115114439.966345053@intel.com> (raw)
In-Reply-To: 20091115113219.606666087@intel.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: hdmi-pin-sense.patch --]
[-- Type: text/plain, Size: 2159 bytes --]

This avoids lost of presence info on module reloading.
The presence info used to be only updated at the (rare) hotplug events.

Proposed by David, thanks!

CC: David Härdeman <david@hardeman.nu>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 sound/pci/hda/patch_intelhdmi.c |   33 ++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

--- sound-2.6.orig/sound/pci/hda/patch_intelhdmi.c	2009-11-02 15:44:26.000000000 +0800
+++ sound-2.6/sound/pci/hda/patch_intelhdmi.c	2009-11-02 15:47:43.000000000 +0800
@@ -259,6 +259,25 @@ static int intel_hdmi_read_pin_conn(stru
 	return 0;
 }
 
+static void hdmi_get_show_eld(struct hda_codec *codec, hda_nid_t pin_nid,
+			      struct hdmi_eld *eld)
+{
+	if (!snd_hdmi_get_eld(eld, codec, pin_nid))
+		snd_hdmi_show_eld(eld);
+}
+
+static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,
+			       struct hdmi_eld *eld)
+{
+	int present = snd_hda_pin_sense(codec, pin_nid);
+
+	eld->monitor_present	= !!(present & AC_PINSENSE_PRESENCE);
+	eld->eld_valid		= !!(present & AC_PINSENSE_ELDV);
+
+	if (present & AC_PINSENSE_ELDV)
+		hdmi_get_show_eld(codec, pin_nid, eld);
+}
+
 static int intel_hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
 {
 	struct intel_hdmi_spec *spec = codec->spec;
@@ -269,6 +288,8 @@ static int intel_hdmi_add_pin(struct hda
 		return -EINVAL;
 	}
 
+	hdmi_present_sense(codec, pin_nid, &spec->sink_eld[spec->num_pins]);
+
 	spec->pin[spec->num_pins] = pin_nid;
 	spec->num_pins++;
 
@@ -436,15 +457,6 @@ static void hdmi_debug_channel_mapping(s
 #endif
 }
 
-static void hdmi_parse_eld(struct hda_codec *codec, int index)
-{
-	struct intel_hdmi_spec *spec = codec->spec;
-	struct hdmi_eld *eld = &spec->sink_eld[index];
-
-	if (!snd_hdmi_get_eld(eld, codec, spec->pin[index]))
-		snd_hdmi_show_eld(eld);
-}
-
 
 /*
  * Audio InfoFrame routines
@@ -677,7 +690,7 @@ static void hdmi_intrinsic_event(struct 
 	spec->sink_eld[index].eld_valid = eldv;
 
 	if (pind && eldv) {
-		hdmi_parse_eld(codec, index);
+		hdmi_get_show_eld(codec, spec->pin[index], &spec->sink_eld[index]);
 		/* TODO: do real things about ELD */
 	}
 }



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2009-11-15 11:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-15 11:32 [PATCH 00/11] Intel HDMI fixes Wu Fengguang
2009-11-15 11:32 ` [PATCH 01/11] intelhdmi - fix audio infoframe fill size Wu Fengguang
2009-11-15 11:32 ` [PATCH 02/11] intelhdmi - fix channel mapping slot mask Wu Fengguang
2009-11-15 11:32 ` [PATCH 03/11] intelhdmi - export monitor-presence and ELD-valid status Wu Fengguang
2009-11-15 11:32 ` [PATCH 04/11] hda - introduce snd_hda_pin_sense() Wu Fengguang
2009-11-15 11:32 ` Wu Fengguang [this message]
2009-11-15 11:32 ` [PATCH 06/11] intelhdmi - separate out infoframe checksum routine Wu Fengguang
2009-11-15 11:32 ` [PATCH 07/11] intelhdmi - sticky infoframe Wu Fengguang
2009-11-15 11:32 ` [PATCH 08/11] intelhdmi - sticky stream id and format Wu Fengguang
2009-11-15 11:32 ` [PATCH 09/11] intelhdmi - sticky channel count Wu Fengguang
2009-11-15 11:32 ` [PATCH 10/11] hda - show EPSS capability in proc Wu Fengguang
2009-11-15 11:32 ` [PATCH 11/11] intelhdmi - keep power on to avoid losing hot plug event Wu Fengguang
2009-11-15 15:54 ` [PATCH 00/11] Intel HDMI fixes Takashi Iwai
2009-11-18  4:35   ` Wu Fengguang
2009-11-16 17:12 ` Shane W

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091115114439.966345053@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=david@hardeman.nu \
    --cc=shane-alsa@csy.ca \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox