Commit 33eb46a7 authored by Javier Martin's avatar Javier Martin Committed by Mauro Carvalho Chehab

[media] media: i.MX27: Fix mx2_emmaprp mem2mem driver clocks

This driver wasn't converted to the new clock framework
(e038ed50).
Signed-off-by: default avatarJavier Martin <javier.martin@vista-silicon.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 062a15cf
...@@ -209,7 +209,7 @@ struct emmaprp_dev { ...@@ -209,7 +209,7 @@ struct emmaprp_dev {
int irq_emma; int irq_emma;
void __iomem *base_emma; void __iomem *base_emma;
struct clk *clk_emma; struct clk *clk_emma_ahb, *clk_emma_ipg;
struct resource *res_emma; struct resource *res_emma;
struct v4l2_m2m_dev *m2m_dev; struct v4l2_m2m_dev *m2m_dev;
...@@ -804,7 +804,8 @@ static int emmaprp_open(struct file *file) ...@@ -804,7 +804,8 @@ static int emmaprp_open(struct file *file)
return ret; return ret;
} }
clk_enable(pcdev->clk_emma); clk_prepare_enable(pcdev->clk_emma_ipg);
clk_prepare_enable(pcdev->clk_emma_ahb);
ctx->q_data[V4L2_M2M_SRC].fmt = &formats[1]; ctx->q_data[V4L2_M2M_SRC].fmt = &formats[1];
ctx->q_data[V4L2_M2M_DST].fmt = &formats[0]; ctx->q_data[V4L2_M2M_DST].fmt = &formats[0];
...@@ -820,7 +821,8 @@ static int emmaprp_release(struct file *file) ...@@ -820,7 +821,8 @@ static int emmaprp_release(struct file *file)
dprintk(pcdev, "Releasing instance %p\n", ctx); dprintk(pcdev, "Releasing instance %p\n", ctx);
clk_disable(pcdev->clk_emma); clk_disable_unprepare(pcdev->clk_emma_ahb);
clk_disable_unprepare(pcdev->clk_emma_ipg);
v4l2_m2m_ctx_release(ctx->m2m_ctx); v4l2_m2m_ctx_release(ctx->m2m_ctx);
kfree(ctx); kfree(ctx);
...@@ -880,9 +882,15 @@ static int emmaprp_probe(struct platform_device *pdev) ...@@ -880,9 +882,15 @@ static int emmaprp_probe(struct platform_device *pdev)
spin_lock_init(&pcdev->irqlock); spin_lock_init(&pcdev->irqlock);
pcdev->clk_emma = clk_get(&pdev->dev, NULL); pcdev->clk_emma_ipg = devm_clk_get(&pdev->dev, "ipg");
if (IS_ERR(pcdev->clk_emma)) { if (IS_ERR(pcdev->clk_emma_ipg)) {
ret = PTR_ERR(pcdev->clk_emma); ret = PTR_ERR(pcdev->clk_emma_ipg);
goto free_dev;
}
pcdev->clk_emma_ahb = devm_clk_get(&pdev->dev, "ahb");
if (IS_ERR(pcdev->clk_emma_ipg)) {
ret = PTR_ERR(pcdev->clk_emma_ahb);
goto free_dev; goto free_dev;
} }
...@@ -891,12 +899,12 @@ static int emmaprp_probe(struct platform_device *pdev) ...@@ -891,12 +899,12 @@ static int emmaprp_probe(struct platform_device *pdev)
if (irq_emma < 0 || res_emma == NULL) { if (irq_emma < 0 || res_emma == NULL) {
dev_err(&pdev->dev, "Missing platform resources data\n"); dev_err(&pdev->dev, "Missing platform resources data\n");
ret = -ENODEV; ret = -ENODEV;
goto free_clk; goto free_dev;
} }
ret = v4l2_device_register(&pdev->dev, &pcdev->v4l2_dev); ret = v4l2_device_register(&pdev->dev, &pcdev->v4l2_dev);
if (ret) if (ret)
goto free_clk; goto free_dev;
mutex_init(&pcdev->dev_mutex); mutex_init(&pcdev->dev_mutex);
...@@ -969,8 +977,6 @@ static int emmaprp_probe(struct platform_device *pdev) ...@@ -969,8 +977,6 @@ static int emmaprp_probe(struct platform_device *pdev)
video_device_release(vfd); video_device_release(vfd);
unreg_dev: unreg_dev:
v4l2_device_unregister(&pcdev->v4l2_dev); v4l2_device_unregister(&pcdev->v4l2_dev);
free_clk:
clk_put(pcdev->clk_emma);
free_dev: free_dev:
kfree(pcdev); kfree(pcdev);
...@@ -987,7 +993,6 @@ static int emmaprp_remove(struct platform_device *pdev) ...@@ -987,7 +993,6 @@ static int emmaprp_remove(struct platform_device *pdev)
v4l2_m2m_release(pcdev->m2m_dev); v4l2_m2m_release(pcdev->m2m_dev);
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx); vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
v4l2_device_unregister(&pcdev->v4l2_dev); v4l2_device_unregister(&pcdev->v4l2_dev);
clk_put(pcdev->clk_emma);
kfree(pcdev); kfree(pcdev);
return 0; return 0;
......
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