Skip to content

Commit

Permalink
OMAP: DSS2: Make check-delay-loops consistent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomi Valkeinen committed Jan 11, 2010
1 parent f3a82d1 commit 24be78b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,12 @@ static int dsi_pll_power(enum dsi_pll_power_state state)

/* PLL_PWR_STATUS */
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",
state);
return -ENODEV;
}
udelay(1);
}

return 0;
Expand Down Expand Up @@ -1441,12 +1441,12 @@ static int dsi_complexio_power(enum dsi_complexio_power_state state)

/* PWR_STATUS */
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 "
"%d\n", state);
return -ENODEV;
}
udelay(1);
}

return 0;
Expand Down Expand Up @@ -1646,10 +1646,10 @@ static void dsi_complexio_uninit(void)

static int _dsi_wait_reset(void)
{
int i = 0;
int t = 0;

while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) {
if (i++ > 5) {
if (++t > 5) {
DSSERR("soft reset failed\n");
return -ENODEV;
}
Expand Down Expand Up @@ -2706,14 +2706,14 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
/* using fifo not empty */
/* TX_FIFO_NOT_EMPTY */
while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) {
udelay(1);
fifo_stalls++;
if (fifo_stalls > 0xfffff) {
DSSERR("fifo stalls overflow, pixels left %d\n",
pixels_left);
dsi_if_enable(0);
return -EIO;
}
udelay(1);
}
#elif 1
/* using fifo emptiness */
Expand Down
6 changes: 3 additions & 3 deletions drivers/video/omap2/dss/dss.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,14 @@ static irqreturn_t dss_irq_handler_omap3(int irq, void *arg)

static int _omap_dss_wait_reset(void)
{
unsigned timeout = 1000;
int t = 0;

while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) {
udelay(1);
if (!--timeout) {
if (++t > 1000) {
DSSERR("soft reset failed\n");
return -ENODEV;
}
udelay(1);
}

return 0;
Expand Down

0 comments on commit 24be78b

Please sign in to comment.