aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-09-27 09:38:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-28 07:54:46 -0500
commitd8658bca2e5696df2b6c69bc5538f8fe54e4a01e (patch)
treecc46693ada963935ebccfdc0533c6b795adf4964 /drivers/media
parentb057c3c32229c0db914c03eefb2579d877612926 (diff)
[media] omap3isp: Replace cpu_is_omap3630() with ISP revision check
Drivers must not rely on cpu_is_omap* macros (they will soon become private). Use the ISP revision instead to identify the hardware. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/omap3isp/isp.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 7da622ed86ed..b34bf928d80c 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1350,10 +1350,7 @@ static int isp_enable_clocks(struct isp_device *isp)
1350 * has to be twice of what is set on OMAP3430 to get 1350 * has to be twice of what is set on OMAP3430 to get
1351 * the required value for cam_mclk 1351 * the required value for cam_mclk
1352 */ 1352 */
1353 if (cpu_is_omap3630()) 1353 divisor = isp->revision == ISP_REVISION_15_0 ? 1 : 2;
1354 divisor = 1;
1355 else
1356 divisor = 2;
1357 1354
1358 r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]); 1355 r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]);
1359 if (r) { 1356 if (r) {
@@ -2111,7 +2108,11 @@ static int __devinit isp_probe(struct platform_device *pdev)
2111 isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1"); 2108 isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1");
2112 isp->isp_csiphy2.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY2"); 2109 isp->isp_csiphy2.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY2");
2113 2110
2114 /* Clocks */ 2111 /* Clocks
2112 *
2113 * The ISP clock tree is revision-dependent. We thus need to enable ICLK
2114 * manually to read the revision before calling __omap3isp_get().
2115 */
2115 ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN); 2116 ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN);
2116 if (ret < 0) 2117 if (ret < 0)
2117 goto error; 2118 goto error;
@@ -2120,6 +2121,16 @@ static int __devinit isp_probe(struct platform_device *pdev)
2120 if (ret < 0) 2121 if (ret < 0)
2121 goto error; 2122 goto error;
2122 2123
2124 ret = clk_enable(isp->clock[ISP_CLK_CAM_ICK]);
2125 if (ret < 0)
2126 goto error;
2127
2128 isp->revision = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION);
2129 dev_info(isp->dev, "Revision %d.%d found\n",
2130 (isp->revision & 0xf0) >> 4, isp->revision & 0x0f);
2131
2132 clk_disable(isp->clock[ISP_CLK_CAM_ICK]);
2133
2123 if (__omap3isp_get(isp, false) == NULL) { 2134 if (__omap3isp_get(isp, false) == NULL) {
2124 ret = -ENODEV; 2135 ret = -ENODEV;
2125 goto error; 2136 goto error;
@@ -2130,10 +2141,6 @@ static int __devinit isp_probe(struct platform_device *pdev)
2130 goto error_isp; 2141 goto error_isp;
2131 2142
2132 /* Memory resources */ 2143 /* Memory resources */
2133 isp->revision = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION);
2134 dev_info(isp->dev, "Revision %d.%d found\n",
2135 (isp->revision & 0xf0) >> 4, isp->revision & 0x0f);
2136
2137 for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++) 2144 for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++)
2138 if (isp->revision == isp_res_maps[m].isp_rev) 2145 if (isp->revision == isp_res_maps[m].isp_rev)
2139 break; 2146 break;