Samsung VZW MB1 update
/arch/arm/mach-msm/board-msm7x30.c
blob:cc4f47bcda450c3dd7b1c8f9b169f05fb76bcbcd -> blob:74f21872d491368578d34e8d7a299e14d0b7b0a5
--- arch/arm/mach-msm/board-msm7x30.c
+++ arch/arm/mach-msm/board-msm7x30.c
@@ -104,11 +104,18 @@
* res V4L2 video overlay - i.e. 1280x720x1.5x2
*/
#define MSM_V4L2_VIDEO_OVERLAY_BUF_SIZE 2764800
-#define MSM_PMEM_ADSP_SIZE 0x1E00000
+#define MSM_PMEM_ADSP_SIZE 0x2184000
#define MSM_FLUID_PMEM_ADSP_SIZE 0x2800000
#define PMEM_KERNEL_EBI0_SIZE 0x600000
#define MSM_PMEM_AUDIO_SIZE 0x200000
+#ifdef CONFIG_ION_MSM
+static struct platform_device ion_dev;
+#define MSM_ION_AUDIO_SIZE (MSM_PMEM_AUDIO_SIZE + PMEM_KERNEL_EBI0_SIZE)
+#define MSM_ION_SF_SIZE MSM_PMEM_SF_SIZE
+#define MSM_ION_HEAP_NUM 4
+#endif
+
#define PMIC_GPIO_INT 27
#define PMIC_VREG_WLAN_LEVEL 2900
#define PMIC_GPIO_SD_DET 36
@@ -1204,7 +1211,7 @@ static struct platform_device msm_camera
#ifdef CONFIG_VX6953
static struct msm_camera_sensor_platform_info vx6953_sensor_7630_info = {
- .mount_angle = 0
+ .mount_angle = 180
};
static struct msm_camera_sensor_flash_data flash_vx6953 = {
@@ -4507,6 +4514,7 @@ static int lcdc_panel_power(int on)
if (unlikely(!lcdc_power_initialized)) {
quickvx_mddi_client = 0;
+ regulator_put(mddi_ldo20);
display_common_init();
lcdc_power_initialized = 1;
}
@@ -4999,7 +5007,7 @@ static int bluetooth_power(int on)
int bahama_not_marimba = bahama_present();
- if (bahama_not_marimba == -1) {
+ if (bahama_not_marimba < 0) {
printk(KERN_WARNING "%s: bahama_present: %d\n",
__func__, bahama_not_marimba);
return -ENODEV;
@@ -5286,7 +5294,10 @@ static struct platform_device *devices[]
&msm_batt_device,
&msm_adc_device,
&msm_ebi0_thermal,
- &msm_ebi1_thermal
+ &msm_ebi1_thermal,
+#ifdef CONFIG_ION_MSM
+ &ion_dev,
+#endif
};
static struct msm_gpio msm_i2c_gpios_hw[] = {
@@ -6960,6 +6971,65 @@ static int __init pmem_kernel_ebi0_size_
}
early_param("pmem_kernel_ebi0_size", pmem_kernel_ebi0_size_setup);
+#ifdef CONFIG_ION_MSM
+#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
+static struct ion_co_heap_pdata co_ion_pdata = {
+ .adjacent_mem_id = INVALID_HEAP_ID,
+ .align = PAGE_SIZE,
+};
+#endif
+
+/**
+ * These heaps are listed in the order they will be allocated.
+ * Don't swap the order unless you know what you are doing!
+ */
+static struct ion_platform_data ion_pdata = {
+ .nr = MSM_ION_HEAP_NUM,
+ .heaps = {
+ {
+ .id = ION_SYSTEM_HEAP_ID,
+ .type = ION_HEAP_TYPE_SYSTEM,
+ .name = ION_VMALLOC_HEAP_NAME,
+ },
+#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
+ /* PMEM_ADSP = CAMERA */
+ {
+ .id = ION_CAMERA_HEAP_ID,
+ .type = ION_HEAP_TYPE_CARVEOUT,
+ .name = ION_CAMERA_HEAP_NAME,
+ .memory_type = ION_EBI_TYPE,
+ .has_outer_cache = 1,
+ .extra_data = (void *)&co_ion_pdata,
+ },
+ /* PMEM_AUDIO */
+ {
+ .id = ION_AUDIO_HEAP_ID,
+ .type = ION_HEAP_TYPE_CARVEOUT,
+ .name = ION_AUDIO_HEAP_NAME,
+ .memory_type = ION_EBI_TYPE,
+ .has_outer_cache = 1,
+ .extra_data = (void *)&co_ion_pdata,
+ },
+ /* PMEM_MDP = SF */
+ {
+ .id = ION_SF_HEAP_ID,
+ .type = ION_HEAP_TYPE_CARVEOUT,
+ .name = ION_SF_HEAP_NAME,
+ .memory_type = ION_EBI_TYPE,
+ .has_outer_cache = 1,
+ .extra_data = (void *)&co_ion_pdata,
+ },
+#endif
+ }
+};
+
+static struct platform_device ion_dev = {
+ .name = "ion-msm",
+ .id = 1,
+ .dev = { .platform_data = &ion_pdata },
+};
+#endif
+
static struct memtype_reserve msm7x30_reserve_table[] __initdata = {
[MEMTYPE_SMI] = {
},
@@ -6971,40 +7041,79 @@ static struct memtype_reserve msm7x30_re
},
};
-static void __init size_pmem_devices(void)
-{
-#ifdef CONFIG_ANDROID_PMEM
- unsigned long size;
+unsigned long size;
+unsigned long msm_ion_camera_size;
+static void fix_sizes(void)
+{
if machine_is_msm7x30_fluid()
size = fluid_pmem_adsp_size;
else
size = pmem_adsp_size;
+
+#ifdef CONFIG_ION_MSM
+ msm_ion_camera_size = size;
+#endif
+}
+
+static void __init size_pmem_devices(void)
+{
+#ifdef CONFIG_ANDROID_PMEM
+#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
+
android_pmem_adsp_pdata.size = size;
android_pmem_audio_pdata.size = pmem_audio_size;
android_pmem_pdata.size = pmem_sf_size;
#endif
+#endif
}
+#ifdef CONFIG_ANDROID_PMEM
+#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
static void __init reserve_memory_for(struct android_pmem_platform_data *p)
{
msm7x30_reserve_table[p->memory_type].size += p->size;
}
+#endif
+#endif
static void __init reserve_pmem_memory(void)
{
#ifdef CONFIG_ANDROID_PMEM
+#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
reserve_memory_for(&android_pmem_adsp_pdata);
reserve_memory_for(&android_pmem_audio_pdata);
reserve_memory_for(&android_pmem_pdata);
msm7x30_reserve_table[MEMTYPE_EBI0].size += pmem_kernel_ebi0_size;
#endif
+#endif
+}
+
+static void __init size_ion_devices(void)
+{
+#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
+ ion_pdata.heaps[1].size = msm_ion_camera_size;
+ ion_pdata.heaps[2].size = MSM_ION_AUDIO_SIZE;
+ ion_pdata.heaps[3].size = MSM_ION_SF_SIZE;
+#endif
+}
+
+static void __init reserve_ion_memory(void)
+{
+#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
+ msm7x30_reserve_table[MEMTYPE_EBI0].size += msm_ion_camera_size;
+ msm7x30_reserve_table[MEMTYPE_EBI0].size += MSM_ION_AUDIO_SIZE;
+ msm7x30_reserve_table[MEMTYPE_EBI0].size += MSM_ION_SF_SIZE;
+#endif
}
static void __init msm7x30_calculate_reserve_sizes(void)
{
+ fix_sizes();
size_pmem_devices();
reserve_pmem_memory();
+ size_ion_devices();
+ reserve_ion_memory();
}
static int msm7x30_paddr_to_memtype(unsigned int paddr)