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.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 9446a5abea13..4228f2fe5956 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -309,17 +309,12 @@ out_fail:
309 return -EINVAL; 309 return -EINVAL;
310} 310}
311 311
312static int hdmi_present_sense(struct hda_codec *codec, hda_nid_t nid)
313{
314 return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0);
315}
316
317static int hdmi_eld_valid(struct hda_codec *codec, hda_nid_t nid) 312static int hdmi_eld_valid(struct hda_codec *codec, hda_nid_t nid)
318{ 313{
319 int eldv; 314 int eldv;
320 int present; 315 int present;
321 316
322 present = hdmi_present_sense(codec, nid); 317 present = snd_hda_pin_sense(codec, nid);
323 eldv = (present & AC_PINSENSE_ELDV); 318 eldv = (present & AC_PINSENSE_ELDV);
324 present = (present & AC_PINSENSE_PRESENCE); 319 present = (present & AC_PINSENSE_PRESENCE);
325 320
@@ -477,6 +472,8 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
477 [4 ... 7] = "reserved" 472 [4 ... 7] = "reserved"
478 }; 473 };
479 474
475 snd_iprintf(buffer, "monitor_present\t\t%d\n", e->monitor_present);
476 snd_iprintf(buffer, "eld_valid\t\t%d\n", e->eld_valid);
480 snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name); 477 snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name);
481 snd_iprintf(buffer, "connection_type\t\t%s\n", 478 snd_iprintf(buffer, "connection_type\t\t%s\n",
482 eld_connection_type_names[e->conn_type]); 479 eld_connection_type_names[e->conn_type]);
@@ -518,7 +515,11 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry,
518 * monitor_name manufacture_id product_id 515 * monitor_name manufacture_id product_id
519 * eld_version edid_version 516 * eld_version edid_version
520 */ 517 */
521 if (!strcmp(name, "connection_type")) 518 if (!strcmp(name, "monitor_present"))
519 e->monitor_present = val;
520 else if (!strcmp(name, "eld_valid"))
521 e->eld_valid = val;
522 else if (!strcmp(name, "connection_type"))
522 e->conn_type = val; 523 e->conn_type = val;
523 else if (!strcmp(name, "port_id")) 524 else if (!strcmp(name, "port_id"))
524 e->port_id = val; 525 e->port_id = val;
@@ -560,13 +561,14 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry,
560} 561}
561 562
562 563
563int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld) 564int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld,
565 int index)
564{ 566{
565 char name[32]; 567 char name[32];
566 struct snd_info_entry *entry; 568 struct snd_info_entry *entry;
567 int err; 569 int err;
568 570
569 snprintf(name, sizeof(name), "eld#%d", codec->addr); 571 snprintf(name, sizeof(name), "eld#%d.%d", codec->addr, index);
570 err = snd_card_proc_new(codec->bus->card, name, &entry); 572 err = snd_card_proc_new(codec->bus->card, name, &entry);
571 if (err < 0) 573 if (err < 0)
572 return err; 574 return err;