aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:05:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:05:15 -0500
commitd027db132b395dabfac208e52a7e510e441bb9d2 (patch)
tree24b055b2385f9848e77e646ce475991d8675c3c4 /drivers/media
parentd01e4afdbb65e030fd6f1f96c30a558e2eb0f279 (diff)
parent5faf7cbb848da827f6ea1458b5a1c26a44e7510a (diff)
Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC updates from Olof Johansson: "This contains the bulk of new SoC development for this merge window. Two new platforms have been added, the sunxi platforms (Allwinner A1x SoCs) by Maxime Ripard, and a generic Broadcom platform for a new series of ARMv7 platforms from them, where the hope is that we can keep the platform code generic enough to have them all share one mach directory. The new Broadcom platform is contributed by Christian Daudt. Highbank has grown support for Calxeda's next generation of hardware, ECX-2000. clps711x has seen a lot of cleanup from Alexander Shiyan, and he's also taken on maintainership of the platform. Beyond this there has been a bunch of work from a number of people on converting more platforms to IRQ domains, pinctrl conversion, cleanup and general feature enablement across most of the active platforms." Fix up trivial conflicts as per Olof. * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (174 commits) mfd: vexpress-sysreg: Remove LEDs code irqchip: irq-sunxi: Add terminating entry for sunxi_irq_dt_ids clocksource: sunxi_timer: Add terminating entry for sunxi_timer_dt_ids irq: versatile: delete dangling variable ARM: sunxi: add missing include for mdelay() ARM: EXYNOS: Avoid early use of of_machine_is_compatible() ARM: dts: add node for PL330 MDMA1 controller for exynos4 ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412 ARM: EXYNOS: add UART3 to DEBUG_LL ports ARM: S3C24XX: Add clkdev entry for camif-upll clock ARM: SAMSUNG: Add s3c24xx/s3c64xx CAMIF GPIO setup helpers ARM: sunxi: Add missing sun4i.dtsi file pinctrl: samsung: Do not initialise statics to 0 ARM i.MX6: remove gate_mask from pllv3 ARM i.MX6: Fix ethernet PLL clocks ARM i.MX6: rename PLLs according to datasheet ARM i.MX6: Add pwm support ARM i.MX51: Add pwm support ARM i.MX53: Add pwm support ARM: mx5: Replace clk_register_clkdev with clock DT lookup ...
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/soc_camera/mx2_camera.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
index 8ac9b72b5ec7..791cd1d54a76 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -278,7 +278,8 @@ struct mx2_camera_dev {
278 struct device *dev; 278 struct device *dev;
279 struct soc_camera_host soc_host; 279 struct soc_camera_host soc_host;
280 struct soc_camera_device *icd; 280 struct soc_camera_device *icd;
281 struct clk *clk_csi, *clk_emma_ahb, *clk_emma_ipg; 281 struct clk *clk_emma_ahb, *clk_emma_ipg;
282 struct clk *clk_csi_ahb, *clk_csi_per;
282 283
283 void __iomem *base_csi, *base_emma; 284 void __iomem *base_csi, *base_emma;
284 285
@@ -464,7 +465,8 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
464{ 465{
465 unsigned long flags; 466 unsigned long flags;
466 467
467 clk_disable_unprepare(pcdev->clk_csi); 468 clk_disable_unprepare(pcdev->clk_csi_ahb);
469 clk_disable_unprepare(pcdev->clk_csi_per);
468 writel(0, pcdev->base_csi + CSICR1); 470 writel(0, pcdev->base_csi + CSICR1);
469 if (is_imx27_camera(pcdev)) { 471 if (is_imx27_camera(pcdev)) {
470 writel(0, pcdev->base_emma + PRP_CNTL); 472 writel(0, pcdev->base_emma + PRP_CNTL);
@@ -492,10 +494,14 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
492 if (pcdev->icd) 494 if (pcdev->icd)
493 return -EBUSY; 495 return -EBUSY;
494 496
495 ret = clk_prepare_enable(pcdev->clk_csi); 497 ret = clk_prepare_enable(pcdev->clk_csi_ahb);
496 if (ret < 0) 498 if (ret < 0)
497 return ret; 499 return ret;
498 500
501 ret = clk_prepare_enable(pcdev->clk_csi_per);
502 if (ret < 0)
503 goto exit_csi_ahb;
504
499 csicr1 = CSICR1_MCLKEN; 505 csicr1 = CSICR1_MCLKEN;
500 506
501 if (is_imx27_camera(pcdev)) 507 if (is_imx27_camera(pcdev))
@@ -512,6 +518,11 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
512 icd->devnum); 518 icd->devnum);
513 519
514 return 0; 520 return 0;
521
522exit_csi_ahb:
523 clk_disable_unprepare(pcdev->clk_csi_ahb);
524
525 return ret;
515} 526}
516 527
517static void mx2_camera_remove_device(struct soc_camera_device *icd) 528static void mx2_camera_remove_device(struct soc_camera_device *icd)
@@ -1777,10 +1788,17 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
1777 break; 1788 break;
1778 } 1789 }
1779 1790
1780 pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb"); 1791 pcdev->clk_csi_ahb = devm_clk_get(&pdev->dev, "ahb");
1781 if (IS_ERR(pcdev->clk_csi)) { 1792 if (IS_ERR(pcdev->clk_csi_ahb)) {
1782 dev_err(&pdev->dev, "Could not get csi clock\n"); 1793 dev_err(&pdev->dev, "Could not get csi ahb clock\n");
1783 err = PTR_ERR(pcdev->clk_csi); 1794 err = PTR_ERR(pcdev->clk_csi_ahb);
1795 goto exit;
1796 }
1797
1798 pcdev->clk_csi_per = devm_clk_get(&pdev->dev, "per");
1799 if (IS_ERR(pcdev->clk_csi_per)) {
1800 dev_err(&pdev->dev, "Could not get csi per clock\n");
1801 err = PTR_ERR(pcdev->clk_csi_per);
1784 goto exit; 1802 goto exit;
1785 } 1803 }
1786 1804
@@ -1790,12 +1808,13 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
1790 1808
1791 pcdev->platform_flags = pcdev->pdata->flags; 1809 pcdev->platform_flags = pcdev->pdata->flags;
1792 1810
1793 rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2); 1811 rate = clk_round_rate(pcdev->clk_csi_per,
1812 pcdev->pdata->clk * 2);
1794 if (rate <= 0) { 1813 if (rate <= 0) {
1795 err = -ENODEV; 1814 err = -ENODEV;
1796 goto exit; 1815 goto exit;
1797 } 1816 }
1798 err = clk_set_rate(pcdev->clk_csi, rate); 1817 err = clk_set_rate(pcdev->clk_csi_per, rate);
1799 if (err < 0) 1818 if (err < 0)
1800 goto exit; 1819 goto exit;
1801 } 1820 }
@@ -1853,7 +1872,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
1853 goto exit_free_emma; 1872 goto exit_free_emma;
1854 1873
1855 dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n", 1874 dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
1856 clk_get_rate(pcdev->clk_csi)); 1875 clk_get_rate(pcdev->clk_csi_per));
1857 1876
1858 return 0; 1877 return 0;
1859 1878