97 lines
2.7 KiB
Diff
97 lines
2.7 KiB
Diff
From ccd58e3758edc64f8b817364da285a20837f30f9 Mon Sep 17 00:00:00 2001
|
|
From: Brian Kim <brian.kim@hardkernel.com>
|
|
Date: Thu, 5 Jan 2017 19:05:44 +0900
|
|
Subject: [PATCH 021/109] ODROID-XU4: drm/exynos/hdmi: add 'HPD' and 'vout' as
|
|
boot parameters
|
|
|
|
Change-Id: Ia3c94b0ee99e761a774ac63398ca86477b703b8c
|
|
Signed-off-by: Brian Kim <brian.kim@hardkernel.com>
|
|
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
|
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
|
|
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
|
---
|
|
drivers/gpu/drm/exynos/exynos_hdmi.c | 39 +++++++++++++++++++++++++++-
|
|
1 file changed, 38 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
|
|
index 39fa5d3b01ef..ae4bae32b11d 100644
|
|
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
|
|
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
|
|
@@ -145,6 +145,33 @@ struct hdmi_context {
|
|
bool powered;
|
|
};
|
|
|
|
+static bool gdvi_mode = false;
|
|
+static bool gEnableHPD = true;
|
|
+
|
|
+static int __init dvi_force_enable(char *str)
|
|
+{
|
|
+ if (!strcmp(str, "dvi")) {
|
|
+ gdvi_mode = true;
|
|
+ pr_info("hdmi: using DVI mode\n");
|
|
+ } else {
|
|
+ gdvi_mode = false;
|
|
+ pr_info("hdmi: using HDMI mode\n");
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+__setup("vout=", dvi_force_enable);
|
|
+
|
|
+static int __init hdmi_hpd_enable(char *str)
|
|
+{
|
|
+ if (!strcmp(str, "false")) {
|
|
+ gEnableHPD = false;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+__setup("HPD=", hdmi_hpd_enable);
|
|
+
|
|
static inline struct hdmi_context *encoder_to_hdmi(struct drm_encoder *e)
|
|
{
|
|
return container_of(e, struct hdmi_context, encoder);
|
|
@@ -854,6 +881,9 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
|
|
{
|
|
struct hdmi_context *hdata = connector_to_hdmi(connector);
|
|
|
|
+ if (!gEnableHPD)
|
|
+ return connector_status_connected;
|
|
+
|
|
if (gpiod_get_value(hdata->hpd_gpio))
|
|
return connector_status_connected;
|
|
|
|
@@ -893,7 +923,10 @@ static int hdmi_get_modes(struct drm_connector *connector)
|
|
if (!edid)
|
|
return -ENODEV;
|
|
|
|
- hdata->dvi_mode = !drm_detect_hdmi_monitor(edid);
|
|
+ if (gdvi_mode)
|
|
+ hdata->dvi_mode = true;
|
|
+ else
|
|
+ hdata->dvi_mode = !drm_detect_hdmi_monitor(edid);
|
|
DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n",
|
|
(hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"),
|
|
edid->width_cm, edid->height_cm);
|
|
@@ -1590,6 +1623,9 @@ static int hdmi_audio_hw_params(struct device *dev, void *data,
|
|
{
|
|
struct hdmi_context *hdata = dev_get_drvdata(dev);
|
|
|
|
+ if (hdata->dvi_mode)
|
|
+ return 0;
|
|
+
|
|
if (daifmt->fmt != HDMI_I2S || daifmt->bit_clk_inv ||
|
|
daifmt->frame_clk_inv || daifmt->bit_clk_master ||
|
|
daifmt->frame_clk_master) {
|
|
@@ -1966,6 +2002,7 @@ static int hdmi_probe(struct platform_device *pdev)
|
|
platform_set_drvdata(pdev, hdata);
|
|
|
|
hdata->dev = dev;
|
|
+ hdata->dvi_mode = gdvi_mode;
|
|
|
|
mutex_init(&hdata->mutex);
|
|
|
|
--
|
|
2.25.1
|
|
|