aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_eld.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_eld.c')
-rw-r--r--sound/pci/hda/hda_eld.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 74b0560289c0..b05f7be9dc1b 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -312,23 +312,6 @@ out_fail:
312 return -EINVAL; 312 return -EINVAL;
313} 313}
314 314
315static int hdmi_eld_valid(struct hda_codec *codec, hda_nid_t nid)
316{
317 int eldv;
318 int present;
319
320 present = snd_hda_pin_sense(codec, nid);
321 eldv = (present & AC_PINSENSE_ELDV);
322 present = (present & AC_PINSENSE_PRESENCE);
323
324#ifdef CONFIG_SND_DEBUG_VERBOSE
325 printk(KERN_INFO "HDMI: sink_present = %d, eld_valid = %d\n",
326 !!present, !!eldv);
327#endif
328
329 return eldv && present;
330}
331
332int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid) 315int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid)
333{ 316{
334 return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_HDMI_DIP_SIZE, 317 return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_HDMI_DIP_SIZE,
@@ -343,7 +326,7 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
343 int size; 326 int size;
344 unsigned char *buf; 327 unsigned char *buf;
345 328
346 if (!hdmi_eld_valid(codec, nid)) 329 if (!eld->eld_valid)
347 return -ENOENT; 330 return -ENOENT;
348 331
349 size = snd_hdmi_get_eld_size(codec, nid); 332 size = snd_hdmi_get_eld_size(codec, nid);
@@ -477,6 +460,8 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
477 460
478 snd_iprintf(buffer, "monitor_present\t\t%d\n", e->monitor_present); 461 snd_iprintf(buffer, "monitor_present\t\t%d\n", e->monitor_present);
479 snd_iprintf(buffer, "eld_valid\t\t%d\n", e->eld_valid); 462 snd_iprintf(buffer, "eld_valid\t\t%d\n", e->eld_valid);
463 if (!e->eld_valid)
464 return;
480 snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name); 465 snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name);
481 snd_iprintf(buffer, "connection_type\t\t%s\n", 466 snd_iprintf(buffer, "connection_type\t\t%s\n",
482 eld_connection_type_names[e->conn_type]); 467 eld_connection_type_names[e->conn_type]);