OMAP: DSS2: DSI: handle error in synchronous write
authorTomi Valkeinen <tomi.valkeinen@nokia.com>
Fri, 9 Apr 2010 10:20:57 +0000 (13:20 +0300)
committerTomi Valkeinen <tomi.valkeinen@nokia.com>
Tue, 3 Aug 2010 12:18:47 +0000 (15:18 +0300)
Check if the peripheral answered something, and if so, dump the data
and return an error.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
drivers/video/omap2/dss/dsi.c

index 767f6fb..5b62176 100644 (file)
@@ -2089,6 +2089,13 @@ int dsi_vc_dcs_write(int channel, u8 *data, int len)
        if (r)
                goto err;
 
+       if (REG_GET(DSI_VC_CTRL(channel), 20, 20)) {    /* RX_FIFO_NOT_EMPTY */
+               DSSERR("rx fifo not empty after write, dumping data:\n");
+               dsi_vc_flush_receive_data(channel);
+               r = -EIO;
+               goto err;
+       }
+
        return 0;
 err:
        DSSERR("dsi_vc_dcs_write(ch %d, cmd 0x%02x, len %d) failed\n",