MLK-16888: hdp audio: support multi-type audio
authorSandor Yu <Sandor.yu@nxp.com>
Fri, 17 Nov 2017 08:30:53 +0000 (16:30 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:47:01 +0000 (15:47 -0500)
Add audio_type variable to support different audio type.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
drivers/gpu/drm/imx/hdp/imx-hdp.c
drivers/gpu/drm/imx/hdp/imx-hdp.h

index 61df727..e546233 100644 (file)
@@ -145,7 +145,7 @@ u32 imx_hdp_audio(AUDIO_TYPE type, u32 sample_rate, u32 channels, u32 width)
                                freq,
                                0,
                                bits,
-                               CDN_DPTX,
+                               g_hdp->audio_type,
                                ncts_n,
                                AUDIO_MUTE_MODE_UNMUTE);
        return 0;
@@ -881,6 +881,7 @@ static struct hdp_ops imx8qm_hdmi_ops = {
 static struct hdp_devtype imx8qm_dp_devtype = {
        .is_edid = false,
        .is_4kp60 = false,
+       .audio_type = CDN_DPTX,
        .ops = &imx8qm_dp_ops,
        .rw = &imx8qm_rw,
 };
@@ -888,6 +889,7 @@ static struct hdp_devtype imx8qm_dp_devtype = {
 static struct hdp_devtype imx8qm_hdmi_devtype = {
        .is_edid = false,
        .is_4kp60 = false,
+       .audio_type = CDN_HDMITX_TYPHOON,
        .ops = &imx8qm_hdmi_ops,
        .rw = &imx8qm_rw,
 };
@@ -908,6 +910,7 @@ static struct hdp_ops imx8mq_ops = {
 static struct hdp_devtype imx8mq_hdmi_devtype = {
        .is_edid = false,
        .is_4kp60 = true,
+       .audio_type = CDN_HDMITX_KIRAN,
        .ops = &imx8mq_ops,
        .rw = &imx8mq_rw,
 };
@@ -1047,6 +1050,7 @@ static int imx_hdp_imx_bind(struct device *dev, struct device *master,
 
        hdp->is_edid = devtype->is_edid;
        hdp->is_4kp60 = devtype->is_4kp60;
+       hdp->audio_type = devtype->audio_type;
        hdp->ops = devtype->ops;
        hdp->rw = devtype->rw;
 
index c30581c..f59976f 100644 (file)
@@ -102,6 +102,7 @@ struct hdp_ops {
 struct hdp_devtype {
        u8 is_edid;
        u8 is_4kp60;
+       u8 audio_type;
        struct hdp_ops *ops;
        struct hdp_rw_func *rw;
 };
@@ -185,6 +186,7 @@ struct imx_hdp {
 
        u8 is_edid;
        u8 is_4kp60;
+       u8 audio_type;
 
        struct mutex mutex;             /* for state below and previous_mode */
        enum drm_connector_force force; /* mutex-protected force state */