diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-10-27 19:16:55 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-11-16 05:14:03 -0500 |
commit | 3a93897ea37cbb8277f8a4232c12c0c18168a7db (patch) | |
tree | 1c79df3bb270e86c61bdb13fab0bf66cbd3682ac /sound/pci/hda/patch_hdmi.c | |
parent | 01a61e12b4602c82bde9797d0e153f3e53c95b04 (diff) |
ALSA: hda - Manage unsol tags in hda_jack.c
Manage the tags assigned for unsolicited events dynamically together
with the jack-detection routines. Basically this is almost same as what
we've done in patch_sigmatel.c. Assign the new tag number for each new
unsol event, associate with the given NID and the action type, etc.
With this change, now all pins looked over in snd_hda_jack_add_kctls()
are actually enabled for detection now even if the pins aren't used for
jack-retasking by the driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index f01c5efde8e1..ea30bf4a4f50 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -754,10 +754,18 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry); | |||
754 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | 754 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) |
755 | { | 755 | { |
756 | struct hdmi_spec *spec = codec->spec; | 756 | struct hdmi_spec *spec = codec->spec; |
757 | int pin_nid = res >> AC_UNSOL_RES_TAG_SHIFT; | 757 | int tag = res >> AC_UNSOL_RES_TAG_SHIFT; |
758 | int pin_nid; | ||
758 | int pd = !!(res & AC_UNSOL_RES_PD); | 759 | int pd = !!(res & AC_UNSOL_RES_PD); |
759 | int eldv = !!(res & AC_UNSOL_RES_ELDV); | 760 | int eldv = !!(res & AC_UNSOL_RES_ELDV); |
760 | int pin_idx; | 761 | int pin_idx; |
762 | struct hda_jack_tbl *jack; | ||
763 | |||
764 | jack = snd_hda_jack_tbl_get_from_tag(codec, tag); | ||
765 | if (!jack) | ||
766 | return; | ||
767 | pin_nid = jack->nid; | ||
768 | jack->jack_dirty = 1; | ||
761 | 769 | ||
762 | printk(KERN_INFO | 770 | printk(KERN_INFO |
763 | "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", | 771 | "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", |
@@ -767,7 +775,6 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
767 | if (pin_idx < 0) | 775 | if (pin_idx < 0) |
768 | return; | 776 | return; |
769 | 777 | ||
770 | snd_hda_jack_set_dirty(codec, pin_nid); | ||
771 | hdmi_present_sense(&spec->pins[pin_idx], true); | 778 | hdmi_present_sense(&spec->pins[pin_idx], true); |
772 | snd_hda_jack_report_sync(codec); | 779 | snd_hda_jack_report_sync(codec); |
773 | } | 780 | } |
@@ -801,7 +808,7 @@ static void hdmi_unsol_event(struct hda_codec *codec, unsigned int res) | |||
801 | int tag = res >> AC_UNSOL_RES_TAG_SHIFT; | 808 | int tag = res >> AC_UNSOL_RES_TAG_SHIFT; |
802 | int subtag = (res & AC_UNSOL_RES_SUBTAG) >> AC_UNSOL_RES_SUBTAG_SHIFT; | 809 | int subtag = (res & AC_UNSOL_RES_SUBTAG) >> AC_UNSOL_RES_SUBTAG_SHIFT; |
803 | 810 | ||
804 | if (pin_nid_to_pin_index(spec, tag) < 0) { | 811 | if (!snd_hda_jack_tbl_get_from_tag(codec, tag)) { |
805 | snd_printd(KERN_INFO "Unexpected HDMI event tag 0x%x\n", tag); | 812 | snd_printd(KERN_INFO "Unexpected HDMI event tag 0x%x\n", tag); |
806 | return; | 813 | return; |
807 | } | 814 | } |