Commit 283bf33b authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] exynos4-is: Enable fimc-is clocks in probe() if runtime PM is disabled

Ensure the device works also when runtime PM is disabled. This will
allow to drop an incorrect dependency on PM_RUNTIME.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent da8cec30
...@@ -781,6 +781,9 @@ static int fimc_is_debugfs_create(struct fimc_is *is) ...@@ -781,6 +781,9 @@ static int fimc_is_debugfs_create(struct fimc_is *is)
return is->debugfs_entry == NULL ? -EIO : 0; return is->debugfs_entry == NULL ? -EIO : 0;
} }
static int fimc_is_runtime_resume(struct device *dev);
static int fimc_is_runtime_suspend(struct device *dev);
static int fimc_is_probe(struct platform_device *pdev) static int fimc_is_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -835,14 +838,20 @@ static int fimc_is_probe(struct platform_device *pdev) ...@@ -835,14 +838,20 @@ static int fimc_is_probe(struct platform_device *pdev)
} }
pm_runtime_enable(dev); pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev); if (!pm_runtime_enabled(dev)) {
ret = fimc_is_runtime_resume(dev);
if (ret < 0) if (ret < 0)
goto err_irq; goto err_irq;
}
ret = pm_runtime_get_sync(dev);
if (ret < 0)
goto err_pm;
is->alloc_ctx = vb2_dma_contig_init_ctx(dev); is->alloc_ctx = vb2_dma_contig_init_ctx(dev);
if (IS_ERR(is->alloc_ctx)) { if (IS_ERR(is->alloc_ctx)) {
ret = PTR_ERR(is->alloc_ctx); ret = PTR_ERR(is->alloc_ctx);
goto err_irq; goto err_pm;
} }
/* /*
* Register FIMC-IS V4L2 subdevs to this driver. The video nodes * Register FIMC-IS V4L2 subdevs to this driver. The video nodes
...@@ -871,6 +880,9 @@ static int fimc_is_probe(struct platform_device *pdev) ...@@ -871,6 +880,9 @@ static int fimc_is_probe(struct platform_device *pdev)
fimc_is_unregister_subdevs(is); fimc_is_unregister_subdevs(is);
err_vb: err_vb:
vb2_dma_contig_cleanup_ctx(is->alloc_ctx); vb2_dma_contig_cleanup_ctx(is->alloc_ctx);
err_pm:
if (!pm_runtime_enabled(dev))
fimc_is_runtime_suspend(dev);
err_irq: err_irq:
free_irq(is->irq, is); free_irq(is->irq, is);
err_clk: err_clk:
...@@ -919,10 +931,13 @@ static int fimc_is_suspend(struct device *dev) ...@@ -919,10 +931,13 @@ static int fimc_is_suspend(struct device *dev)
static int fimc_is_remove(struct platform_device *pdev) static int fimc_is_remove(struct platform_device *pdev)
{ {
struct fimc_is *is = platform_get_drvdata(pdev); struct device *dev = &pdev->dev;
struct fimc_is *is = dev_get_drvdata(dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(dev);
pm_runtime_set_suspended(&pdev->dev); pm_runtime_set_suspended(dev);
if (!pm_runtime_status_suspended(dev))
fimc_is_runtime_suspend(dev);
free_irq(is->irq, is); free_irq(is->irq, is);
fimc_is_unregister_subdevs(is); fimc_is_unregister_subdevs(is);
vb2_dma_contig_cleanup_ctx(is->alloc_ctx); vb2_dma_contig_cleanup_ctx(is->alloc_ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment