From 8b74a5861bb22000ba66605cd4cb25025e3efb64 Mon Sep 17 00:00:00 2001 From: Sandor Yu Date: Thu, 8 Nov 2012 16:24:10 +0800 Subject: [PATCH] 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 --- drivers/video/mxc_hdmi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c index a45c347b7b9b..92822f8479c6 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 -- 2.39.5