]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] coda: fix CODA7541 hardware reset
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 18 Jul 2014 10:22:35 +0000 (07:22 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 21 Aug 2014 20:25:18 +0000 (15:25 -0500)
Do not try to read the CODA960 GDI status register on CODA7541.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/coda.c

index 3a6d1d2b429e169e125e55b55b7dcc15acf9a0e9..ec82dec04e31f1909dabfd4c39beae05dc25139e 100644 (file)
@@ -350,19 +350,22 @@ static int coda_hw_reset(struct coda_ctx *ctx)
 
        idx = coda_read(dev, CODA_REG_BIT_RUN_INDEX);
 
-       timeout = jiffies + msecs_to_jiffies(100);
-       coda_write(dev, 0x11, CODA9_GDI_BUS_CTRL);
-       while (coda_read(dev, CODA9_GDI_BUS_STATUS) != 0x77) {
-               if (time_after(jiffies, timeout))
-                       return -ETIME;
-               cpu_relax();
+       if (dev->devtype->product == CODA_960) {
+               timeout = jiffies + msecs_to_jiffies(100);
+               coda_write(dev, 0x11, CODA9_GDI_BUS_CTRL);
+               while (coda_read(dev, CODA9_GDI_BUS_STATUS) != 0x77) {
+                       if (time_after(jiffies, timeout))
+                               return -ETIME;
+                       cpu_relax();
+               }
        }
 
        ret = reset_control_reset(dev->rstc);
        if (ret < 0)
                return ret;
 
-       coda_write(dev, 0x00, CODA9_GDI_BUS_CTRL);
+       if (dev->devtype->product == CODA_960)
+               coda_write(dev, 0x00, CODA9_GDI_BUS_CTRL);
        coda_write(dev, CODA_REG_BIT_BUSY_FLAG, CODA_REG_BIT_BUSY);
        coda_write(dev, CODA_REG_RUN_ENABLE, CODA_REG_BIT_CODE_RUN);
        ret = coda_wait_timeout(dev);