int sr130pc10_sensor_init(const struct msm_camera_sensor_info *data) { int rc = 0; printk(KERN_DEBUG "[SR130PC10] %s/%d\n", __func__, __LINE__); #ifdef CONFIG_LOAD_FILE if (0 > sr130pc10_regs_table_init()) { CDBG("%s file open failed!\n", __func__); rc = -1; goto init_fail; } #endif sr130pc10_ctrl = kzalloc(sizeof(struct sr130pc10_ctrl_t), GFP_KERNEL); if (!sr130pc10_ctrl) { printk(KERN_DEBUG "[SR130PC10]sr130pc10_init failed!\n"); rc = -ENOMEM; goto init_done; } if (data) sr130pc10_ctrl->sensordata = data; rc = cam_hw_init(); if (rc < 0) { printk(KERN_DEBUG "[SR130PC10]<=PCAM=> cam_hw_init failed!\n"); goto init_fail; } rc = sr130pc10_sensor_init_probe(data); if (rc < 0) { printk(KERN_DEBUG "[SR130PC10]sr130pc10_sensor_init failed!\n"); goto init_fail; } printk(KERN_DEBUG "[SR130PC10] %s/%d\n", __func__, __LINE__); init_done: return rc; init_fail: kfree(sr130pc10_ctrl); return rc; }
int sr030pc30_sensor_init(const struct msm_camera_sensor_info *data) { int rc = 0; pr_info("[sr030pc30] %s/%d\n", __func__, __LINE__); #ifdef CONFIG_LOAD_FILE sr030pc30_regs_table_init(); #endif sr030pc30_ctrl = kzalloc(sizeof(struct sr030pc30_ctrl_t), GFP_KERNEL); if (!sr030pc30_ctrl) { CDBG("sr030pc30_init failed!\n"); rc = -ENOMEM; goto init_done; } if (data) sr030pc30_ctrl->sensordata = data; rc = cam_hw_init(); if (rc < 0) { pr_info("[sr030pc30] cam_hw_init failed!\n"); goto init_fail; } rc = sr030pc30_sensor_init_probe(data); if (rc < 0) { CDBG("sr030pc30_sensor_init failed!\n"); goto init_fail; } pr_info("[sr030pc30] 3333333 %s/%d\n", __func__, __LINE__); init_done: return rc; init_fail: kfree(sr030pc30_ctrl); return rc; }