\r
static int rk_sensor_iomux(int pin)\r
{ \r
+ iomux_set_gpio_mode(pin);\r
return 0;\r
}\r
#define PMEM_CAM_BASE 0 //just for compile ,no meaning\r
\r
\r
static u64 rockchip_device_camera_dmamask = 0xffffffffUL;\r
+#if RK_SUPPORT_CIF0\r
static struct resource rk_camera_resource_host_0[] = {\r
[0] = {\r
.start = RK2928_CIF_PHYS,\r
.flags = IORESOURCE_IRQ,\r
}\r
};\r
+#endif\r
+#if RK_SUPPORT_CIF1\r
static struct resource rk_camera_resource_host_1[] = {\r
[0] = {\r
.start = RK2928_CIF_PHYS,\r
.flags = IORESOURCE_IRQ,\r
}\r
};\r
+#endif\r
+\r
/*platform_device : */\r
+#if RK_SUPPORT_CIF0\r
struct platform_device rk_device_camera_host_0 = {\r
.name = RK29_CAM_DRV_NAME,\r
.id = RK_CAM_PLATFORM_DEV_ID_0, /* This is used to put cameras on this interface */\r
.platform_data = &rk_camera_platform_data,\r
}\r
};\r
+#endif\r
+\r
+#if RK_SUPPORT_CIF1\r
/*platform_device : */\r
struct platform_device rk_device_camera_host_1 = {\r
.name = RK29_CAM_DRV_NAME,\r
.platform_data = &rk_camera_platform_data,\r
}\r
};\r
+#endif\r
\r
static void rk_init_camera_plateform_data(void)\r
{\r
\r
static void rk30_camera_request_reserve_mem(void)\r
{\r
+ int i,max_resolution;\r
+ int cam_ipp_mem=PMEM_CAMIPP_NECESSARY, cam_pmem=PMEM_CAM_NECESSARY;\r
+\r
+ i =0;\r
+ max_resolution = 0x00;\r
+ while (strstr(new_camera[i].dev.device_info.dev.init_name,"end")==NULL) {\r
+ if (new_camera[i].resolution > max_resolution)\r
+ max_resolution = new_camera[i].resolution;\r
+ i++;\r
+ }\r
+\r
+ if (max_resolution < PMEM_SENSOR_FULL_RESOLUTION_CIF_1)\r
+ max_resolution = PMEM_SENSOR_FULL_RESOLUTION_CIF_1;\r
+ if (max_resolution < PMEM_SENSOR_FULL_RESOLUTION_CIF_0)\r
+ max_resolution = PMEM_SENSOR_FULL_RESOLUTION_CIF_0;\r
+\r
+ switch (max_resolution)\r
+ {\r
+ case 0x800000:\r
+ default:\r
+ {\r
+ cam_ipp_mem = 0x800000;\r
+ cam_pmem = 0x1900000;\r
+ break;\r
+ }\r
+\r
+ case 0x500000:\r
+ {\r
+ cam_ipp_mem = 0x800000;\r
+ cam_pmem = 0x1400000;\r
+ break;\r
+ }\r
+\r
+ case 0x300000:\r
+ {\r
+ cam_ipp_mem = 0x600000;\r
+ cam_pmem = 0xf00000;\r
+ break;\r
+ }\r
+\r
+ case 0x200000:\r
+ {\r
+ cam_ipp_mem = 0x600000;\r
+ cam_pmem = 0xc00000;\r
+ break;\r
+ }\r
+\r
+ case 0x100000:\r
+ {\r
+ cam_ipp_mem = 0x600000;\r
+ cam_pmem = 0xa00000;\r
+ break;\r
+ }\r
+\r
+ case 0x30000:\r
+ {\r
+ cam_ipp_mem = 0x600000;\r
+ cam_pmem = 0x600000;\r
+ break;\r
+ }\r
+ }\r
+\r
+ \r
+\r
#ifdef CONFIG_VIDEO_RK29_WORK_IPP\r
- #ifdef CONFIG_VIDEO_RKCIF_WORK_SIMUL_OFF\r
+ rk_camera_platform_data.meminfo.vbase = rk_camera_platform_data.meminfo_cif1.vbase = NULL;\r
+ #if defined(CONFIG_VIDEO_RKCIF_WORK_SIMUL_OFF) || ((RK_SUPPORT_CIF0 && RK_SUPPORT_CIF1) == 0)\r
rk_camera_platform_data.meminfo.name = "camera_ipp_mem";\r
- rk_camera_platform_data.meminfo.start = board_mem_reserve_add("camera_ipp_mem",PMEM_CAMIPP_NECESSARY);\r
- rk_camera_platform_data.meminfo.size= PMEM_CAMIPP_NECESSARY;\r
+ rk_camera_platform_data.meminfo.start = board_mem_reserve_add("camera_ipp_mem",cam_ipp_mem);\r
+ rk_camera_platform_data.meminfo.size= cam_ipp_mem;\r
\r
memcpy(&rk_camera_platform_data.meminfo_cif1,&rk_camera_platform_data.meminfo,sizeof(struct rk29camera_mem_res));\r
#else\r
#endif\r
#endif\r
#if PMEM_CAM_NECESSARY\r
- android_pmem_cam_pdata.start = board_mem_reserve_add((char*)(android_pmem_cam_pdata.name),PMEM_CAM_NECESSARY);\r
- android_pmem_cam_pdata.size= PMEM_CAM_NECESSARY;\r
+ android_pmem_cam_pdata.start = board_mem_reserve_add((char*)(android_pmem_cam_pdata.name),cam_pmem);\r
+ android_pmem_cam_pdata.size= cam_pmem;\r
#endif\r
\r
}\r
{\r
int i;\r
int host_registered_0,host_registered_1;\r
+ struct rkcamera_platform_data *new_camera;\r
\r
rk_init_camera_plateform_data();\r
\r
for (i=0; i<RK_CAM_NUM; i++) {\r
if (rk_camera_platform_data.register_dev[i].device_info.name) {\r
if (rk_camera_platform_data.register_dev[i].link_info.bus_id == RK_CAM_PLATFORM_DEV_ID_0) {\r
- if (!host_registered_0) {\r
- platform_device_register(&rk_device_camera_host_0);\r
- host_registered_0 = 1;\r
- }\r
- } else if (rk_camera_platform_data.register_dev[i].link_info.bus_id == RK_CAM_PLATFORM_DEV_ID_1) {\r
- if (!host_registered_1) {\r
- platform_device_register(&rk_device_camera_host_1);\r
- host_registered_1 = 1;\r
- }\r
+ #if RK_SUPPORT_CIF0 \r
+ host_registered_0 = 1;\r
+ #else\r
+ printk(KERN_ERR "%s(%d) : This chip isn't support CIF0, Please user check ...\n",__FUNCTION__,__LINE__);\r
+ #endif\r
+ } \r
+\r
+ if (rk_camera_platform_data.register_dev[i].link_info.bus_id == RK_CAM_PLATFORM_DEV_ID_1) {\r
+ #if RK_SUPPORT_CIF1\r
+ host_registered_1 = 1;\r
+ #else\r
+ printk(KERN_ERR "%s(%d) : This chip isn't support CIF1, Please user check ...\n",__FUNCTION__,__LINE__);\r
+ #endif\r
} \r
}\r
}\r
\r
+ \r
+ i=0;\r
+ new_camera = rk_camera_platform_data.register_dev_new;\r
+ if (new_camera != NULL) {\r
+ while (strstr(new_camera->dev.device_info.dev.init_name,"end")==NULL) {\r
+ if (new_camera->dev.link_info.bus_id == RK_CAM_PLATFORM_DEV_ID_1) {\r
+ host_registered_1 = 1;\r
+ } else if (new_camera->dev.link_info.bus_id == RK_CAM_PLATFORM_DEV_ID_0) {\r
+ host_registered_0 = 1;\r
+ }\r
+ new_camera++;\r
+ }\r
+ }\r
+ #if RK_SUPPORT_CIF0\r
+ if (host_registered_0) {\r
+ platform_device_register(&rk_device_camera_host_0);\r
+ }\r
+ #endif\r
+ #if RK_SUPPORT_CIF1\r
+ if (host_registered_1) {\r
+ platform_device_register(&rk_device_camera_host_1);\r
+ } \r
+ #endif\r
+\r
for (i=0; i<RK_CAM_NUM; i++) {\r
if (rk_camera_platform_data.register_dev[i].device_info.name) {\r
platform_device_register(&rk_camera_platform_data.register_dev[i].device_info);\r
}\r
}\r
+\r
+ if (rk_camera_platform_data.sensor_register)\r
+ (rk_camera_platform_data.sensor_register)(); \r
+ \r
#if PMEM_CAM_NECESSARY\r
platform_device_register(&android_pmem_cam_device);\r
#endif\r