[media] coda: allow running coda without iram on mx6dl
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 5 Aug 2014 17:00:13 +0000 (14:00 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 21 Aug 2014 20:25:24 +0000 (15:25 -0500)
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/coda-bit.c
drivers/media/platform/coda/coda-common.c

index cc9afb733b48cd31a0da94f05771c0d04c0531ba..fddd10d5355878dfa1b5f3163b2e85bcdb85e21f 100644 (file)
@@ -474,6 +474,9 @@ static void coda_setup_iram(struct coda_ctx *ctx)
        iram_info->next_paddr = dev->iram.paddr;
        iram_info->remaining = dev->iram.size;
 
+       if (!dev->iram.vaddr)
+               return;
+
        switch (dev->devtype->product) {
        case CODA_7541:
                dbk_bits = CODA7_USE_HOST_DBK_ENABLE | CODA7_USE_DBK_ENABLE;
index 4e85e387f9052f5e2dcc26079c981b48275fcb6e..3bf30b8215dd7e1bceba3789b5a6d99c517f5df6 100644 (file)
@@ -1947,15 +1947,15 @@ static int coda_probe(struct platform_device *pdev)
        dev->iram.vaddr = gen_pool_dma_alloc(dev->iram_pool, dev->iram.size,
                                             &dev->iram.paddr);
        if (!dev->iram.vaddr) {
-               dev_err(&pdev->dev, "unable to alloc iram\n");
-               return -ENOMEM;
+               dev_warn(&pdev->dev, "unable to alloc iram\n");
+       } else {
+               dev->iram.blob.data = dev->iram.vaddr;
+               dev->iram.blob.size = dev->iram.size;
+               dev->iram.dentry = debugfs_create_blob("iram", 0644,
+                                                      dev->debugfs_root,
+                                                      &dev->iram.blob);
        }
 
-       dev->iram.blob.data = dev->iram.vaddr;
-       dev->iram.blob.size = dev->iram.size;
-       dev->iram.dentry = debugfs_create_blob("iram", 0644, dev->debugfs_root,
-                                              &dev->iram.blob);
-
        dev->workqueue = alloc_workqueue("coda", WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
        if (!dev->workqueue) {
                dev_err(&pdev->dev, "unable to alloc workqueue\n");