提交 9c8641e8 编写于 作者: W Wu Fengguang 提交者: Takashi Iwai

ALSA: hda: HDMI channel mapping cleanups

Refactor the channel mapping code for consistent naming
and make it more informed about channel allocations.
Signed-off-by: NWu Fengguang <wfg@linux.intel.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 698544de
...@@ -290,7 +290,7 @@ static void hdmi_set_channel_count(struct hda_codec *codec, int chs) ...@@ -290,7 +290,7 @@ static void hdmi_set_channel_count(struct hda_codec *codec, int chs)
chs, hdmi_get_channel_count(codec)); chs, hdmi_get_channel_count(codec));
} }
static void hdmi_debug_slot_mapping(struct hda_codec *codec) static void hdmi_debug_channel_mapping(struct hda_codec *codec)
{ {
#ifdef CONFIG_SND_DEBUG_VERBOSE #ifdef CONFIG_SND_DEBUG_VERBOSE
int i; int i;
...@@ -305,13 +305,6 @@ static void hdmi_debug_slot_mapping(struct hda_codec *codec) ...@@ -305,13 +305,6 @@ static void hdmi_debug_slot_mapping(struct hda_codec *codec)
#endif #endif
} }
static void hdmi_setup_channel_mapping(struct hda_codec *codec)
{
snd_hda_sequence_write(codec, def_chan_map);
hdmi_debug_slot_mapping(codec);
}
static void hdmi_parse_eld(struct hda_codec *codec) static void hdmi_parse_eld(struct hda_codec *codec)
{ {
struct intel_hdmi_spec *spec = codec->spec; struct intel_hdmi_spec *spec = codec->spec;
...@@ -461,6 +454,22 @@ static int hdmi_setup_channel_allocation(struct hda_codec *codec, ...@@ -461,6 +454,22 @@ static int hdmi_setup_channel_allocation(struct hda_codec *codec,
return -1; return -1;
} }
static void hdmi_setup_channel_mapping(struct hda_codec *codec,
struct hdmi_audio_infoframe *ai)
{
if (!ai->CA)
return;
/*
* TODO: adjust channel mapping if necessary
* ALSA sequence is front/surr/clfe/side?
*/
snd_hda_sequence_write(codec, def_chan_map);
hdmi_debug_channel_mapping(codec);
}
static void hdmi_setup_audio_infoframe(struct hda_codec *codec, static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
...@@ -472,6 +481,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, ...@@ -472,6 +481,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
}; };
hdmi_setup_channel_allocation(codec, &ai); hdmi_setup_channel_allocation(codec, &ai);
hdmi_setup_channel_mapping(codec, &ai);
hdmi_fill_audio_infoframe(codec, &ai); hdmi_fill_audio_infoframe(codec, &ai);
} }
...@@ -569,9 +579,6 @@ static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, ...@@ -569,9 +579,6 @@ static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
hdmi_set_channel_count(codec, substream->runtime->channels); hdmi_set_channel_count(codec, substream->runtime->channels);
/* wfg: channel mapping not supported by DEVCTG */
hdmi_setup_channel_mapping(codec);
hdmi_setup_audio_infoframe(codec, substream); hdmi_setup_audio_infoframe(codec, substream);
hdmi_enable_output(codec); hdmi_enable_output(codec);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册