diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c index aaccc02..498413f 100644 --- a/sound/pci/hda/hda_jack.c +++ b/sound/pci/hda/hda_jack.c @@ -40,6 +40,7 @@ EXPORT_SYMBOL_HDA(is_jack_detectable); static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid) { u32 pincap; + u32 result; if (!codec->no_trigger_sense) { pincap = snd_hda_query_pin_caps(codec, nid); @@ -47,8 +48,11 @@ static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid) snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); } - return snd_hda_codec_read(codec, nid, 0, + + result = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); + printk("Diwic: read_pin_sense for pin 0x%x, result = 0x%x\n", nid, result); + return result; } /** diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 8f23374..7dec194 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -807,6 +807,8 @@ static void hdmi_unsol_event(struct hda_codec *codec, unsigned int res) int tag = res >> AC_UNSOL_RES_TAG_SHIFT; int subtag = (res & AC_UNSOL_RES_SUBTAG) >> AC_UNSOL_RES_SUBTAG_SHIFT; + printk("Diwic: hdmi_unsol_event, res = 0x%x\n", res); + if (!snd_hda_jack_tbl_get_from_tag(codec, tag)) { snd_printd(KERN_INFO "Unexpected HDMI event tag 0x%x\n", tag); return; @@ -1315,6 +1317,17 @@ static int generic_hdmi_init(struct hda_codec *codec) return 0; } +static int generic_hdmi_resume(struct hda_codec *codec) +{ + printk("Diwic: resuming HDMI codec start\n"); + snd_hda_codec_resume_cache(codec); + printk("Diwic: cache written (unsol enable, hopefully)\n"); + snd_hda_jack_set_dirty_all(codec); + snd_hda_jack_report_sync(codec); + printk("Diwic: resuming HDMI codec done\n"); + return 0; +} + static void generic_hdmi_free(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; @@ -1338,6 +1351,9 @@ static const struct hda_codec_ops generic_hdmi_patch_ops = { .build_pcms = generic_hdmi_build_pcms, .build_controls = generic_hdmi_build_controls, .unsol_event = hdmi_unsol_event, +#ifdef CONFIG_PM + .resume = generic_hdmi_resume, +#endif }; static int patch_generic_hdmi(struct hda_codec *codec)