Commit f8afbf3c authored by Fabio Estevam's avatar Fabio Estevam Committed by Mauro Carvalho Chehab

[media] video: mx2_camera: Use clk_prepare_enable/clk_disable_unprepare

Prepare the clock before enabling it.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: <linux-media@vger.kernel.org>
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5c4dfc84
...@@ -407,7 +407,7 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev) ...@@ -407,7 +407,7 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
{ {
unsigned long flags; unsigned long flags;
clk_disable(pcdev->clk_csi); clk_disable_unprepare(pcdev->clk_csi);
writel(0, pcdev->base_csi + CSICR1); writel(0, pcdev->base_csi + CSICR1);
if (cpu_is_mx27()) { if (cpu_is_mx27()) {
writel(0, pcdev->base_emma + PRP_CNTL); writel(0, pcdev->base_emma + PRP_CNTL);
...@@ -435,7 +435,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd) ...@@ -435,7 +435,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
if (pcdev->icd) if (pcdev->icd)
return -EBUSY; return -EBUSY;
ret = clk_enable(pcdev->clk_csi); ret = clk_prepare_enable(pcdev->clk_csi);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1639,7 +1639,7 @@ static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev) ...@@ -1639,7 +1639,7 @@ static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev)
goto exit_free_irq; goto exit_free_irq;
} }
clk_enable(pcdev->clk_emma); clk_prepare_enable(pcdev->clk_emma);
err = mx27_camera_emma_prp_reset(pcdev); err = mx27_camera_emma_prp_reset(pcdev);
if (err) if (err)
...@@ -1648,7 +1648,7 @@ static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev) ...@@ -1648,7 +1648,7 @@ static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev)
return err; return err;
exit_clk_emma_put: exit_clk_emma_put:
clk_disable(pcdev->clk_emma); clk_disable_unprepare(pcdev->clk_emma);
clk_put(pcdev->clk_emma); clk_put(pcdev->clk_emma);
exit_free_irq: exit_free_irq:
free_irq(pcdev->irq_emma, pcdev); free_irq(pcdev->irq_emma, pcdev);
...@@ -1785,7 +1785,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev) ...@@ -1785,7 +1785,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
eallocctx: eallocctx:
if (cpu_is_mx27()) { if (cpu_is_mx27()) {
free_irq(pcdev->irq_emma, pcdev); free_irq(pcdev->irq_emma, pcdev);
clk_disable(pcdev->clk_emma); clk_disable_unprepare(pcdev->clk_emma);
clk_put(pcdev->clk_emma); clk_put(pcdev->clk_emma);
iounmap(pcdev->base_emma); iounmap(pcdev->base_emma);
release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma)); release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma));
...@@ -1825,7 +1825,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev) ...@@ -1825,7 +1825,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
iounmap(pcdev->base_csi); iounmap(pcdev->base_csi);
if (cpu_is_mx27()) { if (cpu_is_mx27()) {
clk_disable(pcdev->clk_emma); clk_disable_unprepare(pcdev->clk_emma);
clk_put(pcdev->clk_emma); clk_put(pcdev->clk_emma);
iounmap(pcdev->base_emma); iounmap(pcdev->base_emma);
res = pcdev->res_emma; res = pcdev->res_emma;
......
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