#include "../../../drivers/media/video/rk30_camera.c"
/*---------------- Camera Sensor Macro Define End ---------*/
-#define PMEM_CAM_SIZE PMEM_CAM_NECESSARY
+//RK30,use ion to allocate mem , set it as 0
+#define PMEM_CAM_SIZE 0//PMEM_CAM_NECESSARY
#ifdef CONFIG_VIDEO_RK29_WORK_IPP
-#define MEM_CAMIPP_SIZE PMEM_CAMIPP_NECESSARY
+#define MEM_CAMIPP_SIZE_CIF_0 PMEM_CAMIPP_NECESSARY_CIF_0
+#define MEM_CAMIPP_SIZE_CIF_1 PMEM_CAMIPP_NECESSARY_CIF_0
#else
-#define MEM_CAMIPP_SIZE 0
+#define MEM_CAMIPP_SIZE_CIF_0 0
+#define MEM_CAMIPP_SIZE_CIF_1 0
+
#endif
/*****************************************************************************************
* camera devices
.rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_0) / sizeof(struct reginfo_t),
};
-static rk_sensor_user_init_data_s* rk_init_data_sensor_0_p = &rk_init_data_sensor_0;
+static rk_sensor_user_init_data_s* rk_init_data_sensor_0_p = NULL;
static rk_sensor_user_init_data_s* rk_init_data_sensor_1_p = NULL;
#include "../../../drivers/media/video/rk30_camera.c"
resource_fb[2].start = board_mem_reserve_add("fb2",RK30_FB0_MEM_SIZE);
resource_fb[2].end = resource_fb[2].start + RK30_FB0_MEM_SIZE - 1;
#endif
-
-#if (MEM_CAMIPP_SIZE != 0)
- #if CONFIG_USE_CIF_0
- rk_camera_platform_data.meminfo.name = "camera_ipp_mem_0";
- rk_camera_platform_data.meminfo.start = board_mem_reserve_add("camera_ipp_mem_0",MEM_CAMIPP_SIZE);
- rk_camera_platform_data.meminfo.size= MEM_CAMIPP_SIZE;
- #endif
- #if CONFIG_USE_CIF_1
- rk_camera_platform_data.meminfo_cif1.name = "camera_ipp_mem_1";
- rk_camera_platform_data.meminfo_cif1.start =board_mem_reserve_add("camera_ipp_mem_1",MEM_CAMIPP_SIZE);
- rk_camera_platform_data.meminfo_cif1.size= MEM_CAMIPP_SIZE;
- #endif
-#endif
-
-#if (PMEM_CAM_SIZE != 0)
- android_pmem_cam_pdata.start = board_mem_reserve_add("camera_pmem",PMEM_CAM_SIZE);
- android_pmem_cam_pdata.size = PMEM_CAM_SIZE;
-#endif
-
+ rk30_camera_request_reserve_mem();
board_mem_reserved();
}
#undef PMEM_SENSOR_FULL_RESOLUTION_0\r
#define PMEM_SENSOR_FULL_RESOLUTION_0 0x500000\r
#endif\r
+#if(SENSOR_CIF_BUSID_0 == RK_CAM_PLATFORM_DEV_ID_0)\r
+#define PMEM_SENSOR_FULL_RESOLUTION_CIF_0 PMEM_SENSOR_FULL_RESOLUTION_0\r
+#define PMEM_SENSOR_FULL_RESOLUTION_CIF_1 0\r
#else\r
-#define PMEM_SENSOR_FULL_RESOLUTION_0 0x00\r
+#define PMEM_SENSOR_FULL_RESOLUTION_CIF_1 PMEM_SENSOR_FULL_RESOLUTION_0\r
+#define PMEM_SENSOR_FULL_RESOLUTION_CIF_0 0\r
+#endif\r
+#else\r
+#define PMEM_SENSOR_FULL_RESOLUTION_CIF_0 0x00\r
+#define PMEM_SENSOR_FULL_RESOLUTION_CIF_1 0x00\r
#endif\r
\r
#if (CONFIG_SENSOR_IIC_ADDR_1 != 0x00)\r
#undef PMEM_SENSOR_FULL_RESOLUTION_1\r
#define PMEM_SENSOR_FULL_RESOLUTION_1 0x500000\r
#endif\r
+#if (SENSOR_CIF_BUSID_1 == RK_CAM_PLATFORM_DEV_ID_0)\r
+ #if (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 < PMEM_SENSOR_FULL_RESOLUTION_1)\r
+ #undef PMEM_SENSOR_FULL_RESOLUTION_CIF_0\r
+ #define PMEM_SENSOR_FULL_RESOLUTION_CIF_0 PMEM_SENSOR_FULL_RESOLUTION_1\r
+ #endif\r
#else\r
-#define PMEM_SENSOR_FULL_RESOLUTION_1 0x00\r
+ #if (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 < PMEM_SENSOR_FULL_RESOLUTION_1)\r
+ #undef PMEM_SENSOR_FULL_RESOLUTION_CIF_1\r
+ #define PMEM_SENSOR_FULL_RESOLUTION_CIF_1 PMEM_SENSOR_FULL_RESOLUTION_1\r
+ #endif\r
#endif\r
-\r
-#if (PMEM_SENSOR_FULL_RESOLUTION_0 > PMEM_SENSOR_FULL_RESOLUTION_1)\r
-#define PMEM_CAM_FULL_RESOLUTION PMEM_SENSOR_FULL_RESOLUTION_0\r
-#else\r
-#define PMEM_CAM_FULL_RESOLUTION PMEM_SENSOR_FULL_RESOLUTION_1\r
#endif\r
\r
-#if (PMEM_CAM_FULL_RESOLUTION == 0x500000)\r
+//CIF 0\r
+#if (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x500000)\r
#define PMEM_CAM_NECESSARY 0x1400000 /* 1280*720*1.5*4(preview) + 7.5M(capture raw) + 4M(jpeg encode output) */\r
-#define PMEM_CAMIPP_NECESSARY 0x800000\r
-#elif (PMEM_CAM_FULL_RESOLUTION == 0x300000)\r
+#define PMEM_CAMIPP_NECESSARY_CIF0 0x800000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x300000)\r
#define PMEM_CAM_NECESSARY 0xe00000 /* 1280*720*1.5*4(preview) + 4.5M(capture raw) + 3M(jpeg encode output) */\r
-#define PMEM_CAMIPP_NECESSARY 0x500000\r
-#elif (PMEM_CAM_FULL_RESOLUTION == 0x200000) /* 1280*720*1.5*4(preview) + 3M(capture raw) + 3M(jpeg encode output) */\r
+#define PMEM_CAMIPP_NECESSARY_CIF_0 0x500000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x200000) /* 1280*720*1.5*4(preview) + 3M(capture raw) + 3M(jpeg encode output) */\r
#define PMEM_CAM_NECESSARY 0xc00000\r
-#define PMEM_CAMIPP_NECESSARY 0x400000\r
-#elif ((PMEM_CAM_FULL_RESOLUTION == 0x100000) || (PMEM_CAM_FULL_RESOLUTION == 0x130000))\r
+#define PMEM_CAMIPP_NECESSARY_CIF_0 0x400000\r
+#elif ((PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x100000) || (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x130000))\r
#define PMEM_CAM_NECESSARY 0x800000 /* 800*600*1.5*4(preview) + 2M(capture raw) + 2M(jpeg encode output) */\r
-#define PMEM_CAMIPP_NECESSARY 0x400000\r
-#elif (PMEM_CAM_FULL_RESOLUTION == 0x30000)\r
+#define PMEM_CAMIPP_NECESSARY_CIF_0 0x400000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x30000)\r
#define PMEM_CAM_NECESSARY 0x400000 /* 640*480*1.5*4(preview) + 1M(capture raw) + 1M(jpeg encode output) */\r
-#define PMEM_CAMIPP_NECESSARY 0x400000\r
+#define PMEM_CAMIPP_NECESSARY_CIF_0 0x400000\r
#else\r
#define PMEM_CAM_NECESSARY 0x1200000\r
-#define PMEM_CAMIPP_NECESSARY 0x800000\r
+#define PMEM_CAMIPP_NECESSARY_CIF_0 0x800000\r
+#endif\r
+\r
+//CIF 1\r
+#if (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x500000)\r
+#define PMEM_CAM_NECESSARY 0x1400000 /* 1280*720*1.5*4(preview) + 7.5M(capture raw) + 4M(jpeg encode output) */\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1 0x800000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x300000)\r
+#define PMEM_CAM_NECESSARY 0xe00000 /* 1280*720*1.5*4(preview) + 4.5M(capture raw) + 3M(jpeg encode output) */\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1 0x500000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_1== 0x200000) /* 1280*720*1.5*4(preview) + 3M(capture raw) + 3M(jpeg encode output) */\r
+#define PMEM_CAM_NECESSARY 0xc00000\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1 0x400000\r
+#elif ((PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x100000) || (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x130000))\r
+#define PMEM_CAM_NECESSARY 0x800000 /* 800*600*1.5*4(preview) + 2M(capture raw) + 2M(jpeg encode output) */\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1 0x400000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x30000)\r
+#define PMEM_CAM_NECESSARY 0x400000 /* 640*480*1.5*4(preview) + 1M(capture raw) + 1M(jpeg encode output) */\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1 0x400000\r
+#else\r
+#define PMEM_CAM_NECESSARY 0x1200000\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1 0x800000\r
#endif\r
/*---------------- Camera Sensor Fixed Macro End ------------------------*/\r
-#else //#ifdef CONFIG_VIDEO_RK \r
-#define PMEM_CAM_NECESSARY 0x00000000\r
+#else //#ifdef CONFIG_VIDEO_RK \r
+#define PMEM_CAM_NECESSARY 0x00000000\r
#endif\r
#else // #ifdef PMEM_CAM_SIZE\r
\r
.platform_data = &android_pmem_cam_pdata,\r
},\r
};\r
+ static void rk30_camera_request_reserve_mem(void)\r
+{\r
+#if (MEM_CAMIPP_SIZE_CIF_0 != 0)\r
+ #if CONFIG_USE_CIF_0\r
+ rk_camera_platform_data.meminfo.name = "camera_ipp_mem_0";\r
+ rk_camera_platform_data.meminfo.start = board_mem_reserve_add("camera_ipp_mem_0",MEM_CAMIPP_SIZE_CIF_0);\r
+ rk_camera_platform_data.meminfo.size= MEM_CAMIPP_SIZE_CIF_0;\r
+ #endif\r
+#endif\r
+\r
+#if (MEM_CAMIPP_SIZE_CIF_1 != 0)\r
+ #if CONFIG_USE_CIF_1\r
+ rk_camera_platform_data.meminfo_cif1.name = "camera_ipp_mem_1";\r
+ rk_camera_platform_data.meminfo_cif1.start =board_mem_reserve_add("camera_ipp_mem_1",MEM_CAMIPP_SIZE_CIF_1);\r
+ rk_camera_platform_data.meminfo_cif1.size= MEM_CAMIPP_SIZE_CIF_1;\r
+ #endif\r
+#endif\r
\r
-static void rk_register_camera_devices(void)\r
+#if (PMEM_CAM_SIZE != 0)\r
+ android_pmem_cam_pdata.start = board_mem_reserve_add("camera_pmem",PMEM_CAM_SIZE);\r
+ android_pmem_cam_pdata.size = PMEM_CAM_SIZE;\r
+#endif\r
+}\r
+static int rk_register_camera_devices(void)\r
{\r
rk_init_camera_plateform_data();\r
#if CONFIG_USE_CIF_0\r
platform_device_register(&rk_soc_camera_pdrv_1);\r
if(((struct android_pmem_platform_data*)(android_pmem_cam_device.dev.platform_data))->size)\r
platform_device_register(&android_pmem_cam_device);\r
+ return 0;\r
}\r
+\r
module_init(rk_register_camera_devices);\r
#endif\r
\r