From eba7d1d2bb8452a77442e4b2007944a70326e679 Mon Sep 17 00:00:00 2001 From: Sandor Yu Date: Wed, 15 Aug 2018 17:19:17 +0800 Subject: [PATCH] MLK-19227-2: hdmi: Replace is_edid with no_edid EDID function are default supported for all platform. Remove is_edid variable. Add no_edid for specific case. such as EDID function is not supported on iMX8QM ARM2 board with DP-HDMI converter. Signed-off-by: Sandor Yu (cherry picked from commit 69d015ba610040cc0397b0c1335ef0e941f99d98) --- drivers/gpu/drm/imx/hdp/imx-hdp.c | 11 ++++------- drivers/gpu/drm/imx/hdp/imx-hdp.h | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/imx/hdp/imx-hdp.c b/drivers/gpu/drm/imx/hdp/imx-hdp.c index ed61ee46d8b4..c009ab375672 100644 --- a/drivers/gpu/drm/imx/hdp/imx-hdp.c +++ b/drivers/gpu/drm/imx/hdp/imx-hdp.c @@ -735,7 +735,7 @@ static int imx_hdp_connector_get_modes(struct drm_connector *connector) struct edid *edid; int num_modes = 0; - if (hdp->is_edid == true) { + if (!hdp->no_edid) { edid = drm_do_get_edid(connector, hdp->ops->get_edid_block, &hdp->state); if (edid) { dev_dbg(hdp->dev, "%x,%x,%x,%x,%x,%x,%x,%x\n", @@ -773,7 +773,7 @@ imx_hdp_connector_mode_valid(struct drm_connector *connector, cmdline_mode = &connector->cmdline_mode; /* cmdline mode is the max support video mode when edid disabled */ - if (!hdp->is_edid) { + if (hdp->no_edid) { if (cmdline_mode->xres != 0 && cmdline_mode->xres < mode->hdisplay) return MODE_BAD_HVALUE; @@ -1082,7 +1082,6 @@ 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, @@ -1090,7 +1089,6 @@ 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, @@ -1115,7 +1113,6 @@ static struct hdp_ops imx8mq_ops = { }; static struct hdp_devtype imx8mq_hdmi_devtype = { - .is_edid = true, .is_4kp60 = true, .audio_type = CDN_HDMITX_KIRAN, .ops = &imx8mq_ops, @@ -1131,7 +1128,6 @@ static struct hdp_ops imx8mq_dp_ops = { }; static struct hdp_devtype imx8mq_dp_devtype = { - .is_edid = true, .is_4kp60 = true, .audio_type = CDN_DPTX, .ops = &imx8mq_dp_ops, @@ -1247,6 +1243,8 @@ static int imx_hdp_imx_bind(struct device *dev, struct device *master, hdp->is_edp = of_property_read_bool(pdev->dev.of_node, "fsl,edp"); + hdp->no_edid = of_property_read_bool(pdev->dev.of_node, "fsl,no_edid"); + ret = of_property_read_u32(pdev->dev.of_node, "lane_mapping", &hdp->lane_mapping); @@ -1274,7 +1272,6 @@ static int imx_hdp_imx_bind(struct device *dev, struct device *master, } dev_info(dev, "dp_num_lanes 0x%02x\n", hdp->edp_num_lanes); - hdp->is_edid = devtype->is_edid; hdp->is_4kp60 = devtype->is_4kp60; hdp->audio_type = devtype->audio_type; hdp->ops = devtype->ops; diff --git a/drivers/gpu/drm/imx/hdp/imx-hdp.h b/drivers/gpu/drm/imx/hdp/imx-hdp.h index 822b9f52c55a..0f0b9461b091 100644 --- a/drivers/gpu/drm/imx/hdp/imx-hdp.h +++ b/drivers/gpu/drm/imx/hdp/imx-hdp.h @@ -114,7 +114,6 @@ struct hdp_ops { }; struct hdp_devtype { - u8 is_edid; u8 is_4kp60; u8 audio_type; struct hdp_ops *ops; @@ -203,11 +202,11 @@ struct imx_hdp { struct hdp_mem mem; - u8 is_edid; u8 is_4kp60; u8 is_cec; u8 is_edp; u8 is_digpll_dp_pclock; + u8 no_edid; u8 audio_type; u32 lane_mapping; u32 edp_link_rate; -- 2.17.1