msm: Give explicit name spaces to memory devices
Rather than relying on the static keyword to allow multiple
platform devices with the same name, explicitly name devices
and platform data accordingly. This simplifies future work
to pull devices out of the board file.
Change-Id: I30f29a04103ba3468cf2ddc8e529b2b9f8c5e5c7
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8930.c b/arch/arm/mach-msm/board-8930.c
index 24e6a79..3c20add 100644
--- a/arch/arm/mach-msm/board-8930.c
+++ b/arch/arm/mach-msm/board-8930.c
@@ -185,7 +185,7 @@
.memory_type = MEMTYPE_EBI1,
};
-static struct platform_device android_pmem_device = {
+static struct platform_device msm8930_android_pmem_device = {
.name = "android_pmem",
.id = 0,
.dev = {.platform_data = &android_pmem_pdata},
@@ -197,7 +197,7 @@
.cached = 0,
.memory_type = MEMTYPE_EBI1,
};
-static struct platform_device android_pmem_adsp_device = {
+static struct platform_device msm8930_android_pmem_adsp_device = {
.name = "android_pmem",
.id = 2,
.dev = { .platform_data = &android_pmem_adsp_pdata },
@@ -210,7 +210,7 @@
.memory_type = MEMTYPE_EBI1,
};
-static struct platform_device android_pmem_audio_device = {
+static struct platform_device msm8930_android_pmem_audio_device = {
.name = "android_pmem",
.id = 4,
.dev = { .platform_data = &android_pmem_audio_pdata },
@@ -250,7 +250,7 @@
};
#if defined(CONFIG_MSM_RTB)
-static struct msm_rtb_platform_data msm_rtb_pdata = {
+static struct msm_rtb_platform_data msm8930_rtb_pdata = {
.size = SZ_1M,
};
@@ -259,17 +259,17 @@
int s;
s = memparse(p, NULL);
- msm_rtb_pdata.size = ALIGN(s, SZ_4K);
+ msm8930_rtb_pdata.size = ALIGN(s, SZ_4K);
return 0;
}
early_param("msm_rtb_size", msm_rtb_set_buffer_size);
-static struct platform_device msm_rtb_device = {
+static struct platform_device msm8930_rtb_device = {
.name = "msm_rtb",
.id = -1,
.dev = {
- .platform_data = &msm_rtb_pdata,
+ .platform_data = &msm8930_rtb_pdata,
},
};
#endif
@@ -277,7 +277,7 @@
static void __init reserve_rtb_memory(void)
{
#if defined(CONFIG_MSM_RTB)
- msm8930_reserve_table[MEMTYPE_EBI1].size += msm_rtb_pdata.size;
+ msm8930_reserve_table[MEMTYPE_EBI1].size += msm8930_rtb_pdata.size;
#endif
}
@@ -320,20 +320,20 @@
#ifdef CONFIG_ION_MSM
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
-static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
+static struct ion_cp_heap_pdata cp_mm_msm8930_ion_pdata = {
.permission_type = IPT_TYPE_MM_CARVEOUT,
.align = PAGE_SIZE,
};
-static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
+static struct ion_cp_heap_pdata cp_mfc_msm8930_ion_pdata = {
.permission_type = IPT_TYPE_MFC_SHAREDMEM,
.align = PAGE_SIZE,
};
-static struct ion_co_heap_pdata co_ion_pdata = {
+static struct ion_co_heap_pdata co_msm8930_ion_pdata = {
.adjacent_mem_id = INVALID_HEAP_ID,
.align = PAGE_SIZE,
};
-static struct ion_co_heap_pdata fw_co_ion_pdata = {
+static struct ion_co_heap_pdata fw_co_msm8930_ion_pdata = {
.adjacent_mem_id = ION_CP_MM_HEAP_ID,
.align = SZ_128K,
};
@@ -350,7 +350,7 @@
* to each other.
* Don't swap the order unless you know what you are doing!
*/
-static struct ion_platform_data ion_pdata = {
+static struct ion_platform_data msm8930_ion_pdata = {
.nr = MSM_ION_HEAP_NUM,
.heaps = {
{
@@ -365,7 +365,7 @@
.name = ION_MM_HEAP_NAME,
.size = MSM_ION_MM_SIZE,
.memory_type = ION_EBI_TYPE,
- .extra_data = (void *) &cp_mm_ion_pdata,
+ .extra_data = (void *) &cp_mm_msm8930_ion_pdata,
},
{
.id = ION_MM_FIRMWARE_HEAP_ID,
@@ -373,7 +373,7 @@
.name = ION_MM_FIRMWARE_HEAP_NAME,
.size = MSM_ION_MM_FW_SIZE,
.memory_type = ION_EBI_TYPE,
- .extra_data = (void *) &fw_co_ion_pdata,
+ .extra_data = (void *) &fw_co_msm8930_ion_pdata,
},
{
.id = ION_CP_MFC_HEAP_ID,
@@ -381,7 +381,7 @@
.name = ION_MFC_HEAP_NAME,
.size = MSM_ION_MFC_SIZE,
.memory_type = ION_EBI_TYPE,
- .extra_data = (void *) &cp_mfc_ion_pdata,
+ .extra_data = (void *) &cp_mfc_msm8930_ion_pdata,
},
{
.id = ION_SF_HEAP_ID,
@@ -389,7 +389,7 @@
.name = ION_SF_HEAP_NAME,
.size = MSM_ION_SF_SIZE,
.memory_type = ION_EBI_TYPE,
- .extra_data = (void *) &co_ion_pdata,
+ .extra_data = (void *) &co_msm8930_ion_pdata,
},
{
.id = ION_IOMMU_HEAP_ID,
@@ -402,7 +402,7 @@
.name = ION_QSECOM_HEAP_NAME,
.size = MSM_ION_QSECOM_SIZE,
.memory_type = ION_EBI_TYPE,
- .extra_data = (void *) &co_ion_pdata,
+ .extra_data = (void *) &co_msm8930_ion_pdata,
},
{
.id = ION_AUDIO_HEAP_ID,
@@ -410,16 +410,16 @@
.name = ION_AUDIO_HEAP_NAME,
.size = MSM_ION_AUDIO_SIZE,
.memory_type = ION_EBI_TYPE,
- .extra_data = (void *) &co_ion_pdata,
+ .extra_data = (void *) &co_msm8930_ion_pdata,
},
#endif
}
};
-static struct platform_device ion_dev = {
+static struct platform_device msm8930_ion_dev = {
.name = "ion-msm",
.id = 1,
- .dev = { .platform_data = &ion_pdata },
+ .dev = { .platform_data = &msm8930_ion_pdata },
};
#endif
@@ -1749,9 +1749,9 @@
#endif
#ifdef CONFIG_ANDROID_PMEM
#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
- &android_pmem_device,
- &android_pmem_adsp_device,
- &android_pmem_audio_device,
+ &msm8930_android_pmem_device,
+ &msm8930_android_pmem_adsp_device,
+ &msm8930_android_pmem_audio_device,
#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
#endif /*CONFIG_ANDROID_PMEM*/
&msm_device_bam_dmux,
@@ -1764,7 +1764,7 @@
&msm8930_rpm_log_device,
&msm8930_rpm_stat_device,
#ifdef CONFIG_ION_MSM
- &ion_dev,
+ &msm8930_ion_dev,
#endif
&msm_device_tz_log,
@@ -1781,7 +1781,7 @@
&gpio_keys_8930,
#endif
#ifdef CONFIG_MSM_RTB
- &msm_rtb_device,
+ &msm8930_rtb_device,
#endif
&msm8930_cpu_idle_device,
&msm8930_msm_gov_device,