aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r--sound/pci/hda/patch_hdmi.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 6bcdd667f514..1e381918eb82 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -531,7 +531,7 @@ static int hdmi_channel_allocation(struct hdmi_eld *eld, int channels)
531 * expand ELD's notions to match the ones used by Audio InfoFrame. 531 * expand ELD's notions to match the ones used by Audio InfoFrame.
532 */ 532 */
533 for (i = 0; i < ARRAY_SIZE(eld_speaker_allocation_bits); i++) { 533 for (i = 0; i < ARRAY_SIZE(eld_speaker_allocation_bits); i++) {
534 if (eld->spk_alloc & (1 << i)) 534 if (eld->info.spk_alloc & (1 << i))
535 spk_mask |= eld_speaker_allocation_bits[i]; 535 spk_mask |= eld_speaker_allocation_bits[i];
536 } 536 }
537 537
@@ -545,7 +545,7 @@ static int hdmi_channel_allocation(struct hdmi_eld *eld, int channels)
545 } 545 }
546 } 546 }
547 547
548 snd_print_channel_allocation(eld->spk_alloc, buf, sizeof(buf)); 548 snd_print_channel_allocation(eld->info.spk_alloc, buf, sizeof(buf));
549 snd_printdd("HDMI: select CA 0x%x for %d-channel allocation: %s\n", 549 snd_printdd("HDMI: select CA 0x%x for %d-channel allocation: %s\n",
550 ca, channels, buf); 550 ca, channels, buf);
551 551
@@ -886,7 +886,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx,
886 ca = 0; 886 ca = 0;
887 887
888 memset(&ai, 0, sizeof(ai)); 888 memset(&ai, 0, sizeof(ai));
889 if (eld->conn_type == 0) { /* HDMI */ 889 if (eld->info.conn_type == 0) { /* HDMI */
890 struct hdmi_audio_infoframe *hdmi_ai = &ai.hdmi; 890 struct hdmi_audio_infoframe *hdmi_ai = &ai.hdmi;
891 891
892 hdmi_ai->type = 0x84; 892 hdmi_ai->type = 0x84;
@@ -895,7 +895,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx,
895 hdmi_ai->CC02_CT47 = channels - 1; 895 hdmi_ai->CC02_CT47 = channels - 1;
896 hdmi_ai->CA = ca; 896 hdmi_ai->CA = ca;
897 hdmi_checksum_audio_infoframe(hdmi_ai); 897 hdmi_checksum_audio_infoframe(hdmi_ai);
898 } else if (eld->conn_type == 1) { /* DisplayPort */ 898 } else if (eld->info.conn_type == 1) { /* DisplayPort */
899 struct dp_audio_infoframe *dp_ai = &ai.dp; 899 struct dp_audio_infoframe *dp_ai = &ai.dp;
900 900
901 dp_ai->type = 0x84; 901 dp_ai->type = 0x84;
@@ -1116,7 +1116,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
1116 1116
1117 /* Restrict capabilities by ELD if this isn't disabled */ 1117 /* Restrict capabilities by ELD if this isn't disabled */
1118 if (!static_hdmi_pcm && eld->eld_valid) { 1118 if (!static_hdmi_pcm && eld->eld_valid) {
1119 snd_hdmi_eld_update_pcm_info(eld, hinfo); 1119 snd_hdmi_eld_update_pcm_info(&eld->info, hinfo);
1120 if (hinfo->channels_min > hinfo->channels_max || 1120 if (hinfo->channels_min > hinfo->channels_max ||
1121 !hinfo->rates || !hinfo->formats) { 1121 !hinfo->rates || !hinfo->formats) {
1122 per_cvt->assigned = 0; 1122 per_cvt->assigned = 0;
@@ -1177,8 +1177,6 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
1177 int present = snd_hda_pin_sense(codec, pin_nid); 1177 int present = snd_hda_pin_sense(codec, pin_nid);
1178 bool eld_valid = false; 1178 bool eld_valid = false;
1179 1179
1180 memset(eld, 0, offsetof(struct hdmi_eld, eld_buffer));
1181
1182 eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE); 1180 eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE);
1183 if (eld->monitor_present) 1181 if (eld->monitor_present)
1184 eld_valid = !!(present & AC_PINSENSE_ELDV); 1182 eld_valid = !!(present & AC_PINSENSE_ELDV);
@@ -1189,8 +1187,20 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
1189 1187
1190 eld->eld_valid = false; 1188 eld->eld_valid = false;
1191 if (eld_valid) { 1189 if (eld_valid) {
1192 if (!snd_hdmi_get_eld(eld, codec, pin_nid)) 1190 if (snd_hdmi_get_eld(codec, pin_nid, eld->eld_buffer,
1193 snd_hdmi_show_eld(eld); 1191 &eld->eld_size) < 0)
1192 eld_valid = false;
1193 else {
1194 memset(&eld->info, 0, sizeof(struct parsed_hdmi_eld));
1195 if (snd_hdmi_parse_eld(&eld->info, eld->eld_buffer,
1196 eld->eld_size) < 0)
1197 eld_valid = false;
1198 }
1199
1200 if (eld_valid) {
1201 snd_hdmi_show_eld(&eld->info);
1202 eld->eld_valid = true;
1203 }
1194 else if (repoll) { 1204 else if (repoll) {
1195 queue_delayed_work(codec->bus->workq, 1205 queue_delayed_work(codec->bus->workq,
1196 &per_pin->work, 1206 &per_pin->work,