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)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
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 5b77c1a..e629ada 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;
@@ -878,6 +878,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,
 };
@@ -885,6 +886,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,
 };
@@ -905,6 +907,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,
 };
@@ -1044,6 +1047,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 */