aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-07-28 08:21:55 -0400
committerTakashi Iwai <tiwai@suse.de>2010-07-28 08:26:14 -0400
commit38faddb1afdd37218c196ac3db1cb5fbe7fc9c75 (patch)
tree4591e3444acb5cd408dbc55d77209e136e47fb67 /sound
parentac0547dc62e67a3e0b0c1628b6e49efba8f517db (diff)
ALSA: hda - Fix pin-detection of Nvidia HDMI
The behavior of Nvidia HDMI codec regarding the pin-detection unsol events is based on the old HD-audio spec, i.e. PD bit indicates only the update and doesn't show the current state. Since the current code assumes the new behavior, the pin-detection doesn't work relialby with these h/w. This patch adds a flag for indicating the old spec, and fixes the issue by checking the pin-detection explicitly for such hardware. Tested-by: Wei Ni <wni@nvidia.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_hdmi.c13
-rw-r--r--sound/pci/hda/patch_nvhdmi.c3
2 files changed, 16 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 86067ee78632..2fc53961054e 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -52,6 +52,10 @@ struct hdmi_spec {
52 */ 52 */
53 struct hda_multi_out multiout; 53 struct hda_multi_out multiout;
54 unsigned int codec_type; 54 unsigned int codec_type;
55
56 /* misc flags */
57 /* PD bit indicates only the update, not the current state */
58 unsigned int old_pin_detect:1;
55}; 59};
56 60
57 61
@@ -616,6 +620,9 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
616 * Unsolicited events 620 * Unsolicited events
617 */ 621 */
618 622
623static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,
624 struct hdmi_eld *eld);
625
619static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) 626static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
620{ 627{
621 struct hdmi_spec *spec = codec->spec; 628 struct hdmi_spec *spec = codec->spec;
@@ -632,6 +639,12 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
632 if (index < 0) 639 if (index < 0)
633 return; 640 return;
634 641
642 if (spec->old_pin_detect) {
643 if (pind)
644 hdmi_present_sense(codec, tag, &spec->sink_eld[index]);
645 pind = spec->sink_eld[index].monitor_present;
646 }
647
635 spec->sink_eld[index].monitor_present = pind; 648 spec->sink_eld[index].monitor_present = pind;
636 spec->sink_eld[index].eld_valid = eldv; 649 spec->sink_eld[index].eld_valid = eldv;
637 650
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c
index 3c10c0b149f4..b0652acee9b2 100644
--- a/sound/pci/hda/patch_nvhdmi.c
+++ b/sound/pci/hda/patch_nvhdmi.c
@@ -478,6 +478,7 @@ static int patch_nvhdmi_8ch_89(struct hda_codec *codec)
478 478
479 codec->spec = spec; 479 codec->spec = spec;
480 spec->codec_type = HDA_CODEC_NVIDIA_MCP89; 480 spec->codec_type = HDA_CODEC_NVIDIA_MCP89;
481 spec->old_pin_detect = 1;
481 482
482 if (hdmi_parse_codec(codec) < 0) { 483 if (hdmi_parse_codec(codec) < 0) {
483 codec->spec = NULL; 484 codec->spec = NULL;
@@ -508,6 +509,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
508 spec->multiout.max_channels = 8; 509 spec->multiout.max_channels = 8;
509 spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; 510 spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
510 spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; 511 spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
512 spec->old_pin_detect = 1;
511 513
512 codec->patch_ops = nvhdmi_patch_ops_8ch_7x; 514 codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
513 515
@@ -528,6 +530,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
528 spec->multiout.max_channels = 2; 530 spec->multiout.max_channels = 2;
529 spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; 531 spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
530 spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; 532 spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
533 spec->old_pin_detect = 1;
531 534
532 codec->patch_ops = nvhdmi_patch_ops_2ch; 535 codec->patch_ops = nvhdmi_patch_ops_2ch;
533 536