diff options
author | Jason Chen <jason.chen@linaro.org> | 2011-12-05 17:47:35 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2012-01-11 21:39:09 +0800 |
commit | d7de772d2ea23a3cf013d5c0bcf08452dc8a4385 (patch) | |
tree | 9686a0382ef7a99f81d724558a1fe2b225eaf9d7 /drivers | |
parent | 987f59611acf5270c7e65eca5ab697c662a575ad (diff) |
imx6q-saberlite: add ipu3 dt support
Signed-off-by: Jason Chen <jason.chen@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mxc/ipu3/ipu_common.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c index 4a7ebc02548..3113e7b933b 100644 --- a/drivers/mxc/ipu3/ipu_common.c +++ b/drivers/mxc/ipu3/ipu_common.c @@ -42,6 +42,7 @@ #include "ipu_param_mem.h" static struct ipu_soc ipu_array[MXC_IPU_MAX_NUM]; +static int ipu_idx; int g_ipu_hw_rev; /* Static functions */ @@ -381,9 +382,12 @@ static int __devinit ipu_probe(struct platform_device *pdev) unsigned long ipu_base; int ret = 0; - if (pdev->id >= MXC_IPU_MAX_NUM) + if (ipu_idx >= MXC_IPU_MAX_NUM) return -ENODEV; + pdev->id = ipu_idx; + ipu_idx++; + ipu = &ipu_array[pdev->id]; memset(ipu, 0, sizeof(struct ipu_soc)); @@ -391,7 +395,10 @@ static int __devinit ipu_probe(struct platform_device *pdev) mutex_init(&ipu->mutex_lock); atomic_set(&ipu->ipu_use_count, 0); - g_ipu_hw_rev = plat_data->rev; + ret = of_property_read_u32(pdev->dev.of_node, + "revision", &g_ipu_hw_rev); + if (ret < 0 && plat_data) + g_ipu_hw_rev = plat_data->rev; ipu->dev = &pdev->dev; @@ -2933,13 +2940,21 @@ static const struct dev_pm_ops mxcipu_pm_ops = { .resume_noirq = ipu_resume_noirq, }; +static const struct of_device_id mxc_ipu_dt_ids[] = { + { .compatible = "fsl,ipuv3", }, + { /* sentinel */ } +}; + /*! * This structure contains pointers to the power management callback functions. */ static struct platform_driver mxcipu_driver = { .driver = { .name = "imx-ipuv3", +#ifdef CONFIG_PM .pm = &mxcipu_pm_ops, +#endif + .of_match_table = mxc_ipu_dt_ids, }, .probe = ipu_probe, .remove = ipu_remove, |