diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-09-27 09:38:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-06 11:31:58 -0400 |
commit | 947c48086623d9ca2207dd0434bd58458af4ba86 (patch) | |
tree | c3b6cfe31adced9e5713ad60217f19011cc66833 /drivers/media | |
parent | 5bdb7872cdadcd630dd2129633e1a3f8aeac69f8 (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.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index d7aa513dcc8d..6034dca63404 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c | |||
@@ -1345,10 +1345,7 @@ static int isp_enable_clocks(struct isp_device *isp) | |||
1345 | * has to be twice of what is set on OMAP3430 to get | 1345 | * has to be twice of what is set on OMAP3430 to get |
1346 | * the required value for cam_mclk | 1346 | * the required value for cam_mclk |
1347 | */ | 1347 | */ |
1348 | if (cpu_is_omap3630()) | 1348 | divisor = isp->revision == ISP_REVISION_15_0 ? 1 : 2; |
1349 | divisor = 1; | ||
1350 | else | ||
1351 | divisor = 2; | ||
1352 | 1349 | ||
1353 | r = clk_enable(isp->clock[ISP_CLK_CAM_ICK]); | 1350 | r = clk_enable(isp->clock[ISP_CLK_CAM_ICK]); |
1354 | if (r) { | 1351 | if (r) { |
@@ -2093,7 +2090,11 @@ static int __devinit isp_probe(struct platform_device *pdev) | |||
2093 | isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1"); | 2090 | isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1"); |
2094 | isp->isp_csiphy2.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY2"); | 2091 | isp->isp_csiphy2.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY2"); |
2095 | 2092 | ||
2096 | /* Clocks */ | 2093 | /* Clocks |
2094 | * | ||
2095 | * The ISP clock tree is revision-dependent. We thus need to enable ICLK | ||
2096 | * manually to read the revision before calling __omap3isp_get(). | ||
2097 | */ | ||
2097 | ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN); | 2098 | ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN); |
2098 | if (ret < 0) | 2099 | if (ret < 0) |
2099 | goto error; | 2100 | goto error; |
@@ -2102,6 +2103,16 @@ static int __devinit isp_probe(struct platform_device *pdev) | |||
2102 | if (ret < 0) | 2103 | if (ret < 0) |
2103 | goto error; | 2104 | goto error; |
2104 | 2105 | ||
2106 | ret = clk_enable(isp->clock[ISP_CLK_CAM_ICK]); | ||
2107 | if (ret < 0) | ||
2108 | goto error; | ||
2109 | |||
2110 | isp->revision = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION); | ||
2111 | dev_info(isp->dev, "Revision %d.%d found\n", | ||
2112 | (isp->revision & 0xf0) >> 4, isp->revision & 0x0f); | ||
2113 | |||
2114 | clk_disable(isp->clock[ISP_CLK_CAM_ICK]); | ||
2115 | |||
2105 | if (__omap3isp_get(isp, false) == NULL) { | 2116 | if (__omap3isp_get(isp, false) == NULL) { |
2106 | ret = -ENODEV; | 2117 | ret = -ENODEV; |
2107 | goto error; | 2118 | goto error; |
@@ -2112,10 +2123,6 @@ static int __devinit isp_probe(struct platform_device *pdev) | |||
2112 | goto error_isp; | 2123 | goto error_isp; |
2113 | 2124 | ||
2114 | /* Memory resources */ | 2125 | /* Memory resources */ |
2115 | isp->revision = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION); | ||
2116 | dev_info(isp->dev, "Revision %d.%d found\n", | ||
2117 | (isp->revision & 0xf0) >> 4, isp->revision & 0x0f); | ||
2118 | |||
2119 | for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++) | 2126 | for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++) |
2120 | if (isp->revision == isp_res_maps[m].isp_rev) | 2127 | if (isp->revision == isp_res_maps[m].isp_rev) |
2121 | break; | 2128 | break; |