From 97fb98289ca4c7479af5a76d517d8a2c0419be73 Mon Sep 17 00:00:00 2001 From: Wu Fengguang Date: Wed, 18 Nov 2009 12:38:03 +0800 Subject: [PATCH] --- yaml --- r: 170345 b: refs/heads/master c: 3f54aa5091f48e9d8ce6e99b248449d08acccb26 h: refs/heads/master i: 170343: 90094cf1fc5a04b007912a384df135d77d18517e v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/patch_intelhdmi.c | 32 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 1af3cefa3bab..e2cc5925742b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 864f92be7e8d4a0ba11d912e3f03d1a92a031dee +refs/heads/master: 3f54aa5091f48e9d8ce6e99b248449d08acccb26 diff --git a/trunk/sound/pci/hda/patch_intelhdmi.c b/trunk/sound/pci/hda/patch_intelhdmi.c index 095c993f4b76..c5fd011567fb 100644 --- a/trunk/sound/pci/hda/patch_intelhdmi.c +++ b/trunk/sound/pci/hda/patch_intelhdmi.c @@ -259,6 +259,25 @@ static int intel_hdmi_read_pin_conn(struct hda_codec *codec, hda_nid_t pin_nid) 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_codec *codec, hda_nid_t pin_nid) 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(struct hda_codec *codec, hda_nid_t nid) #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 +689,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) 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 */ } }