aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_intelhdmi.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c
index 6b5c3e2cf93b..747aa84d0ecd 100644
--- a/sound/pci/hda/patch_intelhdmi.c
+++ b/sound/pci/hda/patch_intelhdmi.c
@@ -290,7 +290,7 @@ static void hdmi_set_channel_count(struct hda_codec *codec, int chs)
290 chs, hdmi_get_channel_count(codec)); 290 chs, hdmi_get_channel_count(codec));
291} 291}
292 292
293static void hdmi_debug_slot_mapping(struct hda_codec *codec) 293static void hdmi_debug_channel_mapping(struct hda_codec *codec)
294{ 294{
295#ifdef CONFIG_SND_DEBUG_VERBOSE 295#ifdef CONFIG_SND_DEBUG_VERBOSE
296 int i; 296 int i;
@@ -305,13 +305,6 @@ static void hdmi_debug_slot_mapping(struct hda_codec *codec)
305#endif 305#endif
306} 306}
307 307
308static void hdmi_setup_channel_mapping(struct hda_codec *codec)
309{
310 snd_hda_sequence_write(codec, def_chan_map);
311 hdmi_debug_slot_mapping(codec);
312}
313
314
315static void hdmi_parse_eld(struct hda_codec *codec) 308static void hdmi_parse_eld(struct hda_codec *codec)
316{ 309{
317 struct intel_hdmi_spec *spec = codec->spec; 310 struct intel_hdmi_spec *spec = codec->spec;
@@ -461,6 +454,22 @@ static int hdmi_setup_channel_allocation(struct hda_codec *codec,
461 return -1; 454 return -1;
462} 455}
463 456
457static void hdmi_setup_channel_mapping(struct hda_codec *codec,
458 struct hdmi_audio_infoframe *ai)
459{
460 if (!ai->CA)
461 return;
462
463 /*
464 * TODO: adjust channel mapping if necessary
465 * ALSA sequence is front/surr/clfe/side?
466 */
467
468 snd_hda_sequence_write(codec, def_chan_map);
469 hdmi_debug_channel_mapping(codec);
470}
471
472
464static void hdmi_setup_audio_infoframe(struct hda_codec *codec, 473static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
465 struct snd_pcm_substream *substream) 474 struct snd_pcm_substream *substream)
466{ 475{
@@ -472,6 +481,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
472 }; 481 };
473 482
474 hdmi_setup_channel_allocation(codec, &ai); 483 hdmi_setup_channel_allocation(codec, &ai);
484 hdmi_setup_channel_mapping(codec, &ai);
475 485
476 hdmi_fill_audio_infoframe(codec, &ai); 486 hdmi_fill_audio_infoframe(codec, &ai);
477} 487}
@@ -569,9 +579,6 @@ static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
569 579
570 hdmi_set_channel_count(codec, substream->runtime->channels); 580 hdmi_set_channel_count(codec, substream->runtime->channels);
571 581
572 /* wfg: channel mapping not supported by DEVCTG */
573 hdmi_setup_channel_mapping(codec);
574
575 hdmi_setup_audio_infoframe(codec, substream); 582 hdmi_setup_audio_infoframe(codec, substream);
576 583
577 hdmi_enable_output(codec); 584 hdmi_enable_output(codec);