aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc/fimc-core.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-04-20 17:57:25 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-20 08:17:11 -0400
commit693f5c40825e91632478624bf0366e6ebf862a25 (patch)
tree3c948517fbdbffdde66c2b076a187aa31ca07100 /drivers/media/video/s5p-fimc/fimc-core.c
parent97d974226575227ebafdf3ab009f0212d8a7e223 (diff)
[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 749db4deefcb..add24cd373a5 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)
842 clk_set_rate(fimc->clock[CLK_BUS], drv_data->lclk_frequency); 842 clk_set_rate(fimc->clock[CLK_BUS], drv_data->lclk_frequency);
843 clk_enable(fimc->clock[CLK_BUS]); 843 clk_enable(fimc->clock[CLK_BUS]);
844 844
845 platform_set_drvdata(pdev, fimc);
846
847 ret = devm_request_irq(&pdev->dev, res->start, fimc_irq_handler, 845 ret = devm_request_irq(&pdev->dev, res->start, fimc_irq_handler,
848 0, pdev->name, fimc); 846 0, pdev->name, fimc);
849 if (ret) { 847 if (ret) {
@@ -851,10 +849,15 @@ static int fimc_probe(struct platform_device *pdev)
851 goto err_clk; 849 goto err_clk;
852 } 850 }
853 851
852 ret = fimc_initialize_capture_subdev(fimc);
853 if (ret)
854 goto err_clk;
855
856 platform_set_drvdata(pdev, fimc);
854 pm_runtime_enable(&pdev->dev); 857 pm_runtime_enable(&pdev->dev);
855 ret = pm_runtime_get_sync(&pdev->dev); 858 ret = pm_runtime_get_sync(&pdev->dev);
856 if (ret < 0) 859 if (ret < 0)
857 goto err_clk; 860 goto err_sd;
858 /* Initialize contiguous memory allocator */ 861 /* Initialize contiguous memory allocator */
859 fimc->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); 862 fimc->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
860 if (IS_ERR(fimc->alloc_ctx)) { 863 if (IS_ERR(fimc->alloc_ctx)) {
@@ -866,9 +869,10 @@ static int fimc_probe(struct platform_device *pdev)
866 869
867 pm_runtime_put(&pdev->dev); 870 pm_runtime_put(&pdev->dev);
868 return 0; 871 return 0;
869
870err_pm: 872err_pm:
871 pm_runtime_put(&pdev->dev); 873 pm_runtime_put(&pdev->dev);
874err_sd:
875 fimc_unregister_capture_subdev(fimc);
872err_clk: 876err_clk:
873 fimc_clk_put(fimc); 877 fimc_clk_put(fimc);
874 return ret; 878 return ret;
@@ -953,6 +957,7 @@ static int __devexit fimc_remove(struct platform_device *pdev)
953 pm_runtime_disable(&pdev->dev); 957 pm_runtime_disable(&pdev->dev);
954 pm_runtime_set_suspended(&pdev->dev); 958 pm_runtime_set_suspended(&pdev->dev);
955 959
960 fimc_unregister_capture_subdev(fimc);
956 vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx); 961 vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
957 962
958 clk_disable(fimc->clock[CLK_BUS]); 963 clk_disable(fimc->clock[CLK_BUS]);