History

[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.

Laurent Pinchart committed 14 years ago

Commit d8658bc1 parent b057c3c1 file · +16 −9Browse files

Unified · Split

drivers/media/platform/omap3isp/isp.c+16−9
@@ -1350,10 +1350,7 @@ static int isp_enable_clocks(struct isp_device *isp) · 1349 unmodified lines
13501350 * has to be twice of what is set on OMAP3430 to get
13511351 * the required value for cam_mclk
13521352 */
1353− if (cpu_is_omap3630())
1354− divisor = 1;
1355− else
1356− divisor = 2;
1353+ divisor = isp->revision == ISP_REVISION_15_0 ? 1 : 2;
13571354
13581355 r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]);
13591356 if (r) {
@@ -2111,7 +2108,11 @@ static int __devinit isp_probe(struct platform_device *pdev) · 751 unmodified lines
21112108 isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1");
21122109 isp->isp_csiphy2.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY2");
21132110
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+ */
21152116 ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN);
21162117 if (ret < 0)
21172118 goto error;
@@ -2120,6 +2121,16 @@ static int __devinit isp_probe(struct platform_device *pdev) · 2 unmodified lines
21202121 if (ret < 0)
21212122 goto error;
21222123
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+
21232134 if (__omap3isp_get(isp, false) == NULL) {
21242135 ret = -ENODEV;
21252136 goto error;
@@ -2130,10 +2141,6 @@ static int __devinit isp_probe(struct platform_device *pdev) · 4 unmodified lines
21302141 goto error_isp;
21312142
21322143 /* 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−
21372144 for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++)
21382145 if (isp->revision == isp_res_maps[m].isp_rev)
21392146 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t