[alsa-devel] [PATCH] ALSA: HDA: Add jack detection for HDMI

Takashi Iwai tiwai at suse.de
Tue May 24 07:39:43 CEST 2011


At Mon, 23 May 2011 14:49:15 -0700,
Stephen Warren wrote:
> 
> Takashi Iwai wrote at Thursday, May 19, 2011 4:06 AM:
> > At Thu, 19 May 2011 11:55:21 +0200,
> > David Henningsson wrote:
> > >
> > > On 2011-05-17 17:46, Takashi Iwai wrote:
> > > > At Tue, 17 May 2011 15:46:43 +0200,
> > > > David Henningsson wrote:
> > > >>
> > > >> Just as for headphones and microphone jacks, this patch adds reporting
> > > >> of HDMI jack status through the input layer.
> > > >>
> >...
> > 
> > OK, as the jack report itself doesn't play a big role yet so far for
> > HD-audio, let's get it in, and give pressure to graphics guys :)
> 
> I've been testing a preliminary fix for this internally. I found that
> the /proc ELD files correctly report monitor_present and eld_valid when
> we hot unplug a monitor, but the other fields in the ELD file are not
> cleared out to their default state. As best I can tell, this is an ALSA
> driver issue, since our display driver only fills in the other fields
> when ELDV==1.

Then it's just showing stale data.  The eld fields are updated only
when the data is valid.  The patch below should fix the confusion.


thanks,

Takashi

---
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 74b0560..cd96b1d 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -477,6 +477,8 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
 
 	snd_iprintf(buffer, "monitor_present\t\t%d\n", e->monitor_present);
 	snd_iprintf(buffer, "eld_valid\t\t%d\n", e->eld_valid);
+	if (!e->eld_valid)
+		return;
 	snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name);
 	snd_iprintf(buffer, "connection_type\t\t%s\n",
 				eld_connection_type_names[e->conn_type]);


More information about the Alsa-devel mailing list