msm: iommu: Don't register the JPEGD IOMMU on 8930
The MSM8930 SoC does not have a JPEGD IOMMU, so avoid
registering it on that target.
Change-Id: I722994d39e09c528f311ed6409ba3a3441bc8d4e
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
diff --git a/arch/arm/mach-msm/devices-iommu.c b/arch/arm/mach-msm/devices-iommu.c
index 8ed0319..057a006 100644
--- a/arch/arm/mach-msm/devices-iommu.c
+++ b/arch/arm/mach-msm/devices-iommu.c
@@ -918,7 +918,6 @@
};
static struct platform_device *msm_iommu_common_devs[] = {
- &msm_device_iommu_jpegd,
&msm_device_iommu_vpe,
&msm_device_iommu_mdp0,
&msm_device_iommu_mdp1,
@@ -940,9 +939,11 @@
&msm_device_iommu_vcap,
};
+static struct platform_device *msm_iommu_jpegd_devs[] = {
+ &msm_device_iommu_jpegd,
+};
+
static struct platform_device *msm_iommu_common_ctx_devs[] = {
- &msm_device_jpegd_src_ctx,
- &msm_device_jpegd_dst_ctx,
&msm_device_vpe_src_ctx,
&msm_device_vpe_dst_ctx,
&msm_device_mdp_vg1_ctx,
@@ -974,6 +975,11 @@
&msm_device_vcap_vp_ctx,
};
+static struct platform_device *msm_iommu_jpegd_ctx_devs[] = {
+ &msm_device_jpegd_src_ctx,
+ &msm_device_jpegd_dst_ctx,
+};
+
static int __init iommu_init(void)
{
int ret;
@@ -1005,6 +1011,14 @@
if (ret != 0)
goto failure2;
+ if (!cpu_is_msm8930()) {
+ ret = platform_add_devices(msm_iommu_jpegd_devs,
+ ARRAY_SIZE(msm_iommu_jpegd_devs));
+
+ if (ret != 0)
+ goto failure2;
+ }
+
/* Initialize common ctx_devs */
ret = platform_add_devices(msm_iommu_common_ctx_devs,
ARRAY_SIZE(msm_iommu_common_ctx_devs));
@@ -1022,6 +1036,14 @@
if (ret != 0)
goto failure2;
+ if (!cpu_is_msm8930()) {
+ ret = platform_add_devices(msm_iommu_jpegd_ctx_devs,
+ ARRAY_SIZE(msm_iommu_jpegd_ctx_devs));
+
+ if (ret != 0)
+ goto failure2;
+ }
+
return 0;
failure2:
@@ -1047,6 +1069,11 @@
platform_device_unregister(msm_iommu_gfx2d_ctx_devs[i]);
}
+ if (!cpu_is_msm8930()) {
+ for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_ctx_devs); i++)
+ platform_device_unregister(msm_iommu_jpegd_ctx_devs[i]);
+ }
+
/* Common devs. */
for (i = 0; i < ARRAY_SIZE(msm_iommu_common_devs); ++i)
platform_device_unregister(msm_iommu_common_devs[i]);
@@ -1060,6 +1087,11 @@
platform_device_unregister(msm_iommu_gfx2d_devs[i]);
}
+ if (!cpu_is_msm8930()) {
+ for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_devs); i++)
+ platform_device_unregister(msm_iommu_jpegd_devs[i]);
+ }
+
platform_device_unregister(&msm_root_iommu_dev);
}