Commit 8101aec8 authored by Mauro Ribeiro's avatar Mauro Ribeiro

drm/exynos: control dvi mode via a kernel parameter

Change-Id: I11898db158dc0594c8b5e16a5b95b6f8db5853e9
parent cafcd6f2
......@@ -219,6 +219,26 @@ struct hdmiphy_config {
};
#if defined(CONFIG_MACH_ODROIDXU3)
//-----------------------------------------------------------------------------
// DVI Control (defaults to hdmi always).
//
//-----------------------------------------------------------------------------
unsigned int gdvi_mode = false;
static int __init dvi_force_enable(char *l)
{
if(!strcmp(l, "dvi")) {
gdvi_mode = true;
pr_emerg("hdmi: using DVI Mode\n");
} else {
gdvi_mode = false;
pr_emerg("hdmi: using HDMI Mode\n");
}
return 0;
}
__setup("vout=", dvi_force_enable);
//-----------------------------------------------------------------------------
//
// HPD Signal Disable control.
......@@ -226,7 +246,7 @@ struct hdmiphy_config {
// Default gEnableHPD = true,
//
//-----------------------------------------------------------------------------
unsigned int gEnableHPD = true; // Default setup
unsigned long gEnableHPD = true; // Default setup
static int __init hdmi_hpd_enable(char *line)
{
......@@ -1335,6 +1355,7 @@ static int hdmi_get_modes(struct drm_connector *connector)
return -ENODEV;
hdata->dvi_mode = !drm_detect_hdmi_monitor(edid);
DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n",
(hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"),
edid->width_cm, edid->height_cm);
......@@ -1757,7 +1778,9 @@ static void hdmi_v13_mode_apply(struct hdmi_context *hdata)
}
clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */
......@@ -1919,7 +1942,9 @@ static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
}
clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */
......@@ -1940,7 +1965,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
u32 reg;
clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
#ifndef CONFIG_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi);
/* operation mode */
......@@ -1982,6 +2009,7 @@ static void hdmiphy_poweron(struct hdmi_context *hdata)
hdmiphy_conf_reset(hdata);
}
#ifndef CONFIG_MACH_ODROIDXU3
static void hdmiphy_poweroff(struct hdmi_context *hdata)
{
if (hdata->type != HDMI_TYPE14)
......@@ -2003,6 +2031,7 @@ static void hdmiphy_poweroff(struct hdmi_context *hdata)
hdmiphy_reg_writeb(hdata, HDMIPHY_MODE_SET_DONE,
HDMI_PHY_DISABLE_MODE_SET);
}
#endif
static void hdmiphy_conf_apply(struct hdmi_context *hdata)
{
......@@ -2349,12 +2378,16 @@ static void hdmi_poweroff(struct exynos_drm_display *display)
/* HDMI System Disable */
hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN);
// hdmiphy_poweroff(hdata);
#ifndef CONFIG_MACH_ODROIDXU3
hdmiphy_poweroff(hdata);
#endif
cancel_delayed_work(&hdata->hotplug_work);
// clk_disable_unprepare(res->sclk_hdmi);
// clk_disable_unprepare(res->hdmi);
#ifndef CONFIG_MACH_ODROIDXU3
clk_disable_unprepare(res->sclk_hdmi);
clk_disable_unprepare(res->hdmi);
#endif
/* reset pmu hdmiphy control bit to disable hdmiphy */
regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL,
......@@ -2473,7 +2506,9 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
goto fail;
}
// clk_set_parent(res->mout_hdmi, res->sclk_pixel);
#ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(res->mout_hdmi, res->sclk_pixel);
#endif
clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy);
res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) *
......@@ -2633,6 +2668,7 @@ static int hdmi_probe(struct platform_device *pdev)
hdata->hpd_gpio = pdata->hpd_gpio;
hdata->dev = dev;
hdata->dvi_mode = gdvi_mode;
ret = hdmi_resources_init(hdata);
if (ret) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment