static int as0260_sensor_set_effect(struct msm_sensor_ctrl_t *s_ctrl ,int8_t effect) { int rc = 0; SKYCDBG("%s effect=%d start \n",__func__,effect); //SKYCDBG #if 0 if(effect < CAMERA_EFFECT_OFF || effect >= CAMERA_EFFECT_MAX){ SKYCERR("%s error. effect=%d\n", __func__, effect); //SKYCERR return -EINVAL; } #endif rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->effect_cfg_settings[effect], s_ctrl->msm_sensor_reg->effect_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); if (rc < 0) { SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR return rc; } SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG return rc; }
static int as0260_sensor_set_wb(struct msm_sensor_ctrl_t *s_ctrl ,int8_t wb) { int rc = 0; SKYCDBG("%s wb=%d start \n",__func__,wb); //SKYCDBG if(wb < 0 || wb > 6){ SKYCERR("%s error. wb=%d\n", __func__, wb); //SKYCERR return -EINVAL; } rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->wb_cfg_settings[wb], s_ctrl->msm_sensor_reg->wb_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); if (rc < 0) { SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR return rc; } SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG return rc; }
static int as0260_sensor_set_reflect(struct msm_sensor_ctrl_t *s_ctrl ,int8_t reflect) { int rc = 0; SKYCDBG("%s reflect=%d start \n",__func__,reflect); //SKYCDBG if(reflect < 0 || reflect > 3){ SKYCERR("%s error. reflect=%d\n", __func__, reflect); //SKYCERR return -EINVAL; } rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->reflect_cfg_settings[reflect], s_ctrl->msm_sensor_reg->reflect_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); if (rc < 0) { SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR return rc; } SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG return rc; }
static int icp_hd_reset(int set) { int rc = 0; rc = gpio_tlmm_config(GPIO_CFG(SENSOR_RESET_8M, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),GPIO_CFG_ENABLE); if (!rc) { SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); gpio_set_value(SENSOR_RESET_8M,0); if(set){ gpio_set_value(SENSOR_RESET_8M,1); } } else{ SKYCERR("icp_hd_reset gpio_tlmm_config Failed!\n"); goto reset_fail; } SKYCDBG("%s %s Success:%d\n", __FILE__, __func__, __LINE__); return rc; reset_fail: SKYCERR("%s %s Failed!:%d\n", __FILE__, __func__, __LINE__); return rc; }
static int as0260_sensor_set_preview_fps(struct msm_sensor_ctrl_t *s_ctrl ,int8_t preview_fps) { int rc = 0; SKYCDBG("%s preview_fps=%d start \n",__func__,preview_fps); //SKYCDBG if(preview_fps < 5 || preview_fps > 31){ SKYCERR("%s error. preview_fps=%d\n", __func__, preview_fps); //SKYCERR return -EINVAL; } rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[preview_fps-5], s_ctrl->msm_sensor_reg->preview_fps_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); if (rc < 0) { SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR return rc; } SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG return rc; }
static int as0260_sensor_set_exposure_mode(struct msm_sensor_ctrl_t *s_ctrl ,int8_t exposure) { int rc = 0; SKYCDBG("%s exposure=%d start \n",__func__,exposure); //SKYCDBG if(exposure < 0 || exposure > 3){ SKYCERR("%s error. exposure=%d\n", __func__, exposure); //SKYCERR return -EINVAL; } rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->exposure_mode_cfg_settings[exposure], s_ctrl->msm_sensor_reg->exposure_mode_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); if (rc < 0) { SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR return rc; } SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG return rc; }
static int as0260_sensor_set_brightness(struct msm_sensor_ctrl_t * s_ctrl,int8_t brightness) { int rc = 0; SKYCDBG("%s brightness=%d start \n",__func__,brightness); //SKYCDBG if(brightness < 0 || brightness > 8){ SKYCERR("%s error. brightness=%d\n", __func__, brightness); //SKYCERR return -EINVAL; } rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->bright_cfg_settings[brightness], s_ctrl->msm_sensor_reg->bright_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); if (rc < 0) { SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR return rc; } SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG return rc; }
static int yacd5c1sbdbc_sensor_set_preview_fps(struct msm_sensor_ctrl_t *s_ctrl ,int8_t preview_fps) { int rc = 0; CDBG("%s preview_fps=%d start \n",__func__,preview_fps); if(preview_fps < 5 || preview_fps > 31){ SKYCERR("%s error. preview_fps=%d\n", __func__, preview_fps); return -EINVAL; } g_preview_fps = preview_fps; //if (preview_fps > 30) preview_fps = 30; #if 1//CONFIG_PANTECH_CAMERA_YACD5C1SBDBC for VTS if(preview_fps == 24) { preview_24fps_for_motion_detect_check = 1; }else{ rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[preview_fps-5], //original //s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[10], //temporary s_ctrl->msm_sensor_reg->preview_fps_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); } #else rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[preview_fps], s_ctrl->msm_sensor_reg->preview_fps_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); }
static int s5k6aafx13_vreg_init(void) { int rc; SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); mvs0b_1p8v = regulator_get(NULL, "8901_mvs0"); if (IS_ERR(mvs0b_1p8v)) { SKYCERR("regulator_get mvs0b_1p8v fail\n" );; return -ENODEV; } #if 0 lvs2b_1p8v = regulator_get(NULL, "8901_lvs2"); if (IS_ERR(lvs2b_1p8v)) { SKYCERR("regulator_get lvs2b_1p8v fail\n" );; return -ENODEV; } #endif l9a_2p8v = regulator_get(NULL, "8058_l9"); if (IS_ERR(l9a_2p8v)) { SKYCERR("regulator_get l9a_2p8v fail\n" );; return -ENODEV; } rc = regulator_set_voltage(l9a_2p8v, 2800000, 2800000); if (rc) { SKYCERR("%s: unable to set l9a_2p8v voltage to 2.8V\n", __func__); goto fail; } l15a_1p5v = regulator_get(NULL, "8058_l15"); if (IS_ERR(l15a_1p5v)) { SKYCERR("regulator_get l15a_1p5v fail\n" );; return -ENODEV; } rc = regulator_set_voltage(l15a_1p5v, 1500000, 1500000); if (rc) { SKYCERR("%s: unable to set l15a_1p5v voltage to 1.5V\n", __func__); goto fail; } lvs1b_1p8v = regulator_get(NULL, "8901_lvs1"); if (IS_ERR(lvs1b_1p8v)) { SKYCERR("regulator_get lvs1b_1p8v fail\n" );; return -ENODEV; } SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); return rc; fail: SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); if(l15a_1p5v) { regulator_put(l15a_1p5v); } if(l9a_2p8v) { regulator_put(l9a_2p8v); } return rc; }
static int yacd5c1sbdbc_sensor_set_tuner(struct tuner_cfg tuner) { //si2c_cmd_t *cmds = NULL; msm_camera_i2c_reg_tune_t *cmds = NULL; char *fbuf = NULL; SKYCDBG("%s fbuf=%p, fsize=%d\n", __func__, tuner.fbuf, tuner.fsize); if (!tuner.fbuf || (tuner.fsize == 0)) { SKYCERR("%s err(-EINVAL)\n", __func__); return -EINVAL; } fbuf = (char *)kmalloc(tuner.fsize, GFP_KERNEL); if (!fbuf) { SKYCERR("%s err(-ENOMEM)\n", __func__); return -ENOMEM; } if (copy_from_user(fbuf, tuner.fbuf, tuner.fsize)) { SKYCERR("%s err(-EFAULT)\n", __func__); kfree(fbuf); return -EFAULT; } cmds = ptune_parse("@init", fbuf); if (!cmds) { SKYCERR("%s no @init\n", __func__); kfree(fbuf); return -EFAULT; } yacd5c1sbdbc_recommend_tuner_settings = cmds;//(struct msm_camera_i2c_reg_conf *)cmds; kfree(fbuf); SKYCDBG("%s X\n", __func__); return 0; }
static int as0260_vreg_init(void) { int rc = 0; SKYCDBG("%s:%d\n", __func__, __LINE__); rc = sgpio_init(sgpios, CAMIO_MAX); if (rc < 0) { SKYCERR("%s: sgpio_init failed \n", __func__); goto sensor_init_fail; } rc = svreg_init(svregs, CAMV_MAX); if (rc < 0) { SKYCERR("%s: svreg_init failed \n", __func__); goto sensor_init_fail; } return rc; sensor_init_fail: return -ENODEV; }
static int s5k6aafx13_reset(int set) { int rc = 0; //reset rc = gpio_tlmm_config(GPIO_CFG(SENSOR_RESET, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),GPIO_CFG_ENABLE); if (!rc) { SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); gpio_set_value(SENSOR_RESET,0); if(set){ mdelay(20); gpio_set_value(SENSOR_RESET,1); } } else{ SKYCERR("ce1612_reset gpio_tlmm_config Failed!\n"); goto reset_fail; } //standby rc = gpio_tlmm_config(GPIO_CFG(SENSOR_STANDBY, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),GPIO_CFG_ENABLE); if (!rc) { SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); gpio_set_value(SENSOR_STANDBY,set); mdelay(20); } SKYCDBG("%s %s Success:%d\n", __FILE__, __func__, __LINE__); return rc; reset_fail: SKYCERR("%s %s Failed!:%d\n", __FILE__, __func__, __LINE__); return rc; }
int mt9v113_snapshot_config(void) { int rc = 0; CDBG("%s E\n", __func__); rc = si2c_write_param(SI2C_SA, SI2C_SNAPSHOT, mt9v113_params); if (rc < 0) { SKYCERR("%s err(%d)\n", __func__, rc); return rc; } //sensor_mode = SENSOR_SNAPSHOT_MODE; CDBG("%s X\n", __func__); return 0; }
int mt9v113_video_config(void) { int rc = 0; CDBG("%s E\n", __func__); rc = si2c_write_param(SI2C_SA, SI2C_PREVIEW, mt9v113_params); if (rc < 0) { SKYCERR("%s video config err(%d)\n", __func__, rc); return rc; } //sensor_mode = SENSOR_PREVIEW_MODE; CDBG("%s X\n", __func__); return 0; }
static int icp_hd_vreg_init(void) { int rc = 0; SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); s2b_1p2v_8m = regulator_get(NULL, "8901_s2"); if (IS_ERR(s2b_1p2v_8m)) { SKYCERR("regulator_get s2b_1p2v fail : 0x%x\n", (unsigned int)s2b_1p2v_8m); return -ENODEV; } rc = regulator_set_voltage(s2b_1p2v_8m, 1300000, 1300000); if (rc) { SKYCERR("%s: unable to set s2b_1p2v voltage to 1.2V\n", __func__); goto fail; } mvs0b_1p8v = regulator_get(NULL, "8901_mvs0"); if (IS_ERR(mvs0b_1p8v)) { SKYCERR("regulator_get mvs0b_1p8v : 0x%x fail\n", (unsigned int)mvs0b_1p8v); return -ENODEV; } lvs3b_1p8v_8m = regulator_get(NULL, "8901_lvs3"); if (IS_ERR(lvs3b_1p8v_8m)) { SKYCERR("regulator_get lvs3b_1p8v : 0x%x fail\n", (unsigned int)lvs3b_1p8v_8m); return -ENODEV; } l20a_2p8v_8m = regulator_get(NULL, "8058_l20"); if (IS_ERR(l20a_2p8v_8m)) { SKYCERR("regulator_get l20a_2p8v : 0x%x fail\n", (unsigned int)l20a_2p8v_8m); return -ENODEV; } rc = regulator_set_voltage(l20a_2p8v_8m, 2800000, 2800000); if (rc) { SKYCERR("%s: unable to set l20a_2p8v voltage to 2.8V\n", __func__); goto fail; } l14a_2p8v_8m = regulator_get(NULL, "8058_l14"); if (IS_ERR(l14a_2p8v_8m)) { SKYCERR("regulator_get l14a_2p8v : 0x%x fail\n", (unsigned int)l14a_2p8v_8m); return -ENODEV; } #if (BOARD_REV >= WS10) rc = regulator_set_voltage(l14a_2p8v_8m, 2800000, 2800000); #else // for SD card rc = regulator_set_voltage(l14a_2p8v_8m, 2850000, 2850000); #endif if (rc) { SKYCERR("%s: unable to set l14a_2p8v voltage to 2.8V\n", __func__); goto fail; } SKYCDBG("%s %s Success!:%d\n", __FILE__, __func__, __LINE__); return rc; fail: SKYCDBG("%s %s Failed!:%d\n", __FILE__, __func__, __LINE__); if(l20a_2p8v_8m) { regulator_put(l20a_2p8v_8m); } if(s2b_1p2v_8m) { regulator_put(s2b_1p2v_8m); } if(l14a_2p8v_8m) { regulator_put(l14a_2p8v_8m); } return rc; }
int32_t as0260_sensor_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { int rc = 0; struct msm_sensor_ctrl_t *s_ctrl; SKYCDBG("%s_i2c_probe called\n", client->name); if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { SKYCERR("i2c_check_functionality failed\n"); //rc = -EFAULT; return rc; //goto probe_fail; } s_ctrl = (struct msm_sensor_ctrl_t *)(id->driver_data); if (s_ctrl->sensor_i2c_client != NULL) { s_ctrl->sensor_i2c_client->client = client; if (s_ctrl->sensor_i2c_addr != 0) s_ctrl->sensor_i2c_client->client->addr = s_ctrl->sensor_i2c_addr; } else { rc = -EFAULT; //return rc; goto probe_fail; } s_ctrl->sensordata = client->dev.platform_data; if (s_ctrl->sensordata == NULL) { SKYCERR("%s %s NULL sensor data\n", __func__, client->name); rc = -EFAULT; goto probe_fail; } //We need to change gpio number for using pmic gpio as0260_trans_gpio_pm_to_sys(&sgpios[0], s_ctrl, CAMIO_PM_MAX); rc = s_ctrl->func_tbl->sensor_power_up(s_ctrl); if (rc < 0) { SKYCERR("%s %s power up failed\n", __func__, client->name); //return rc; rc = -EFAULT; goto probe_fail; } if (s_ctrl->func_tbl->sensor_match_id) rc = s_ctrl->func_tbl->sensor_match_id(s_ctrl); else rc = msm_sensor_match_id(s_ctrl); if (rc < 0) goto probe_fail; snprintf(s_ctrl->sensor_v4l2_subdev.name, sizeof(s_ctrl->sensor_v4l2_subdev.name), "%s", id->name); v4l2_i2c_subdev_init(&s_ctrl->sensor_v4l2_subdev, client, s_ctrl->sensor_v4l2_subdev_ops); msm_sensor_register(&s_ctrl->sensor_v4l2_subdev); goto i2c_probe_end; probe_fail: printk(KERN_ERR "%s:%s failed\n", __func__, client->name); i2c_probe_end: if (rc > 0) rc = 0; s_ctrl->func_tbl->sensor_power_down(s_ctrl); printk(KERN_INFO "%s:%s success\n",__func__, client->name); return rc; }
static int s5k6aafx13_power(int on) { int rc = 0; SKYCDBG("%s:%d power = %d\n", __func__, __LINE__,on); if(on) { rc = regulator_enable(mvs0b_1p8v); if (rc) { SKYCERR("%s: Enable regulator mvs0b_1p8v failed\n", __func__); goto fail; } mdelay(1); rc = regulator_enable(l19a_2p8v); if (rc) { SKYCERR("%s: Enable regulator l19a_2p8v failed\n", __func__); goto fail; } mdelay(1); rc = regulator_enable(s2b_1p5v); if (rc) { SKYCERR("%s: Enable regulator s2b_1p5v failed\n", __func__); goto fail; } mdelay(1); #if 0 rc = regulator_enable(lvs1b_1p8v); if (rc) { SKYCERR("%s: Enable regulator lvs1b_1p8v failed\n", __func__); goto fail; } msleep(1); #endif } else { rc = regulator_disable(mvs0b_1p8v); if (rc) SKYCERR("%s: Disable regulator mvs0b_1p8v failed\n", __func__); #if 0 rc = regulator_disable(lvs1b_1p8v); if (rc) SKYCERR("%s: Disable regulator lvs1b_1p8v failed\n", __func__); #endif rc = regulator_disable(s2b_1p5v); if (rc) SKYCDBG("%s: Disable regulator s2b_1p5v failed\n", __func__); regulator_put(s2b_1p5v); rc = regulator_disable(l19a_2p8v); if (rc) SKYCERR("%s: Disable regulator l19a_2p8v failed\n", __func__); regulator_put(l19a_2p8v); } SKYCDBG("%s:%d\n", __func__, __LINE__); return rc; fail: SKYCDBG("%s:%d\n", __func__, __LINE__); if(l19a_2p8v) regulator_put(l19a_2p8v); if(s2b_1p5v) regulator_put(s2b_1p5v); return rc; }
/* msm_sensor_setting */ int32_t yacd5c1sbdbc_sensor_setting(struct msm_sensor_ctrl_t *s_ctrl, int update_type, int res) { int32_t rc = 0; v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev, NOTIFY_ISPIF_STREAM, (void *)ISPIF_STREAM( PIX_0, ISPIF_OFF_IMMEDIATELY)); SKYCDBG("%s:[F_PANTECH_CAMERA] %d, %d res=%d\n", __func__, __LINE__,update_type,res); if (s_ctrl->func_tbl->sensor_stop_stream) s_ctrl->func_tbl->sensor_stop_stream(s_ctrl); msleep(30); if (update_type == MSM_SENSOR_REG_INIT) { s_ctrl->curr_csi_params = NULL; g_preview_fps= 0; msm_sensor_enable_debugfs(s_ctrl); #ifdef CONFIG_PANTECH_CAMERA_TUNER SKYCDBG("[CONFIG_PANTECH_CAMERA_TUNER]%s PASS init_setting\n ",__func__); tuner_init_check = 1; #else yacd5c1sbdbc_sensor_write_init_settings(s_ctrl); #endif } else if (update_type == MSM_SENSOR_UPDATE_PERIODIC) { #ifdef CONFIG_PANTECH_CAMERA_TUNER if (tuner_init_check == 1) { SKYCDBG("[CONFIG_PANTECH_CAMERA_TUNER]%s init_setting\n ",__func__); yacd5c1sbdbc_sensor_write_init_settings(s_ctrl); tuner_init_check = 0; } SKYCDBG("[CONFIG_PANTECH_CAMERA_TUNER]%s res=%d res_setting\n ",__func__,res); yacd5c1sbdbc_sensor_write_res_settings(s_ctrl, res); #else yacd5c1sbdbc_sensor_write_res_settings(s_ctrl, res); #endif #ifdef CONFIG_PANTECH_CAMERA_YACD5C1SBDBC// for VTS //if (strcmp(s_ctrl->sensordata->sensor_name, "yacd5c1sbdbc")) if((s_ctrl->sensor_id_info->sensor_id == YACD5C1SBDBC_ID) && (preview_24fps_for_motion_detect_check == 1)){ //printk("[CONFIG_PANTECH_CAMERA for VTS] msleep(133)==>\n"); //msleep(133); SKYCDBG("[CONFIG_PANTECH_CAMERA for VTS]preview_24fps_for_motion_detect_cfg_settings\n "); rc = msm_camera_i2c_write_tbl( s_ctrl->sensor_i2c_client, s_ctrl->msm_sensor_reg->preview_24fps_for_motion_detect_cfg_settings[0], s_ctrl->msm_sensor_reg->preview_24fps_for_motion_detect_cfg_settings_size, s_ctrl->msm_sensor_reg->default_data_type); preview_24fps_for_motion_detect_check = 0; if (rc < 0) { SKYCERR("ERR:%s 24fps FAIL!!! rc=%d \n", __func__, rc); return rc; } } #if 0// for camif err else { if(res==1) yacd5c1sbdbc_sensor_set_preview_fps(s_ctrl , g_preview_fps); } #endif #endif if (s_ctrl->curr_csi_params != s_ctrl->csi_params[res]) { SKYCDBG("%s:[F_PANTECH_CAMERA] ==> MIPI setting E %d\n", __func__, update_type); s_ctrl->curr_csi_params = s_ctrl->csi_params[res]; v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev, NOTIFY_CSID_CFG, &s_ctrl->curr_csi_params->csid_params); v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev, NOTIFY_CID_CHANGE, NULL); mb(); v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev, NOTIFY_CSIPHY_CFG, &s_ctrl->curr_csi_params->csiphy_params); mb(); msleep(20); SKYCDBG("%s:[F_PANTECH_CAMERA] ==> MIPI setting X %d\n", __func__, update_type); } v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev, NOTIFY_PCLK_CHANGE, &s_ctrl->msm_sensor_reg-> output_settings[res].op_pixel_clk); v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev, NOTIFY_ISPIF_STREAM, (void *)ISPIF_STREAM( PIX_0, ISPIF_ON_FRAME_BOUNDARY)); if (s_ctrl->func_tbl->sensor_start_stream) s_ctrl->func_tbl->sensor_start_stream(s_ctrl); #ifdef T_OSCAR msleep(300); //msleep(150); //msleep(30); #else msleep(200);//msleep(150); //msleep(30); #endif } SKYCDBG("%s: %d x\n", __func__, __LINE__); return rc; }
static int yacd5c1sbdbc_vreg_init(void) { int rc = 0; pr_err("%s:%d\n", __func__, __LINE__); rc = sgpio_init(sgpios, CAMIO_MAX); if (rc < 0) { SKYCERR("%s: sgpio_init failed \n", __func__); goto sensor_init_fail; } rc = svreg_init(svregs, CAMV_MAX); if (rc < 0) { SKYCERR("%s: svreg_init failed \n", __func__); goto sensor_init_fail; } return rc; #if 0 #if 0 if (vreg_l16_2p8 == NULL) { vreg_l16_2p8 = regulator_get(NULL, "8921_l16"); if (IS_ERR(vreg_l16_2p8)) { printk("%s: vreg_l16_2p8 get failed \n", __func__); vreg_l16_2p8 = NULL; return -ENODEV; } rc = regulator_set_voltage(vreg_l16_2p8, 2800000, 2800000); if (rc) { printk("%s: unable to set vreg_l16_2p8 voltage to 2.8V\n", __func__); goto fail; } } if (vreg_s4_1p8 == NULL) { vreg_s4_1p8 = regulator_get(NULL, "8921_s4"); if (IS_ERR(vreg_s4_1p8)) { printk("%s: vreg_s4_1p8 get failed \n", __func__); vreg_s4_1p8 = NULL; return -ENODEV; } rc = regulator_set_voltage(vreg_s4_1p8, 1800000, 1800000); if (rc) { printk("%s: unable to set vreg_s4_1p8 voltage to 1.8V\n", __func__); goto fail; } } #endif #if 1 //wsyang_temp for 2M if (vreg_lvs5_1p8 == NULL) { vreg_lvs5_1p8 = regulator_get(NULL, "8921_lvs5"); if (IS_ERR(vreg_lvs5_1p8)) { printk("%s: vreg_lvs5_1p8 get failed \n", __func__); vreg_lvs5_1p8 = NULL; return -ENODEV; } // rc = regulator_set_voltage(vreg_lvs5_1p8, 1800000, 1800000); // if (rc) { // SKYCERR("%s: unable to set vreg_lvs5_1p8 voltage to 1.8V\n", __func__); // goto fail; // } } if (vreg_lvs6_1p8 == NULL) { vreg_lvs6_1p8 = regulator_get(NULL, "8921_lvs6"); if (IS_ERR(vreg_lvs6_1p8)) { printk("%s: vreg_lvs6_1p8 get failed \n", __func__); vreg_lvs6_1p8 = NULL; return -ENODEV; } // rc = regulator_set_voltage(vreg_lvs6_1p8, 1800000, 1800000); // if (rc) { // printk("%s: unable to set vreg_lvs6_1p8 voltage to 1.8V\n", __func__); // goto fail; // } } if (vreg_l11_2p85 == NULL) { vreg_l11_2p85 = regulator_get(NULL, "8921_l11"); if (IS_ERR(vreg_l11_2p85)) { printk("%s: vreg_l11_2p85 get failed \n", __func__); vreg_l11_2p85 = NULL; return -ENODEV; } rc = regulator_set_voltage(vreg_l11_2p85, 2800000, 2800000); // rc = regulator_set_voltage(vreg_l11_2p85, 2850000, 2850000); if (rc) { printk("%s: unable to set vreg_l11_2p85 voltage to 2.8V\n", __func__); goto fail; } } #endif //wsyang_temp for 2M return rc; fail: printk("%s Failed!:%d\n",__func__, __LINE__); #if 0 if(vreg_l16_2p8) { regulator_put(vreg_l16_2p8); } if(vreg_s4_1p8) { regulator_put(vreg_s4_1p8); } #endif if(vreg_lvs6_1p8) { regulator_put(vreg_lvs6_1p8); } if(vreg_l11_2p85) { regulator_put(vreg_l11_2p85); } if(vreg_lvs5_1p8) { regulator_put(vreg_lvs5_1p8); } #endif sensor_init_fail: return -ENODEV; }
static int icp_hd_power(int on) { int rc = 0; SKYCDBG("%s %s:%d power = %d\n", __FILE__, __func__, __LINE__,on); if(on) { //standby control rc = gpio_tlmm_config(GPIO_CFG(SENSOR_STANDBY_8M, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),GPIO_CFG_ENABLE); if (!rc) { SKYCDBG("%s %s:%d\n", __FILE__, __func__, __LINE__); gpio_set_value(SENSOR_STANDBY_8M,0); } rc = regulator_enable(s2b_1p2v_8m); if (rc) { SKYCERR("%s: Enable regulator s2b_1p2v failed\n", __func__); goto fail; } msleep(1); rc = regulator_enable(lvs3b_1p8v_8m); if (rc) { SKYCERR("%s: Enable regulator mvs0b_1p8v failed\n", __func__); goto fail; } msleep(1); rc = regulator_enable(mvs0b_1p8v); if (rc) { SKYCERR("%s: Enable regulator mvs0b_1p8v failed\n", __func__); goto fail; } msleep(1); rc = regulator_enable(l20a_2p8v_8m); if (rc) { SKYCERR("%s: Enable regulator l20a_2p8v failed\n", __func__); goto fail; } msleep(1); rc = regulator_enable(l14a_2p8v_8m); if (rc) { SKYCERR("%s: Enable regulator l14a_2p8v failed\n", __func__); goto fail; } SKYCDBG("%s %s ON Success:%d\n", __FILE__, __func__, __LINE__); } else { SKYCDBG("%s %s:%d power \n", __FILE__, __func__, __LINE__); #if 0 if(1)//s2b_1p2v) { rc = regulator_disable(s2b_1p2v_8m); if (rc){ SKYCERR("%s: Disable regulator s2b_1p2v failed\n", __func__); goto fail; } regulator_put(s2b_1p2v_8m); } if(mvs0b_1p8v) { rc = regulator_disable(mvs0b_1p8v); if (rc){ SKYCERR("%s: Disable regulator mvs0b_1p8v failed\n", __func__); goto fail; } } #endif SKYCDBG("%s %s:%d power \n", __FILE__, __func__, __LINE__); if(1)//mvs0b_1p8v) { rc = regulator_disable(lvs3b_1p8v_8m); if (rc){ SKYCERR("%s: Disable regulator lvs3b_1p8v failed\n", __func__); goto fail; } } SKYCDBG("%s %s:%d power \n", __FILE__, __func__, __LINE__); if(1)//l20a_2p8v) { rc = regulator_disable(l20a_2p8v_8m); if (rc){ SKYCERR("%s: Disable regulator l20a_2p8v failed\n", __func__); goto fail; } regulator_put(l20a_2p8v_8m); } SKYCDBG("%s %s:%d power \n", __FILE__, __func__, __LINE__); if(1)//l14a_2p8v) { rc = regulator_disable(l14a_2p8v_8m); if (rc){ SKYCERR("%s: Disable regulator l14a_2p8v failed\n", __func__); goto fail; } regulator_put(l14a_2p8v_8m); } SKYCDBG("%s %s OFF Success:%d\n", __FILE__, __func__, __LINE__); } return rc; fail: SKYCERR("%s %s Failed!:%d\n", __FILE__, __func__, __LINE__); if(l20a_2p8v_8m){ regulator_put(l20a_2p8v_8m); } if(s2b_1p2v_8m){ regulator_put(s2b_1p2v_8m); } if(l14a_2p8v_8m){ regulator_put(l14a_2p8v_8m); } return rc; }