summaryrefslogtreecommitdiff
path: root/drivers/media/video/s5p-fimc/fimc-core.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-04-20 21:57:25 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-20 12:17:11 (GMT)
commit693f5c40825e91632478624bf0366e6ebf862a25 (patch)
tree3c948517fbdbffdde66c2b076a187aa31ca07100 /drivers/media/video/s5p-fimc/fimc-core.c
parent97d974226575227ebafdf3ab009f0212d8a7e223 (diff)
downloadlinux-693f5c40825e91632478624bf0366e6ebf862a25.tar.xz
[media] s5p-fimc: Use v4l2_subdev internal ops to register video nodes
In order to be able to select only FIMC-LITE support, which is added with subsequent patches, the regular FIMC support is now contained only in fimc-core.c, fimc-m2m.c and fimc-capture.c files. The graph and pipeline management is now solely handled in fimc-mdevice.[ch]. This means the FIMC driver can now be excluded with Kconfig option, leaving only FIMC-LITE and allowing this driver to be reused in SoCs that have only FIMC-LITE and no regular FIMC IP. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-core.c')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index 749db4d..add24cd 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -842,8 +842,6 @@ static int fimc_probe(struct platform_device *pdev)
clk_set_rate(fimc->clock[CLK_BUS], drv_data->lclk_frequency);
clk_enable(fimc->clock[CLK_BUS]);
- platform_set_drvdata(pdev, fimc);
-
ret = devm_request_irq(&pdev->dev, res->start, fimc_irq_handler,
0, pdev->name, fimc);
if (ret) {
@@ -851,10 +849,15 @@ static int fimc_probe(struct platform_device *pdev)
goto err_clk;
}
+ ret = fimc_initialize_capture_subdev(fimc);
+ if (ret)
+ goto err_clk;
+
+ platform_set_drvdata(pdev, fimc);
pm_runtime_enable(&pdev->dev);
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0)
- goto err_clk;
+ goto err_sd;
/* Initialize contiguous memory allocator */
fimc->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
if (IS_ERR(fimc->alloc_ctx)) {
@@ -866,9 +869,10 @@ static int fimc_probe(struct platform_device *pdev)
pm_runtime_put(&pdev->dev);
return 0;
-
err_pm:
pm_runtime_put(&pdev->dev);
+err_sd:
+ fimc_unregister_capture_subdev(fimc);
err_clk:
fimc_clk_put(fimc);
return ret;
@@ -953,6 +957,7 @@ static int __devexit fimc_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
+ fimc_unregister_capture_subdev(fimc);
vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
clk_disable(fimc->clock[CLK_BUS]);