aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-07 07:19:48 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-11 07:45:26 -0500
commit24be78b32f0a6e14aead3eac89d768a361b091b3 (patch)
tree38f1f736bf0faa638d2fe1f45a356b802f021ca4 /drivers
parentf3a82d11d478a9eb5ff0cfa83796f0ba8149d841 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/dsi.c14
-rw-r--r--drivers/video/omap2/dss/dss.c6
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index e32a53c0889f..6122178f5f85 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -828,12 +828,12 @@ static int dsi_pll_power(enum dsi_pll_power_state state)
828 828
829 /* PLL_PWR_STATUS */ 829 /* PLL_PWR_STATUS */
830 while (FLD_GET(dsi_read_reg(DSI_CLK_CTRL), 29, 28) != state) { 830 while (FLD_GET(dsi_read_reg(DSI_CLK_CTRL), 29, 28) != state) {
831 udelay(1); 831 if (++t > 1000) {
832 if (t++ > 1000) {
833 DSSERR("Failed to set DSI PLL power mode to %d\n", 832 DSSERR("Failed to set DSI PLL power mode to %d\n",
834 state); 833 state);
835 return -ENODEV; 834 return -ENODEV;
836 } 835 }
836 udelay(1);
837 } 837 }
838 838
839 return 0; 839 return 0;
@@ -1441,12 +1441,12 @@ static int dsi_complexio_power(enum dsi_complexio_power_state state)
1441 1441
1442 /* PWR_STATUS */ 1442 /* PWR_STATUS */
1443 while (FLD_GET(dsi_read_reg(DSI_COMPLEXIO_CFG1), 26, 25) != state) { 1443 while (FLD_GET(dsi_read_reg(DSI_COMPLEXIO_CFG1), 26, 25) != state) {
1444 udelay(1); 1444 if (++t > 1000) {
1445 if (t++ > 1000) {
1446 DSSERR("failed to set complexio power state to " 1445 DSSERR("failed to set complexio power state to "
1447 "%d\n", state); 1446 "%d\n", state);
1448 return -ENODEV; 1447 return -ENODEV;
1449 } 1448 }
1449 udelay(1);
1450 } 1450 }
1451 1451
1452 return 0; 1452 return 0;
@@ -1646,10 +1646,10 @@ static void dsi_complexio_uninit(void)
1646 1646
1647static int _dsi_wait_reset(void) 1647static int _dsi_wait_reset(void)
1648{ 1648{
1649 int i = 0; 1649 int t = 0;
1650 1650
1651 while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) { 1651 while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) {
1652 if (i++ > 5) { 1652 if (++t > 5) {
1653 DSSERR("soft reset failed\n"); 1653 DSSERR("soft reset failed\n");
1654 return -ENODEV; 1654 return -ENODEV;
1655 } 1655 }
@@ -2706,7 +2706,6 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
2706 /* using fifo not empty */ 2706 /* using fifo not empty */
2707 /* TX_FIFO_NOT_EMPTY */ 2707 /* TX_FIFO_NOT_EMPTY */
2708 while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) { 2708 while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) {
2709 udelay(1);
2710 fifo_stalls++; 2709 fifo_stalls++;
2711 if (fifo_stalls > 0xfffff) { 2710 if (fifo_stalls > 0xfffff) {
2712 DSSERR("fifo stalls overflow, pixels left %d\n", 2711 DSSERR("fifo stalls overflow, pixels left %d\n",
@@ -2714,6 +2713,7 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
2714 dsi_if_enable(0); 2713 dsi_if_enable(0);
2715 return -EIO; 2714 return -EIO;
2716 } 2715 }
2716 udelay(1);
2717 } 2717 }
2718#elif 1 2718#elif 1
2719 /* using fifo emptiness */ 2719 /* using fifo emptiness */
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 9b05ee65a15d..0a26b7d84d41 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -467,14 +467,14 @@ static irqreturn_t dss_irq_handler_omap3(int irq, void *arg)
467 467
468static int _omap_dss_wait_reset(void) 468static int _omap_dss_wait_reset(void)
469{ 469{
470 unsigned timeout = 1000; 470 int t = 0;
471 471
472 while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) { 472 while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) {
473 udelay(1); 473 if (++t > 1000) {
474 if (!--timeout) {
475 DSSERR("soft reset failed\n"); 474 DSSERR("soft reset failed\n");
476 return -ENODEV; 475 return -ENODEV;
477 } 476 }
477 udelay(1);
478 } 478 }
479 479
480 return 0; 480 return 0;