MLK-19328-2: hdp: add channel map for hdmi audio
authorShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 29 Aug 2018 02:04:57 +0000 (10:04 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Add channel map for hdmi audio, originally it is in
audio info frame function, but removed by
commit 6b97462b6407 ("MLK-18690-3: hdp api: Remove
info frame API function")

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
drivers/gpu/drm/imx/hdp/imx-hdp-audio.c

index dace3cc..0a509a1 100644 (file)
@@ -72,6 +72,13 @@ static void imx_hdmi_audio_avi_set(state_struct *state,
        frame.channels = channels;
        frame.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM;
 
+       if (channels == 2)
+               frame.channel_allocation = 0;
+       else if (channels == 4)
+               frame.channel_allocation = 0x3;
+       else if (channels == 8)
+               frame.channel_allocation = 0x13;
+
        ret = hdmi_audio_infoframe_pack(&frame, buf + 1, sizeof(buf) - 1);
        if (ret < 0) {
                DRM_ERROR("failed to pack audio infoframe: %d\n", ret);