summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2012-01-05 20:29:52 +0800
committerJason Liu <r64343@freescale.com>2012-01-19 12:41:22 +0800
commit2b8baba21c6d026e3253f4e6a5101ecc8a4396b9 (patch)
treee1b29032b88d74435518d9006d8395b2e0b52913 /drivers/video
parent5d7f7473514222c03de999215eb0d28c3012fcca (diff)
ENGR00170912 HDMI: system hang if set hdmi_mode video=mxcfb1
System will hang at PHY PLL lock wating loop, if HDMI PHY is down. Added timeout check for HDMI PHY PLL lock waiting. Signed-off-by: Sandor Yu <R01008@freescale.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/mxc_hdmi.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c
index e73ec4508ca7..24caf02f3217 100644
--- a/drivers/video/mxc_hdmi.c
+++ b/drivers/video/mxc_hdmi.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2011-2012 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -827,6 +827,7 @@ static int hdmi_phy_configure(struct mxc_hdmi *hdmi, unsigned char pRep,
unsigned char cRes, int cscOn)
{
u8 val;
+ u8 msec;
dev_dbg(&hdmi->pdev->dev, "%s\n", __func__);
@@ -1055,15 +1056,17 @@ static int hdmi_phy_configure(struct mxc_hdmi *hdmi, unsigned char pRep,
mxc_hdmi_phy_gen2_txpwron(1);
mxc_hdmi_phy_gen2_pddq(0);
- udelay(1000);
-
- /* wait for the phy PLL to lock */
- while ((hdmi_readb(HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK) == 0)
- ;
-
- /* Has the PHY PLL locked? */
- if ((hdmi_readb(HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK) == 0)
- return false;
+ /*Wait for PHY PLL lock */
+ msec = 4;
+ val = hdmi_readb(HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK;
+ while (val == 0) {
+ udelay(1000);
+ if (msec-- == 0) {
+ dev_err(&hdmi->pdev->dev, "PHY PLL not locked\n");
+ return false;
+ }
+ val = hdmi_readb(HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK;
+ }
return true;
}