static int ville_s5k3h2yx_vreg_on(void) { int rc = 0; pr_info("%s\n", __func__); #if 0 /* VCM */ rc = camera_sensor_power_enable("8921_l9", 2800000, ®_8921_l9); if (rc < 0) { pr_err("sensor_power_enable(\"8921_l9\", 2.85V) FAILED %d\n", rc); goto enable_vcm_fail; } /* redundant setting...enable at rawchip */ /* IO */ rc = camera_sensor_power_enable("8921_lvs6", 1800000, ®_8921_lvs6); if (rc < 0) { pr_err("sensor_power_enable(\"8921_lvs6\", 1.8V) FAILED %d\n", rc); goto enable_io_fail; } /* analog */ rc = camera_sensor_power_enable("8921_l8", 2800000, ®_8921_l8); if (rc < 0) { pr_err("sensor_power_enable(\"8921_l8\", 2.8V) FAILED %d\n", rc); goto enable_analog_fail; } udelay(50); /* redundant setting...enable at rawchip */ /* digital */ rc = gpio_request(VILLE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); if (rc < 0) { pr_err("sensor_power_enable(\"gpio %d\", 1.2V) FAILED %d\n", VILLE_GPIO_V_CAM_D1V2_EN, rc); goto enable_digital_fail; } gpio_direction_output(VILLE_GPIO_V_CAM_D1V2_EN, 1); gpio_free(VILLE_GPIO_V_CAM_D1V2_EN); rc = gpio_request(VILLE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, VILLE_GPIO_V_LCMIO_1V8_EN, rc); goto enable_digital_fail; } gpio_direction_output(VILLE_GPIO_V_LCMIO_1V8_EN, 1); gpio_free(VILLE_GPIO_V_LCMIO_1V8_EN); return rc; enable_digital_fail: camera_sensor_power_disable(reg_8921_l8); enable_analog_fail: camera_sensor_power_disable(reg_8921_lvs6); enable_io_fail: camera_sensor_power_disable(reg_8921_l9); enable_vcm_fail: #endif return rc; }
static int elite_s5k3h2yx_vreg_on(void) { int rc = 0; pr_info("%s\n", __func__); #if 0 rc = camera_sensor_power_enable("8921_l9", 2800000, ®_8921_l9); if (rc < 0) { pr_err("sensor_power_enable(\"8921_l9\", 2.85V) FAILED %d\n", rc); goto enable_vcm_fail; } rc = camera_sensor_power_enable("8921_lvs6", 1800000, ®_8921_lvs6); if (rc < 0) { pr_err("sensor_power_enable(\"8921_lvs6\", 1.8V) FAILED %d\n", rc); goto enable_io_fail; } rc = camera_sensor_power_enable("8921_l8", 2800000, ®_8921_l8); if (rc < 0) { pr_err("sensor_power_enable(\"8921_l8\", 2.8V) FAILED %d\n", rc); goto enable_analog_fail; } udelay(50); rc = gpio_request(ELITE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); if (rc < 0) { pr_err("sensor_power_enable(\"gpio %d\", 1.2V) FAILED %d\n", ELITE_GPIO_V_CAM_D1V2_EN, rc); goto enable_digital_fail; } gpio_direction_output(ELITE_GPIO_V_CAM_D1V2_EN, 1); gpio_free(ELITE_GPIO_V_CAM_D1V2_EN); rc = gpio_request(ELITE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, ELITE_GPIO_V_LCMIO_1V8_EN, rc); goto enable_digital_fail; } gpio_direction_output(ELITE_GPIO_V_LCMIO_1V8_EN, 1); gpio_free(ELITE_GPIO_V_LCMIO_1V8_EN); return rc; enable_digital_fail: camera_sensor_power_disable(reg_8921_l8); enable_analog_fail: camera_sensor_power_disable(reg_8921_lvs6); enable_io_fail: camera_sensor_power_disable(reg_8921_l9); enable_vcm_fail: #endif return rc; }
static int msm8930_ov5693_vreg_off(void) { int rc = 0; pr_info("%s\n", __func__); /* analog */ rc = camera_sensor_power_disable(reg_8038_l8); pr_info("sensor_power_disable(\"8038_l8\") == %d\n", rc); if (rc < 0) pr_err("sensor_power_disable\(\"8038_l8\") FAILED %d\n", rc); udelay(50); /* IO */ rc = gpio_request(CAM_PIN_GPIO_V_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("cam io gpio_request, %d\n", CAM_PIN_GPIO_V_CAMIO_1V8_EN); if (rc < 0) pr_err("GPIO(%d) request failed", CAM_PIN_GPIO_V_CAMIO_1V8_EN); else { gpio_direction_output(CAM_PIN_GPIO_V_CAMIO_1V8_EN, 0); gpio_free(CAM_PIN_GPIO_V_CAMIO_1V8_EN); } udelay(50); /* VCM */ if (reg_8038_l17 != NULL) regulator_set_optimum_mode(reg_8038_l17, 9000); rc = camera_sensor_power_disable(reg_8038_l17); pr_info("sensor_power_disable(\"8038_l17\") == %d\n", rc); if (rc < 0) pr_err("sensor_power_disable\(\"8038_l17\") FAILED %d\n", rc); return rc; }
static int ville_mt9v113_vreg_off(void) { int rc; pr_info("%s\n", __func__); /* Reset */ rc = gpio_request(VILLE_GPIO_CAM2_RSTz, "mt9v113"); if (rc < 0) { pr_err("%s:VILLE_GPIO_CAM2_RSTz gpio %d request failed, rc=%d\n", __func__, VILLE_GPIO_CAM2_RSTz, rc); goto init_fail; } gpio_direction_output(VILLE_GPIO_CAM2_RSTz, 0); msleep(2); gpio_free(VILLE_GPIO_CAM2_RSTz); udelay(50); /* disable clock here */ /* IO */ rc = gpio_request(VILLE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); pr_info("ville_mt9v113_vreg_off %d 1v8\n", VILLE_GPIO_V_LCMIO_1V8_EN); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, VILLE_GPIO_V_LCMIO_1V8_EN, rc); goto init_fail; } gpio_direction_output(VILLE_GPIO_V_LCMIO_1V8_EN, 0); gpio_free(VILLE_GPIO_V_LCMIO_1V8_EN); udelay(50); /* analog */ rc = camera_sensor_power_disable(reg_8921_l8); pr_info("camera_sensor_power_disable(\"8921_l8\", 2.8V) == %d\n", rc); if (rc < 0) goto init_fail; udelay(50); /* digital */ rc = camera_sensor_power_disable(reg_8921_lvs6); pr_info("camera_sensor_power_disable(\"8921_lvs6\", 1.8V) == %d\n", rc); if (rc < 0) goto init_fail; udelay(50); /* VCM */ rc = camera_sensor_power_disable(reg_8921_l9); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l9\") FAILED %d\n", rc); goto init_fail; } init_fail: return rc; }
static int msm8930_mt9v113_vreg_off(void) { int rc = 0; pr_info("%s\n", __func__); rc = gpio_request(MSM_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("cam io gpio_request, %d\n", MSM_CAMIO_1V8_EN); if (rc < 0) pr_err("GPIO(%d) request failed", MSM_CAMIO_1V8_EN); else { gpio_direction_output(MSM_CAMIO_1V8_EN, 0); gpio_free(MSM_CAMIO_1V8_EN); } udelay(50); pr_info("sensor_power_disable(\"8038_l8\") == %d\n", rc); rc = camera_sensor_power_disable(reg_8038_l8); if (rc < 0) pr_err("sensor_power_disable(\"reg_8038_l8\") FAILED %d\n", rc); udelay(50); rc = gpio_request(MSM_V_CAM_D1V8_EN, "V_CAM_D1V8_EN"); pr_info("digital gpio_request, %d\n", MSM_V_CAM_D1V8_EN); if (rc < 0) pr_err("GPIO(%d) request failed", MSM_V_CAM_D1V8_EN); else { gpio_direction_output(MSM_V_CAM_D1V8_EN, 0); gpio_free(MSM_V_CAM_D1V8_EN); } udelay(50); rc = gpio_request(MSM_CAM_VCM_PD, "CAM_VCM_PD"); pr_info("vcm pd gpio_request, %d\n", MSM_CAM_VCM_PD); if (rc < 0 && rc != -EBUSY) { pr_err("GPIO(%d) request failed", MSM_CAM_VCM_PD); } else { gpio_direction_output(MSM_CAM_VCM_PD, 0); gpio_free(MSM_CAM_VCM_PD); rc = 0; } rc = gpio_request(MSM_CAM2_RSTz, "mt9v113"); pr_info("reset pin gpio_request, %d\n", MSM_CAM2_RSTz); if (rc < 0) pr_err("GPIO(%d) request failed", MSM_CAM2_RSTz); else { gpio_direction_output(MSM_CAM2_RSTz, 0); gpio_free(MSM_CAM2_RSTz); } udelay(50); pr_info("sensor_power_disable(\"reg_8038_l17\") == %d\n", rc); rc = camera_sensor_power_disable(reg_8038_l17); if (rc < 0) pr_err("sensor_power_disable(\"reg_8038_l17\") FAILED %d\n", rc); return rc; }
static int elite_mt9v113_vreg_off(void) { int rc; pr_info("%s\n", __func__); rc = gpio_request(ELITE_GPIO_CAM2_RSTz, "mt9v113"); if (rc < 0) { pr_err("%s:ELITE_GPIO_CAM2_RSTz gpio %d request failed, rc=%d\n", __func__, ELITE_GPIO_CAM2_RSTz, rc); goto init_fail; } gpio_direction_output(ELITE_GPIO_CAM2_RSTz, 0); msleep(2); gpio_free(ELITE_GPIO_CAM2_RSTz); udelay(50); rc = gpio_request(ELITE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); pr_info("elite_mt9v113_vreg_off %d 1v8\n", ELITE_GPIO_V_LCMIO_1V8_EN); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, ELITE_GPIO_V_LCMIO_1V8_EN, rc); goto init_fail; } gpio_direction_output(ELITE_GPIO_V_LCMIO_1V8_EN, 0); gpio_free(ELITE_GPIO_V_LCMIO_1V8_EN); udelay(50); rc = camera_sensor_power_disable(reg_8921_l8); pr_info("camera_sensor_power_disable(\"8921_l8\", 2.8V) == %d\n", rc); if (rc < 0) goto init_fail; udelay(50); rc = camera_sensor_power_disable(reg_8921_lvs6); pr_info("camera_sensor_power_disable(\"8921_lvs6\", 1.8V) == %d\n", rc); if (rc < 0) goto init_fail; udelay(50); rc = camera_sensor_power_disable(reg_8921_l9); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l9\") FAILED %d\n", rc); goto init_fail; } init_fail: return rc; }
static int ville_rawchip_vreg_off(void) { int rc = 0; pr_info("%s\n", __func__); /* Mu Lee for sequence with raw chip 20120116 */ rc = camera_sensor_power_disable(reg_8921_l8); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l8\") FAILED %d\n", rc); goto ville_rawchip_vreg_off_fail; } rc = gpio_request(VILLE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); if (rc < 0) { pr_err("sensor_power_enable(\"gpio %d\", 1.2V) FAILED %d\n", VILLE_GPIO_V_CAM_D1V2_EN, rc); goto ville_rawchip_vreg_off_fail; } gpio_direction_output(VILLE_GPIO_V_CAM_D1V2_EN, 0); gpio_free(VILLE_GPIO_V_CAM_D1V2_EN); udelay(50); rc = gpio_request(VILLE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, VILLE_GPIO_V_LCMIO_1V8_EN, rc); goto ville_rawchip_vreg_off_fail; } gpio_direction_output(VILLE_GPIO_V_LCMIO_1V8_EN, 0); gpio_free(VILLE_GPIO_V_LCMIO_1V8_EN); mdelay(5); rc = camera_sensor_power_disable(reg_8921_lvs6); if (rc < 0) { pr_err("rawchip_power_disable(\"8921_lvs6\", 1.8V) FAILED %d\n", rc); goto ville_rawchip_vreg_off_fail; } /* VCM */ /* Mu Lee for sequenc with raw chip 20120116 */ rc = camera_sensor_power_disable(reg_8921_l9); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l9\") FAILED %d\n", rc); goto ville_rawchip_vreg_off_fail; } return rc; ville_rawchip_vreg_off_fail: return rc; }
static int ville_s5k3h2yx_vreg_off(void) { int rc = 0; pr_info("%s\n", __func__); #if 0 /* analog */ rc = camera_sensor_power_disable(reg_8921_l8); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l8\") FAILED %d\n", rc); goto ville_s5k3h2yx_vreg_off_fail; } udelay(50); /* VCM */ rc = camera_sensor_power_disable(reg_8921_l9); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l9\") FAILED %d\n", rc); goto ville_s5k3h2yx_vreg_off_fail; } /* digital */ /* remove because rawchip will turn it off latter. */ rc = gpio_request(VILLE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V2_EN gpio %d request failed, rc=%d\n", __func__, VILLE_GPIO_V_CAM_D1V2_EN, rc); goto ville_s5k3h2yx_vreg_off_fail; } gpio_direction_output(VILLE_GPIO_V_CAM_D1V2_EN, 0); gpio_free(VILLE_GPIO_V_CAM_D1V2_EN); rc = gpio_request(VILLE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, VILLE_GPIO_V_LCMIO_1V8_EN, rc); goto ville_s5k3h2yx_vreg_off_fail; } gpio_direction_output(VILLE_GPIO_V_LCMIO_1V8_EN, 0); gpio_free(VILLE_GPIO_V_LCMIO_1V8_EN); /* IO */ rc = camera_sensor_power_disable(reg_8921_lvs6); if (rc < 0) { pr_err("sensor_power_disable(\"8921_lvs6\") FAILED %d\n", rc); goto ville_s5k3h2yx_vreg_off_fail; } ville_s5k3h2yx_vreg_off_fail: #endif return rc; }
static int shooter_mt9v113_vreg_off(void) { int rc = 0; pr_info("[CAM] %s\n", __func__); rc = camera_sensor_power_disable(shooter_reg_8058_l9); pr_info("[CAM] camera_sensor_power_disable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l9\") FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_disable(shooter_reg_8058_l15); pr_info("[CAM] camera_sensor_power_disable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l15\") FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_disable(shooter_reg_8058_l12); pr_info("[CAM] camera_sensor_power_disable(\"8058_l12\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l12\") FAILED %d\n", rc); goto init_fail; } udelay(50); pr_info("[CAM] camera_sensor_power_disable(\"8058_l10\", 2.8V) == %d\n", rc); rc = camera_sensor_power_disable(shooter_reg_8058_l10); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l10\") FAILED %d\n", rc); goto init_fail; } shooter_config_camera_off_gpios(); pr_info("[CAM] Doing clk switch to sleep state\n"); rc = gpio_request(SHOOTER_MCLK_SWITCH, "CAM_SEL"); if (rc < 0) { pr_err("[CAM] GPIO (%d) request fail\n", SHOOTER_MCLK_SWITCH); goto init_fail; } gpio_direction_output(SHOOTER_MCLK_SWITCH, 0); gpio_free(SHOOTER_MCLK_SWITCH); init_fail: return rc; }
static int elite_s5k3h2yx_vreg_off(void) { int rc = 0; pr_info("%s\n", __func__); #if 0 rc = camera_sensor_power_disable(reg_8921_l8); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l8\") FAILED %d\n", rc); goto elite_s5k3h2yx_vreg_off_fail; } udelay(50); rc = camera_sensor_power_disable(reg_8921_l9); if (rc < 0) { pr_err("sensor_power_disable(\"8921_l9\") FAILED %d\n", rc); goto elite_s5k3h2yx_vreg_off_fail; } rc = gpio_request(ELITE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V2_EN gpio %d request failed, rc=%d\n", __func__, ELITE_GPIO_V_CAM_D1V2_EN, rc); goto elite_s5k3h2yx_vreg_off_fail; } gpio_direction_output(ELITE_GPIO_V_CAM_D1V2_EN, 0); gpio_free(ELITE_GPIO_V_CAM_D1V2_EN); rc = gpio_request(ELITE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, ELITE_GPIO_V_LCMIO_1V8_EN, rc); goto elite_s5k3h2yx_vreg_off_fail; } gpio_direction_output(ELITE_GPIO_V_LCMIO_1V8_EN, 0); gpio_free(ELITE_GPIO_V_LCMIO_1V8_EN); rc = camera_sensor_power_disable(reg_8921_lvs6); if (rc < 0) { pr_err("sensor_power_disable(\"8921_lvs6\") FAILED %d\n", rc); goto elite_s5k3h2yx_vreg_off_fail; } elite_s5k3h2yx_vreg_off_fail: #endif return rc; }
int t6china_camera_vreg_on(void) { int rc=0; pr_info("%s \n", __func__); t6chian_camera_on++; if (t6chian_camera_on>1) { pr_info("%s: just return\n", __func__); return rc; } rc = camera_sensor_power_enable("8921_l22", 3000000, ®_8921_l22); if (rc<0) goto VREG_FAIL_D1V8; mdelay(125); rc = camera_sensor_power_enable("8921_l23", 1800000, ®_8921_l23); if (rc<0) goto VREG_FAIL_IO1V8; mdelay(25); rc = camera_sensor_power_enable("8921_l8", 2800000, ®_8921_l8); if (rc<0) goto VREG_FAIL_ANALOG2V8; mdelay(10); rc = gpio_set (PM8921_GPIO_PM_TO_SYS(MCAM_D1V2_EN),1); if (rc<0) goto VREG_FAIL_1V2; mdelay(1); return rc; VREG_FAIL_1V2: camera_sensor_power_disable(reg_8921_l8); VREG_FAIL_ANALOG2V8: camera_sensor_power_disable(reg_8921_l23); VREG_FAIL_IO1V8: camera_sensor_power_disable(reg_8921_l22); VREG_FAIL_D1V8: return rc; }
static int msm8930_ov4688_vreg_off(void) { int rc = 0; pr_info("%s\n", __func__); gpio_set (MSM_CAMIO_1V8_EN,0); camera_sensor_power_disable(reg_8038_l8); gpio_set (MSM_CAM_VCM_PD,0); camera_sensor_power_disable(reg_8038_l17); gpio_set (MSM_RAW_1V2_EN,0); return rc; }
static int msm8930_ov4688_vreg_on(void) { int rc =0; pr_info("%s\n", __func__); rc = camera_sensor_power_enable("8038_l17", 2850000, ®_8038_l17); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8038_l17\", 2.85V) FAILED %d\n", rc); goto enable_ov4688_vcm_fail; } msleep(1); rc = gpio_set (MSM_CAM_VCM_PD,1); if (rc<0) { goto enable_ov4688_vcm_pd_fail; } rc = camera_sensor_power_enable("8038_l8", 2900000, ®_8038_l8); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8038_l8\", 2.9V) FAILED %d\n", rc); goto enable_ov4688_l8_fail; } udelay(50); rc = gpio_set (MSM_CAMIO_1V8_EN,1); if (rc < 0) goto enable_ov4688_io1v8_fail; rc = gpio_set (MSM_RAW_1V2_EN,1); if (rc<0) goto RAW_FAIL_1V2; return rc; RAW_FAIL_1V2: gpio_set (MSM_CAMIO_1V8_EN,0); enable_ov4688_io1v8_fail: camera_sensor_power_disable(reg_8038_l8); enable_ov4688_l8_fail: gpio_set (MSM_CAM_VCM_PD,0); enable_ov4688_vcm_pd_fail: camera_sensor_power_disable(reg_8038_l17); enable_ov4688_vcm_fail: return rc; }
static int msm8930_s5k6a2ya_vreg_off(void) { int rc = 0; pr_info("[CAM] %s\n", __func__); rc = gpio_request(MSM_CAM2_RSTz, "s5k6a2ya"); pr_info("[CAM] reset pin gpio_request, %d\n", MSM_CAM2_RSTz); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", MSM_CAM2_RSTz); else { gpio_direction_output(MSM_CAM2_RSTz, 0); gpio_free(MSM_CAM2_RSTz); } udelay(50); pr_info("[CAM] sensor_power_disable(\"8038_l8\") == %d\n", rc); rc = camera_sensor_power_disable(reg_8038_l8); if (rc < 0) pr_err("[CAM] sensor_power_disable(\"reg_8038_l8\") FAILED %d\n", rc); udelay(50); rc = gpio_request(MSM_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("[CAM] cam io gpio_request, %d\n", MSM_CAMIO_1V8_EN); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", MSM_CAMIO_1V8_EN); else { gpio_direction_output(MSM_CAMIO_1V8_EN, 0); gpio_free(MSM_CAMIO_1V8_EN); } gpio_set (MSM_RAW_1V2_EN,0); rc = gpio_request(MSM_CAM_VCM_PD, "CAM_VCM_PD"); pr_info("[CAM] vcm pd gpio_request, %d\n", MSM_CAM_VCM_PD); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", MSM_CAM_VCM_PD); else { gpio_direction_output(MSM_CAM_VCM_PD, 0); gpio_free(MSM_CAM_VCM_PD); } udelay(50); pr_info("[CAM] sensor_power_disable(\"reg_8038_l17\") == %d\n", rc); rc = camera_sensor_power_disable(reg_8038_l17); if (rc < 0) pr_err("[CAM] sensor_power_disable(\"reg_8038_l17\") FAILED %d\n", rc); return rc; }
static int msm8930_s5k4e5yx_vreg_off(void) { int rc = 0; pr_info("[CAM] %s\n", __func__); /* analog */ rc = camera_sensor_power_disable(reg_8038_l8); pr_info("[CAM] sensor_power_disable(\"8038_l8\") == %d\n", rc); if (rc < 0) pr_err("[CAM] sensor_power_disable\(\"8038_l8\") FAILED %d\n", rc); udelay(50); /* digital */ rc = gpio_request(CAM_PIN_GPIO_V_CAM_D1V8_EN, "V_CAM_D1V8_EN"); pr_info("[CAM] digital gpio_request, %d\n", CAM_PIN_GPIO_V_CAM_D1V8_EN); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_V_CAM_D1V8_EN); else { gpio_tlmm_config( GPIO_CFG(CAM_PIN_GPIO_V_CAM_D1V8_EN, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE); gpio_direction_output(CAM_PIN_GPIO_V_CAM_D1V8_EN, 0); gpio_free(CAM_PIN_GPIO_V_CAM_D1V8_EN); } udelay(900); /* IO */ rc = gpio_request(CAM_PIN_GPIO_V_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("[CAM] cam io gpio_request, %d\n", CAM_PIN_GPIO_V_CAMIO_1V8_EN); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_V_CAMIO_1V8_EN); else { gpio_direction_output(CAM_PIN_GPIO_V_CAMIO_1V8_EN, 0); gpio_free(CAM_PIN_GPIO_V_CAMIO_1V8_EN); } udelay(50); /* VCM */ if (reg_8038_l17 != NULL) regulator_set_optimum_mode(reg_8038_l17, 9000); rc = camera_sensor_power_disable(reg_8038_l17); pr_info("[CAM] sensor_power_disable(\"8038_l17\") == %d\n", rc); if (rc < 0) pr_err("[CAM] sensor_power_disable\(\"8038_l17\") FAILED %d\n", rc); return rc; }
static int msm8930_ov5693_vreg_on(void) { int rc; pr_info("%s\n", __func__); /* VCM */ rc = camera_sensor_power_enable("8038_l17", 2850000, ®_8038_l17); pr_info("vcm sensor_power_enable(\"8038_l17\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("sensor_power_enable(\"8038_l17\", 2.8V) FAILED %d\n", rc); goto enable_ov5693_vcm_fail; } udelay(50); /* analog */ rc = camera_sensor_power_enable("8038_l8", 2800000, ®_8038_l8); pr_info("analog sensor_power_enable(\"8038_l8\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("sensor_power_enable(\"8038_l8\", 2.8V) FAILED %d\n", rc); goto enable_ov5693_analog_fail; } udelay(50); /* IO */ rc = gpio_request(CAM_PIN_GPIO_V_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("cam io gpio_request, %d\n", CAM_PIN_GPIO_V_CAMIO_1V8_EN); if (rc < 0) { pr_err("GPIO(%d) request failed", CAM_PIN_GPIO_V_CAMIO_1V8_EN); goto enable_ov5693_io_fail; } gpio_direction_output(CAM_PIN_GPIO_V_CAMIO_1V8_EN, 1); gpio_free(CAM_PIN_GPIO_V_CAMIO_1V8_EN); udelay(50); /* 2nd camera reset pin */ rc = gpio_request(CAM_PIN_GPIO_CAM2_RSTz, "s5k6a2ya"); pr_info(" reset pin gpio_request, %d\n", CAM_PIN_GPIO_CAM2_RSTz); if (rc < 0) { pr_err(" GPIO(%d) request failed", CAM_PIN_GPIO_CAM2_RSTz); } gpio_direction_output(CAM_PIN_GPIO_CAM2_RSTz, 0); gpio_free(CAM_PIN_GPIO_CAM2_RSTz); return rc; enable_ov5693_io_fail: camera_sensor_power_disable(reg_8038_l8); enable_ov5693_analog_fail: rc = gpio_request(CAM_PIN_GPIO_V_CAM_D1V8_EN, "V_CAM_D1V8_EN"); if (rc < 0) pr_err("GPIO(%d) request failed", CAM_PIN_GPIO_V_CAM_D1V8_EN); else { gpio_direction_output(CAM_PIN_GPIO_V_CAM_D1V8_EN, 0); gpio_free(CAM_PIN_GPIO_V_CAM_D1V8_EN); } /*enable_ov5693_digital_fail: camera_sensor_power_disable(reg_8038_l17);*/ enable_ov5693_vcm_fail: return rc; }
static int t6china_rawchip_vreg_on(void) { int rc = 0; pr_info("%s\n", __func__); rc = camera_sensor_power_enable("8921_lvs4", 1800000, ®_8921_lvs4); if (rc < 0) { pr_err("sensor_power_enable(\"8921_lvs4\") FAILED %d\n", rc); goto RAW_FAIL_1V8; } mdelay(5); rc = gpio_set (PM8921_GPIO_PM_TO_SYS(V_RAW_1V2_EN),1); if (rc<0) goto RAW_FAIL_1V2; return rc; RAW_FAIL_1V2: camera_sensor_power_disable (reg_8921_lvs4); RAW_FAIL_1V8: return rc; }
static int t6china_rawchip_vreg_off(void) { gpio_set (CAM_PIN_GPIO_CAM_PWDN,0); mdelay(10); gpio_set (PM8921_GPIO_PM_TO_SYS(V_RAW_1V2_EN),0); camera_sensor_power_disable (reg_8921_lvs4); return 0; }
int t6china_camera_vreg_off(void) { pr_info("%s\n", __func__); t6chian_camera_on--; if (t6chian_camera_on) { pr_info("%s: just return\n", __func__); return 0; } gpio_set (PM8921_GPIO_PM_TO_SYS(MCAM_D1V2_EN),0); camera_sensor_power_disable(reg_8921_l8); mdelay(25); camera_sensor_power_disable(reg_8921_l23); mdelay(125); camera_sensor_power_disable(reg_8921_l22); return 0; }
static int t6china_csi_vreg_off(void) { pr_info("%s\n", __func__); t6chian_csi_on--; if (t6chian_csi_on) { return 0; } return camera_sensor_power_disable(reg_8921_l2); }
static int shooter_s5k3h1gx_vreg_off(void) { int rc = 0; pr_info("[CAM] %s\n", __func__); rc = camera_sensor_power_disable(shooter_reg_8058_l9); pr_info("[CAM] camera_sensor_power_disable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l9\") FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_disable(shooter_reg_8058_l15); pr_info("[CAM] camera_sensor_power_disable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l15\") FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_disable(shooter_reg_8058_l12); pr_info("[CAM] camera_sensor_power_disable(\"8058_l12\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l12\") FAILED %d\n", rc); goto init_fail; } udelay(50); pr_info("[CAM] camera_sensor_power_disable(\"8058_l10\", 2.8V) == %d\n", rc); rc = camera_sensor_power_disable(shooter_reg_8058_l10); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l10\") FAILED %d\n", rc); goto init_fail; } shooter_config_camera_off_gpios(); init_fail: return rc; }
int main_camera_id(int *id) { int rc = 0; rc = camera_sensor_power_enable("8921_l22", 3000000, ®_8921_l22); if (rc < 0) { goto CLEANUP; } rc = camera_sensor_power_enable("8921_l23", 1800000, ®_8921_l23); if (rc < 0) { goto CLEANUP; } msleep(100); rc = gpio_get(CAM_PIN_MAIN_CAMERA_ID, id); CLEANUP: rc = camera_sensor_power_disable(reg_8921_l23); rc = camera_sensor_power_disable(reg_8921_l22); return rc; }
int t6china_main_camera_vreg_off(void) { if (t6china_main_camera_on) t6china_main_camera_on--; if (t6china_main_camera_on==0) { camera_sensor_power_disable(reg_8921_l29); gpio_set (PM8921_GPIO_PM_TO_SYS(CAM_VCM_PD),0); gpio_set (CAM_PIN_GPIO_CAM_PWDN,0); } return t6china_camera_vreg_off(); }
static int msm8930_s5k4e5yx_vreg_on(void) { int rc; pr_info("[CAM] %s\n", __func__); rc = camera_sensor_power_enable("8038_l17", 2800000, ®_8038_l17); pr_info("[CAM] vcm sensor_power_enable(\"8038_l17\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8038_l17\", 2.8V) FAILED %d\n", rc); goto enable_s5k4e5yx_vcm_fail; } udelay(50); /* analog */ rc = camera_sensor_power_enable("8038_l8", 2800000, ®_8038_l8); pr_info("[CAM] analog sensor_power_enable(\"8038_l8\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8038_l8\", 2.8V) FAILED %d\n", rc); goto enable_s5k4e5yx_analog_fail; } udelay(50); /* IO */ rc = gpio_request(CAM_PIN_GPIO_V_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("[CAM] cam io gpio_request, %d\n", CAM_PIN_GPIO_V_CAMIO_1V8_EN); if (rc < 0) { pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_V_CAMIO_1V8_EN); goto enable_s5k4e5yx_io_fail; } gpio_direction_output(CAM_PIN_GPIO_V_CAMIO_1V8_EN, 1); gpio_free(CAM_PIN_GPIO_V_CAMIO_1V8_EN); udelay(50); return rc; enable_s5k4e5yx_io_fail: camera_sensor_power_disable(reg_8038_l8); enable_s5k4e5yx_analog_fail: rc = gpio_request(CAM_PIN_GPIO_V_CAM_D1V8_EN, "V_CAM_D1V8_EN"); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_V_CAM_D1V8_EN); else { gpio_direction_output(CAM_PIN_GPIO_V_CAM_D1V8_EN, 0); gpio_free(CAM_PIN_GPIO_V_CAM_D1V8_EN); } enable_s5k4e5yx_vcm_fail: return rc; }
static int msm8930_ov5693_vreg_on(void) { int rc; pr_info("%s\n", __func__); rc = camera_sensor_power_enable("8038_l17", 2800000, ®_8038_l17); pr_info("vcm sensor_power_enable(\"8038_l17\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("sensor_power_enable(\"8038_l17\", 2.8V) FAILED %d\n", rc); goto enable_ov5693_vcm_fail; } udelay(50); rc = camera_sensor_power_enable("8038_l8", 2800000, ®_8038_l8); pr_info("analog sensor_power_enable(\"8038_l8\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("sensor_power_enable(\"8038_l8\", 2.8V) FAILED %d\n", rc); goto enable_ov5693_analog_fail; } udelay(50); rc = gpio_request(MSM_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("cam io gpio_request, %d\n", MSM_CAMIO_1V8_EN); if (rc < 0) { pr_err("GPIO(%d) request failed", MSM_CAMIO_1V8_EN); goto enable_ov5693_io_fail; } gpio_direction_output(MSM_CAMIO_1V8_EN, 1); gpio_free(MSM_CAMIO_1V8_EN); udelay(50); return rc; enable_ov5693_io_fail: camera_sensor_power_disable(reg_8038_l8); enable_ov5693_analog_fail: rc = gpio_request(MSM_V_CAM_D1V8_EN, "V_CAM_D1V8_EN"); if (rc < 0) pr_err("GPIO(%d) request failed", MSM_V_CAM_D1V8_EN); else { gpio_direction_output(MSM_V_CAM_D1V8_EN, 0); gpio_free(MSM_V_CAM_D1V8_EN); } enable_ov5693_vcm_fail: return rc; }
int t6china_main_camera_vreg_on(void) { int rc=0; t6china_main_camera_on++; pr_info ("%s: t6china_main_camera_on=%d\n",__func__,t6china_main_camera_on); if (t6china_main_camera_on==1) { rc = camera_sensor_power_enable("8921_l29", 2850000, ®_8921_l29); if (rc<0) goto FAIL_VCM_POWER; rc = gpio_set (PM8921_GPIO_PM_TO_SYS(CAM_VCM_PD),1); if (rc<0) goto FAIL_VCM_PD; } rc = t6china_camera_vreg_on(); if (!t6china_front_camera_on) { pr_info("%s: front camera enter suspend mode\n",__func__); gpio_set(CAM_PIN_GPIO_CAM2_RSTz,0); } if (t6china_main_camera_on==1) { pr_info ("%s: main camera exit suspend mode\n",__func__); gpio_set(CAM_PIN_GPIO_CAM_PWDN,1); gpio_set (PM8921_GPIO_PM_TO_SYS(MCAM_D1V2_EN),1); } return rc; FAIL_VCM_PD: camera_sensor_power_disable(reg_8921_l29); FAIL_VCM_POWER: return rc; }
static int elite_csi_vreg_off(void) { pr_info("%s\n", __func__); return camera_sensor_power_disable(reg_8921_l2); }
static int elite_rawchip_vreg_on(void) { int rc; pr_info("%s\n", __func__); rc = camera_sensor_power_enable("8921_l9", 2800000, ®_8921_l9); if (rc < 0) { pr_err("rawchip_power_enable(\"8921_l9\", 2.8V) FAILED %d\n", rc); goto enable_VCM_fail; } rc = camera_sensor_power_enable("8921_lvs6", 1800000, ®_8921_lvs6); if (rc < 0) { pr_err("rawchip_power_enable(\"8921_lvs6\", 1.8V) FAILED %d\n", rc); goto enable_1v8_fail; } mdelay(5); rc = gpio_request(ELITE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); if (rc < 0) { pr_err("sensor_power_enable(\"gpio %d\", 1.2V) FAILED %d\n", ELITE_GPIO_V_CAM_D1V2_EN, rc); goto enable_1v2_fail; } gpio_direction_output(ELITE_GPIO_V_CAM_D1V2_EN, 1); gpio_free(ELITE_GPIO_V_CAM_D1V2_EN); rc = camera_sensor_power_enable("8921_l8", 2800000, ®_8921_l8); if (rc < 0) { pr_err("sensor_power_enable(\"8921_l8\", 2.8V) FAILED %d\n", rc); goto enable_analog_fail; } rc = gpio_request(ELITE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, ELITE_GPIO_V_LCMIO_1V8_EN, rc); goto lcmio_hi_fail; } gpio_direction_output(ELITE_GPIO_V_LCMIO_1V8_EN, 1); gpio_free(ELITE_GPIO_V_LCMIO_1V8_EN); return rc; lcmio_hi_fail: camera_sensor_power_disable(reg_8921_l8); enable_analog_fail: gpio_request(ELITE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); gpio_direction_output(ELITE_GPIO_V_CAM_D1V2_EN, 0); gpio_free(ELITE_GPIO_V_CAM_D1V2_EN); enable_1v2_fail: camera_sensor_power_disable(reg_8921_lvs6); enable_1v8_fail: camera_sensor_power_disable(reg_8921_l9); enable_VCM_fail: return rc; }
static int ville_rawchip_vreg_on(void) { int rc; pr_info("%s\n", __func__); /* VCM */ rc = camera_sensor_power_enable("8921_l9", 2800000, ®_8921_l9); // Mu Lee for sequence with raw chip 20120116 if (rc < 0) { pr_err("rawchip_power_enable(\"8921_l9\", 2.8V) FAILED %d\n", rc); goto enable_VCM_fail; } /* PM8921_lvs6 1800000 */ rc = camera_sensor_power_enable("8921_lvs6", 1800000, ®_8921_lvs6); if (rc < 0) { pr_err("rawchip_power_enable(\"8921_lvs6\", 1.8V) FAILED %d\n", rc); goto enable_1v8_fail; } mdelay(5); /* digital */ rc = gpio_request(VILLE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); if (rc < 0) { pr_err("sensor_power_enable(\"gpio %d\", 1.2V) FAILED %d\n", VILLE_GPIO_V_CAM_D1V2_EN, rc); goto enable_1v2_fail; } gpio_direction_output(VILLE_GPIO_V_CAM_D1V2_EN, 1); gpio_free(VILLE_GPIO_V_CAM_D1V2_EN); /* analog */ /* Mu Lee for sequence with raw chip 20120116 */ rc = camera_sensor_power_enable("8921_l8", 2800000, ®_8921_l8); if (rc < 0) { pr_err("sensor_power_enable(\"8921_l8\", 2.8V) FAILED %d\n", rc); goto enable_analog_fail; } /* LCMIO */ rc = gpio_request(VILLE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); /* Mu Lee for sequence with raw chip 20120116 */ if (rc < 0) { pr_err("%s:GPIO_CAM_D1V8_EN gpio %d request failed, rc=%d\n", __func__, VILLE_GPIO_V_LCMIO_1V8_EN, rc); goto lcmio_hi_fail; } gpio_direction_output(VILLE_GPIO_V_LCMIO_1V8_EN, 1); /* Mu Lee for sequence with raw chip 20120116 */ gpio_free(VILLE_GPIO_V_LCMIO_1V8_EN); /* Mu Lee for sequence with raw chip 20120116 */ return rc; lcmio_hi_fail: camera_sensor_power_disable(reg_8921_l8); enable_analog_fail: gpio_request(VILLE_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); gpio_direction_output(VILLE_GPIO_V_CAM_D1V2_EN, 0); gpio_free(VILLE_GPIO_V_CAM_D1V2_EN); enable_1v2_fail: camera_sensor_power_disable(reg_8921_lvs6); enable_1v8_fail: camera_sensor_power_disable(reg_8921_l9); enable_VCM_fail: return rc; }
static int Villec2_mt9v113_vreg_off(void) { int rc = 0; pr_info("[CAM] %s\n", __func__); /* Reset */ pr_info("[CAM] Do Reset pin Off\n"); rc = gpio_request(VILLEC2_GPIO_CAM2_RSTz, "mt9v113"); if (rc < 0) { pr_err("[CAM] %s:VILLEC2_GPIO_CAM2_RSTz gpio %d request failed, rc=%d\n", __func__, VILLEC2_GPIO_CAM2_RSTz, rc); goto init_fail; } gpio_direction_output(VILLEC2_GPIO_CAM2_RSTz, 0); msleep(2); gpio_free(VILLEC2_GPIO_CAM2_RSTz); udelay(50); /* digital */ rc = camera_sensor_power_disable(villec2_reg_8058_l9); pr_info("[CAM] camera_sensor_power_disable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l9\") FAILED %d\n", rc); goto init_fail; } udelay(50); /* analog */ rc = camera_sensor_power_disable(villec2_reg_8058_l15); pr_info("[CAM] camera_sensor_power_disable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l15\") FAILED %d\n", rc); goto init_fail; } udelay(50); /* IO */ rc = camera_sensor_power_disable(villec2_reg_8058_l8); pr_info("[CAM] camera_sensor_power_disable(\"8058_l8\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l8\") FAILED %d\n", rc); goto init_fail; } udelay(50); /* VCM */ pr_info("[CAM] camera_sensor_power_disable(\"8058_l14\", 2.8V) == %d\n", rc); rc = camera_sensor_power_disable(villec2_reg_8058_l14); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l14\") FAILED %d\n", rc); goto init_fail; } villec2_config_camera_off_gpios(); /* Per optical request, config CAM_SEL GPIO into sleep state*/ pr_info("[CAM] Doing clk switch to sleep state\n"); rc = gpio_request(VILLEC2_GPIO_MCLK_SWITCH, "CAM_SEL"); if (rc < 0) { pr_err("[CAM] GPIO (%d) request fail\n", VILLEC2_GPIO_MCLK_SWITCH); goto init_fail; } gpio_direction_output(VILLEC2_GPIO_MCLK_SWITCH, 0); gpio_free(VILLEC2_GPIO_MCLK_SWITCH); init_fail: return rc; }