mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
[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>
This commit is contained in:
parent
b057c3c322
commit
d8658bca2e
1 changed files with 16 additions and 9 deletions
|
@ -1350,10 +1350,7 @@ static int isp_enable_clocks(struct isp_device *isp)
|
||||||
* has to be twice of what is set on OMAP3430 to get
|
* has to be twice of what is set on OMAP3430 to get
|
||||||
* the required value for cam_mclk
|
* the required value for cam_mclk
|
||||||
*/
|
*/
|
||||||
if (cpu_is_omap3630())
|
divisor = isp->revision == ISP_REVISION_15_0 ? 1 : 2;
|
||||||
divisor = 1;
|
|
||||||
else
|
|
||||||
divisor = 2;
|
|
||||||
|
|
||||||
r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]);
|
r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]);
|
||||||
if (r) {
|
if (r) {
|
||||||
|
@ -2111,7 +2108,11 @@ static int __devinit isp_probe(struct platform_device *pdev)
|
||||||
isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1");
|
isp->isp_csiphy1.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY1");
|
||||||
isp->isp_csiphy2.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY2");
|
isp->isp_csiphy2.vdd = regulator_get(&pdev->dev, "VDD_CSIPHY2");
|
||||||
|
|
||||||
/* Clocks */
|
/* Clocks
|
||||||
|
*
|
||||||
|
* The ISP clock tree is revision-dependent. We thus need to enable ICLK
|
||||||
|
* manually to read the revision before calling __omap3isp_get().
|
||||||
|
*/
|
||||||
ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN);
|
ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -2120,6 +2121,16 @@ static int __devinit isp_probe(struct platform_device *pdev)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
ret = clk_enable(isp->clock[ISP_CLK_CAM_ICK]);
|
||||||
|
if (ret < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
isp->revision = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION);
|
||||||
|
dev_info(isp->dev, "Revision %d.%d found\n",
|
||||||
|
(isp->revision & 0xf0) >> 4, isp->revision & 0x0f);
|
||||||
|
|
||||||
|
clk_disable(isp->clock[ISP_CLK_CAM_ICK]);
|
||||||
|
|
||||||
if (__omap3isp_get(isp, false) == NULL) {
|
if (__omap3isp_get(isp, false) == NULL) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -2130,10 +2141,6 @@ static int __devinit isp_probe(struct platform_device *pdev)
|
||||||
goto error_isp;
|
goto error_isp;
|
||||||
|
|
||||||
/* Memory resources */
|
/* Memory resources */
|
||||||
isp->revision = isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION);
|
|
||||||
dev_info(isp->dev, "Revision %d.%d found\n",
|
|
||||||
(isp->revision & 0xf0) >> 4, isp->revision & 0x0f);
|
|
||||||
|
|
||||||
for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++)
|
for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++)
|
||||||
if (isp->revision == isp_res_maps[m].isp_rev)
|
if (isp->revision == isp_res_maps[m].isp_rev)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue