Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330901
b: refs/heads/master
c: eb68faa
h: refs/heads/master
i:
  330899: 881d3e0
v: v3
  • Loading branch information
Javier Martin authored and Mauro Carvalho Chehab committed Aug 15, 2012
1 parent 0549ec3 commit 9846b10
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c72f429f665c1f8087dddde75f4e99f4d1f886cd
refs/heads/master: eb68faaf6685dca904cc92dfbe1028eb5475d662
43 changes: 29 additions & 14 deletions trunk/drivers/media/platform/mx2_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ struct mx2_camera_dev {
struct device *dev;
struct soc_camera_host soc_host;
struct soc_camera_device *icd;
struct clk *clk_csi, *clk_emma;
struct clk *clk_csi, *clk_emma_ahb, *clk_emma_ipg;

unsigned int irq_csi, irq_emma;
void __iomem *base_csi, *base_emma;
Expand Down Expand Up @@ -1673,23 +1673,34 @@ static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev)
goto exit_iounmap;
}

pcdev->clk_emma = clk_get(NULL, "emma");
if (IS_ERR(pcdev->clk_emma)) {
err = PTR_ERR(pcdev->clk_emma);
pcdev->clk_emma_ipg = clk_get(pcdev->dev, "emma-ipg");
if (IS_ERR(pcdev->clk_emma_ipg)) {
err = PTR_ERR(pcdev->clk_emma_ipg);
goto exit_free_irq;
}

clk_prepare_enable(pcdev->clk_emma);
clk_prepare_enable(pcdev->clk_emma_ipg);

pcdev->clk_emma_ahb = clk_get(pcdev->dev, "emma-ahb");
if (IS_ERR(pcdev->clk_emma_ahb)) {
err = PTR_ERR(pcdev->clk_emma_ahb);
goto exit_clk_emma_ipg_put;
}

clk_prepare_enable(pcdev->clk_emma_ahb);

err = mx27_camera_emma_prp_reset(pcdev);
if (err)
goto exit_clk_emma_put;
goto exit_clk_emma_ahb_put;

return err;

exit_clk_emma_put:
clk_disable_unprepare(pcdev->clk_emma);
clk_put(pcdev->clk_emma);
exit_clk_emma_ahb_put:
clk_disable_unprepare(pcdev->clk_emma_ahb);
clk_put(pcdev->clk_emma_ahb);
exit_clk_emma_ipg_put:
clk_disable_unprepare(pcdev->clk_emma_ipg);
clk_put(pcdev->clk_emma_ipg);
exit_free_irq:
free_irq(pcdev->irq_emma, pcdev);
exit_iounmap:
Expand Down Expand Up @@ -1725,7 +1736,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
goto exit;
}

pcdev->clk_csi = clk_get(&pdev->dev, NULL);
pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
if (IS_ERR(pcdev->clk_csi)) {
dev_err(&pdev->dev, "Could not get csi clock\n");
err = PTR_ERR(pcdev->clk_csi);
Expand Down Expand Up @@ -1825,8 +1836,10 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
eallocctx:
if (cpu_is_mx27()) {
free_irq(pcdev->irq_emma, pcdev);
clk_disable_unprepare(pcdev->clk_emma);
clk_put(pcdev->clk_emma);
clk_disable_unprepare(pcdev->clk_emma_ipg);
clk_put(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
clk_put(pcdev->clk_emma_ahb);
iounmap(pcdev->base_emma);
release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma));
}
Expand Down Expand Up @@ -1865,8 +1878,10 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
iounmap(pcdev->base_csi);

if (cpu_is_mx27()) {
clk_disable_unprepare(pcdev->clk_emma);
clk_put(pcdev->clk_emma);
clk_disable_unprepare(pcdev->clk_emma_ipg);
clk_put(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
clk_put(pcdev->clk_emma_ahb);
iounmap(pcdev->base_emma);
res = pcdev->res_emma;
release_mem_region(res->start, resource_size(res));
Expand Down

0 comments on commit 9846b10

Please sign in to comment.