Drivers must not rely on cpu_is_omap* macros (they will soon become private). Use the ISP revision instead to identify the hardware.
Unified · Split
| @@ -1350,10 +1350,7 @@ static int isp_enable_clocks(struct isp_device *isp) · 1349 unmodified lines | ||
| 1350 | 1350 | * has to be twice of what is set on OMAP3430 to get |
| 1351 | 1351 | * the required value for cam_mclk |
| 1352 | 1352 | */ |
| 1353 | − if (cpu_is_omap3630()) | |
| 1354 | − divisor = 1; | |
| 1355 | − else | |
| 1356 | − divisor = 2; | |
| 1353 | + divisor = isp->revision == ISP_REVISION_15_0 ? 1 : 2; | |
| 1357 | 1354 | |
| 1358 | 1355 | r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]); |
| 1359 | 1356 | if (r) { |
| @@ -2111,7 +2108,11 @@ static int __devinit isp_probe(struct platform_device *pdev) · 751 unmodified lines | ||
| 2111 | 2108 | isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1"); |
| 2112 | 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 | 2116 | ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN); |
| 2116 | 2117 | if (ret < 0) |
| 2117 | 2118 | goto error; |
| @@ -2120,6 +2121,16 @@ static int __devinit isp_probe(struct platform_device *pdev) · 2 unmodified lines | ||
| 2120 | 2121 | if (ret < 0) |
| 2121 | 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 | 2134 | if (__omap3isp_get(isp, false) == NULL) { |
| 2124 | 2135 | ret = -ENODEV; |
| 2125 | 2136 | goto error; |
| @@ -2130,10 +2141,6 @@ static int __devinit isp_probe(struct platform_device *pdev) · 4 unmodified lines | ||
| 2130 | 2141 | goto error_isp; |
| 2131 | 2142 | |
| 2132 | 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 | 2144 | for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++) |
| 2138 | 2145 | if (isp->revision == isp_res_maps[m].isp_rev) |
| 2139 | 2146 | break; |