summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2012-11-08 16:24:10 +0800
committerRichard Liu <r66033@freescale.com>2012-11-08 18:05:19 +0800
commit45ac114a6769b08d52b8bcde50743c77d1480811 (patch)
tree341690ca18458350a4dc1b8c215561337d6f5106
parent10c2cbc55e7d13de6ae438241e4b7c2142a0181f (diff)
ENGR00232930 Added default video mode check, make sure it is a CEA mode.
When system bootup without HDMI plugin, the default modelist and default video mode will create. Match default video mode in default CEA modelist, make sure default video mode is a CEA mode. Signed-off-by: Sandor Yu <R01008@freescale.com>
-rw-r--r--drivers/video/mxc_hdmi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c
index 74a42aabe976..c451d57ef312 100644
--- a/drivers/video/mxc_hdmi.c
+++ b/drivers/video/mxc_hdmi.c
@@ -2092,6 +2092,7 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp,
int ret = 0;
u32 i;
const struct fb_videomode *mode;
+ struct fb_videomode m;
struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp);
struct fsl_mxc_hdmi_platform_data *plat = hdmi->pdev->dev.platform_data;
int irq = platform_get_irq(hdmi->pdev, 0);
@@ -2205,6 +2206,21 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp,
console_unlock();
+ /* Find a nearest mode in default modelist */
+ fb_var_to_videomode(&m, &hdmi->fbi->var);
+ dump_fb_videomode(&m);
+
+ mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist);
+ if (!mode) {
+ pr_err("%s: could not find mode in modelist\n", __func__);
+ return;
+ }
+
+ fb_videomode_to_var(&hdmi->fbi->var, mode);
+
+ /* Default setting HDMI working in HDMI mode*/
+ hdmi->edid_cfg.hdmi_cap = true;
+
INIT_DELAYED_WORK(&hdmi->hotplug_work, hotplug_worker);
/* Configure registers related to HDMI interrupt