OMAP: DSS2: Make check-delay-loops consistent

Loops checking for certain condition were rather inconsistent.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Reported-by: Juha Leppanen <juha_motorsportcom@luukku.com>
This commit is contained in:
Tomi Valkeinen 2010-01-07 14:19:48 +02:00
parent f3a82d11d4
commit 24be78b32f
2 changed files with 10 additions and 10 deletions

View File

@ -828,12 +828,12 @@ static int dsi_pll_power(enum dsi_pll_power_state state)
/* PLL_PWR_STATUS */ /* PLL_PWR_STATUS */
while (FLD_GET(dsi_read_reg(DSI_CLK_CTRL), 29, 28) != state) { while (FLD_GET(dsi_read_reg(DSI_CLK_CTRL), 29, 28) != state) {
udelay(1); if (++t > 1000) {
if (t++ > 1000) {
DSSERR("Failed to set DSI PLL power mode to %d\n", DSSERR("Failed to set DSI PLL power mode to %d\n",
state); state);
return -ENODEV; return -ENODEV;
} }
udelay(1);
} }
return 0; return 0;
@ -1441,12 +1441,12 @@ static int dsi_complexio_power(enum dsi_complexio_power_state state)
/* PWR_STATUS */ /* PWR_STATUS */
while (FLD_GET(dsi_read_reg(DSI_COMPLEXIO_CFG1), 26, 25) != state) { while (FLD_GET(dsi_read_reg(DSI_COMPLEXIO_CFG1), 26, 25) != state) {
udelay(1); if (++t > 1000) {
if (t++ > 1000) {
DSSERR("failed to set complexio power state to " DSSERR("failed to set complexio power state to "
"%d\n", state); "%d\n", state);
return -ENODEV; return -ENODEV;
} }
udelay(1);
} }
return 0; return 0;
@ -1646,10 +1646,10 @@ static void dsi_complexio_uninit(void)
static int _dsi_wait_reset(void) static int _dsi_wait_reset(void)
{ {
int i = 0; int t = 0;
while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) { while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) {
if (i++ > 5) { if (++t > 5) {
DSSERR("soft reset failed\n"); DSSERR("soft reset failed\n");
return -ENODEV; return -ENODEV;
} }
@ -2706,7 +2706,6 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
/* using fifo not empty */ /* using fifo not empty */
/* TX_FIFO_NOT_EMPTY */ /* TX_FIFO_NOT_EMPTY */
while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) { while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) {
udelay(1);
fifo_stalls++; fifo_stalls++;
if (fifo_stalls > 0xfffff) { if (fifo_stalls > 0xfffff) {
DSSERR("fifo stalls overflow, pixels left %d\n", DSSERR("fifo stalls overflow, pixels left %d\n",
@ -2714,6 +2713,7 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
dsi_if_enable(0); dsi_if_enable(0);
return -EIO; return -EIO;
} }
udelay(1);
} }
#elif 1 #elif 1
/* using fifo emptiness */ /* using fifo emptiness */

View File

@ -467,14 +467,14 @@ static irqreturn_t dss_irq_handler_omap3(int irq, void *arg)
static int _omap_dss_wait_reset(void) static int _omap_dss_wait_reset(void)
{ {
unsigned timeout = 1000; int t = 0;
while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) { while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) {
udelay(1); if (++t > 1000) {
if (!--timeout) {
DSSERR("soft reset failed\n"); DSSERR("soft reset failed\n");
return -ENODEV; return -ENODEV;
} }
udelay(1);
} }
return 0; return 0;