Skip to content

Commit 722a860

Browse files
Sylwester NawrockiMauro Carvalho Chehab
authored andcommitted
[media] exynos4-is: Fix FIMC-IS clocks initialization
The ISP clock register content is not preserved over the ISP power domain off/on cycle. Instead of setting the clock frequencies once at probe time the clock rates set up is moved to the runtime_resume handler, which is invoked after the related power domain is already enabled, ensuring the clocks are properly configured when the device is actively used. This fixes the FIMC-IS malfunctions and STREAM ON timeout errors accuring on some boards: [ 59.860000] fimc_is_general_irq_handler:583 ISR_NDONE: 5: 0x800003e8, IS_ERROR_UNKNOWN [ 59.860000] fimc_is_general_irq_handler:586 IS_ERROR_TIME_OUT Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected] Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent a908eb9 commit 722a860

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

drivers/media/platform/exynos4-is/fimc-is.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -834,23 +834,11 @@ static int fimc_is_probe(struct platform_device *pdev)
834834
goto err_clk;
835835
}
836836
pm_runtime_enable(dev);
837-
/*
838-
* Enable only the ISP power domain, keep FIMC-IS clocks off until
839-
* the whole clock tree is configured. The ISP power domain needs
840-
* be active in order to acces any CMU_ISP clock registers.
841-
*/
842-
ret = pm_runtime_get_sync(dev);
843-
if (ret < 0)
844-
goto err_irq;
845-
846-
ret = fimc_is_setup_clocks(is);
847-
pm_runtime_put_sync(dev);
848837

838+
ret = pm_runtime_get_sync(dev);
849839
if (ret < 0)
850840
goto err_irq;
851841

852-
is->clk_init = true;
853-
854842
is->alloc_ctx = vb2_dma_contig_init_ctx(dev);
855843
if (IS_ERR(is->alloc_ctx)) {
856844
ret = PTR_ERR(is->alloc_ctx);
@@ -872,6 +860,8 @@ static int fimc_is_probe(struct platform_device *pdev)
872860
if (ret < 0)
873861
goto err_dfs;
874862

863+
pm_runtime_put_sync(dev);
864+
875865
dev_dbg(dev, "FIMC-IS registered successfully\n");
876866
return 0;
877867

@@ -891,9 +881,11 @@ static int fimc_is_probe(struct platform_device *pdev)
891881
static int fimc_is_runtime_resume(struct device *dev)
892882
{
893883
struct fimc_is *is = dev_get_drvdata(dev);
884+
int ret;
894885

895-
if (!is->clk_init)
896-
return 0;
886+
ret = fimc_is_setup_clocks(is);
887+
if (ret)
888+
return ret;
897889

898890
return fimc_is_enable_clocks(is);
899891
}
@@ -902,9 +894,7 @@ static int fimc_is_runtime_suspend(struct device *dev)
902894
{
903895
struct fimc_is *is = dev_get_drvdata(dev);
904896

905-
if (is->clk_init)
906-
fimc_is_disable_clocks(is);
907-
897+
fimc_is_disable_clocks(is);
908898
return 0;
909899
}
910900

drivers/media/platform/exynos4-is/fimc-is.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ struct fimc_is {
264264
spinlock_t slock;
265265

266266
struct clk *clocks[ISS_CLKS_MAX];
267-
bool clk_init;
268267
void __iomem *regs;
269268
void __iomem *pmu_regs;
270269
int irq;

0 commit comments

Comments
 (0)