diff options
author | Sandor Yu <R01008@freescale.com> | 2012-11-08 16:24:10 +0800 |
---|---|---|
committer | Sandor Yu <R01008@freescale.com> | 2012-11-08 16:49:30 +0800 |
commit | 731b8f9d07e12e998ff2e25f144e7d95969975b7 (patch) | |
tree | 26df00c09f2ba2b799d58ef51587b65a4394a26b /drivers | |
parent | 7b015b8373dcebcf492602194cc56533b87d6283 (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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/mxc_hdmi.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 |