msm_fb: hdmi: Do not turn on HDMI if not ready

At bootup, if HPD is not configured, HDMI is not in
the state of getting turned on. This change makes sure
HDMI is not turned on/off unnecessarily which turns on
clocks as well.

CRs-Fixed: 447511
Change-Id: I074d9c463943770775b060c4a93b9120dfe9bcf0
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
This commit is contained in:
Ajay Singh Parmar 2013-02-01 07:51:35 +05:30 committed by Iliyan Malchev
parent e9f3e0c072
commit 4e751bf012
3 changed files with 18 additions and 3 deletions

View file

@ -4549,6 +4549,12 @@ static void hdmi_msm_update_panel_info(struct msm_fb_data_type *mfd)
hdmi_common_init_panel_info(&mfd->panel_info);
}
static bool hdmi_msm_cable_connected(void)
{
return hdmi_msm_state->hpd_initialized &&
external_common_state->hpd_state;
}
static int __devinit hdmi_msm_probe(struct platform_device *pdev)
{
int rc;
@ -4677,6 +4683,7 @@ static int __devinit hdmi_msm_probe(struct platform_device *pdev)
mfd = platform_get_drvdata(fb_dev);
mfd->update_panel_info = hdmi_msm_update_panel_info;
mfd->is_panel_ready = hdmi_msm_cable_connected;
if (hdmi_prim_display) {
rc = hdmi_msm_hpd_on();

View file

@ -1692,6 +1692,7 @@ static int msm_fb_register(struct msm_fb_data_type *mfd)
static int msm_fb_open(struct fb_info *info, int user)
{
struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;
bool unblank = true;
int result;
result = pm_runtime_get_sync(info->dev);
@ -1713,9 +1714,15 @@ static int msm_fb_open(struct fb_info *info, int user)
pr_debug("%s:%d no mdp_set_dma_pan_info %d\n",
__func__, __LINE__, info->node);
if (msm_fb_blank_sub(FB_BLANK_UNBLANK, info, TRUE)) {
printk(KERN_ERR "msm_fb_open: can't turn on display!\n");
return -1;
if (mfd->is_panel_ready && !mfd->is_panel_ready())
unblank = false;
if (unblank) {
if (msm_fb_blank_sub(FB_BLANK_UNBLANK, info, TRUE)) {
MSM_FB_ERR("%s: can't turn on display!\n",
__func__);
return -EPERM;
}
}
}

View file

@ -141,6 +141,7 @@ struct msm_fb_data_type {
void (*vsync_ctrl) (int enable);
void (*vsync_init) (int cndx);
void (*update_panel_info)(struct msm_fb_data_type *mfd);
bool (*is_panel_ready)(void);
void *vsync_show;
void *cursor_buf;
void *cursor_buf_phys;