static int msm8930_csi_vreg_on(void) { pr_info("%s\n", __func__); return camera_sensor_power_enable("8038_l2", 1200000, ®_8038_l2); }
static int msm8930_s5k6a2ya_vreg_on(void) { int rc; pr_info(" %s\n", __func__); /* VCM */ rc = camera_sensor_power_enable("8038_l17", 2850000, ®_8038_l17); pr_info(" 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_s5k6a2ya_vcm_fail; } udelay(50); /* analog */ rc = camera_sensor_power_enable("8038_l8", 2800000, ®_8038_l8); pr_info(" 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_s5k6a2ya_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_s5k6a2ya_io_fail; } gpio_direction_output(CAM_PIN_GPIO_V_CAMIO_1V8_EN, 1); gpio_free(CAM_PIN_GPIO_V_CAMIO_1V8_EN); udelay(50); /* 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); goto enable_s5k6a2ya_rst_fail; } gpio_direction_output(CAM_PIN_GPIO_CAM2_RSTz, 1); gpio_free(CAM_PIN_GPIO_CAM2_RSTz); mdelay(1); /* V_CAM2_D1V2 */ rc = camera_sensor_power_enable("8038_l12", 1200000, ®_8038_l12); pr_info(" sensor_power_enable(\"8038_l12\", 1.2V) == %d\n", rc); if (rc < 0) { pr_err(" sensor_power_enable(\"8038_l12\", 1.2V) FAILED %d\n", rc); goto enable_s5k6a2ya_cam2_d1v2_fail; } udelay(50); /* CAM Switch */ rc = gpio_request(CAM_PIN_GPIO_CAM2_SEL, "CAM2_SEL"); pr_info(" cam sel gpio_request, %d\n", CAM_PIN_GPIO_CAM2_SEL); if (rc < 0) { pr_err(" GPIO(%d) request failed", CAM_PIN_GPIO_CAM2_SEL); goto enable_s5k6a2ya_cam2_sel_fail; } gpio_direction_output(CAM_PIN_GPIO_CAM2_SEL, 1); gpio_free(CAM_PIN_GPIO_CAM2_SEL); udelay(50); udelay(500); return rc; enable_s5k6a2ya_cam2_sel_fail: camera_sensor_power_disable(reg_8038_l12); enable_s5k6a2ya_cam2_d1v2_fail: rc = gpio_request(CAM_PIN_GPIO_CAM2_RSTz, "s5k6a2ya"); if (rc < 0) pr_err(" GPIO(%d) request failed", CAM_PIN_GPIO_CAM2_RSTz); else { gpio_direction_output(CAM_PIN_GPIO_CAM2_RSTz, 0); gpio_free(CAM_PIN_GPIO_CAM2_RSTz); } enable_s5k6a2ya_rst_fail: rc = gpio_request(CAM_PIN_GPIO_V_CAMIO_1V8_EN, "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); } enable_s5k6a2ya_io_fail: camera_sensor_power_disable(reg_8038_l8); enable_s5k6a2ya_analog_fail: camera_sensor_power_disable(reg_8038_l17); enable_s5k6a2ya_vcm_fail: return rc; }
static int msm8930_s5k4e5yx_vreg_on(void) { int rc; pr_info("[CAM] %s\n", __func__); /* VCM */ 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); /* 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); goto enable_s5k4e5yx_digital_fail; } gpio_tlmm_config( GPIO_CFG(CAM_PIN_GPIO_V_CAM_D1V8_EN, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE); gpio_direction_output(CAM_PIN_GPIO_V_CAM_D1V8_EN, 1); gpio_free(CAM_PIN_GPIO_V_CAM_D1V8_EN); 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_digital_fail: camera_sensor_power_disable(reg_8038_l17); enable_s5k4e5yx_vcm_fail: return rc; }
static int msm8930_s5k6a1gx_vreg_on(void) { int rc; pr_info("[CAM] %s\n", __func__); /* VCM */ rc = camera_sensor_power_enable("8038_l17", 2800000, ®_8038_l17); pr_info("[CAM] 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_s5k6a1gx_vcm_fail; } 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); goto enable_s5k6a1gx_digital_fail; } gpio_tlmm_config( GPIO_CFG(CAM_PIN_GPIO_V_CAM_D1V8_EN, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE); gpio_direction_output(CAM_PIN_GPIO_V_CAM_D1V8_EN, 1); gpio_free(CAM_PIN_GPIO_V_CAM_D1V8_EN); /* VCM PD */ /* TODO */ rc = gpio_request(CAM_PIN_GPIO_CAM_VCM_PD, "CAM_VCM_PD"); pr_info("[CAM] vcm pd gpio_request, %d\n", CAM_PIN_GPIO_CAM_VCM_PD); if (rc < 0 && rc != -EBUSY) { pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_CAM_VCM_PD); goto enable_s5k6a1gx_vcm_pd; } else rc = 0; gpio_direction_output(CAM_PIN_GPIO_CAM_VCM_PD, 1); gpio_free(CAM_PIN_GPIO_CAM_VCM_PD); udelay(500); /* analog */ rc = camera_sensor_power_enable("8038_l8", 2800000, ®_8038_l8); pr_info("[CAM] 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_s5k6a1gx_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_s5k6a1gx_io_fail; } gpio_direction_output(CAM_PIN_GPIO_V_CAMIO_1V8_EN, 1); gpio_free(CAM_PIN_GPIO_V_CAMIO_1V8_EN); udelay(50); /* reset pin */ rc = gpio_request(CAM_PIN_GPIO_CAM2_RSTz, "s5k6a1gx"); pr_info("[CAM] reset pin gpio_request, %d\n", CAM_PIN_GPIO_CAM2_RSTz); if (rc < 0) { pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_CAM2_RSTz); goto enable_s5k6a1gx_rst_fail; } gpio_direction_output(CAM_PIN_GPIO_CAM2_RSTz, 1); gpio_free(CAM_PIN_GPIO_CAM2_RSTz); udelay(50); /* 2nd cam digital */ rc = gpio_request(CAM_PIN_GPIO_V_CAM2_D1V2_EN, "V_CAM2_D1V2_EN"); pr_info("[CAM] 2nd cam digital gpio_request, %d\n", CAM_PIN_GPIO_V_CAM2_D1V2_EN); if (rc < 0) { pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_V_CAM2_D1V2_EN); goto enable_s5k6a1gx_2nd_digital_fail; } gpio_direction_output(CAM_PIN_GPIO_V_CAM2_D1V2_EN, 1); gpio_free(CAM_PIN_GPIO_V_CAM2_D1V2_EN); msleep(1); return rc; enable_s5k6a1gx_2nd_digital_fail: rc = gpio_request(CAM_PIN_GPIO_CAM2_RSTz, "s5k6a1gx"); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_CAM2_RSTz); else { gpio_direction_output(CAM_PIN_GPIO_CAM2_RSTz, 0); gpio_free(CAM_PIN_GPIO_CAM2_RSTz); } enable_s5k6a1gx_rst_fail: rc = gpio_request(CAM_PIN_GPIO_V_CAMIO_1V8_EN, "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); } enable_s5k6a1gx_io_fail: camera_sensor_power_disable(reg_8038_l8); enable_s5k6a1gx_analog_fail: rc = gpio_request(CAM_PIN_GPIO_CAM_VCM_PD, "CAM_VCM_PD"); if (rc < 0) pr_err("[CAM] GPIO(%d) request failed", CAM_PIN_GPIO_CAM_VCM_PD); else { gpio_direction_output(CAM_PIN_GPIO_CAM_VCM_PD, 0); gpio_free(CAM_PIN_GPIO_CAM_VCM_PD); } enable_s5k6a1gx_vcm_pd: 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_s5k6a1gx_digital_fail: camera_sensor_power_disable(reg_8038_l17); enable_s5k6a1gx_vcm_fail: return rc; }
static int msm8930_s5k6a2ya_vreg_on(void) { int rc; pr_info("[CAM] %s\n", __func__); rc = camera_sensor_power_enable("8038_l17", 2850000, ®_8038_l17); pr_info("[CAM] sensor_power_enable(\"8038_l17\", 2.85V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8038_l17\", 2.85V) FAILED %d\n", rc); goto enable_s5k6a2ya_vcm_fail; } udelay(50); 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); goto enable_s5k6a2ya_vcm_pd; } gpio_direction_output(MSM_CAM_VCM_PD, 1); gpio_free(MSM_CAM_VCM_PD); udelay(500); rc = camera_sensor_power_enable("8038_l8", 2900000, ®_8038_l8); pr_info("[CAM] sensor_power_enable(\"8038_l8\", 2.9V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8038_l8\", 2.9V) FAILED %d\n", rc); goto enable_s5k6a2ya_analog_fail; } udelay(50); rc = gpio_request(MSM_CAMIO_1V8_EN, "V_CAMIO_1V8_EN"); pr_info("[CAM] cam iogcaa gpio_request, %d\n", MSM_CAMIO_1V8_EN); if (rc < 0) { pr_err("[CAM] GPIO(%d) request failed", MSM_CAMIO_1V8_EN); goto enable_s5k6a2ya_io_fail; } gpio_direction_output(MSM_CAMIO_1V8_EN, 1); gpio_free(MSM_CAMIO_1V8_EN); udelay(50); rc = gpio_set (MSM_RAW_1V2_EN,1); if (rc<0) goto RAW_FAIL_1V2; 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); goto enable_s5k6a2ya_rst_fail; } gpio_direction_output(MSM_CAM2_RSTz, 1); gpio_free(MSM_CAM2_RSTz); mdelay(1); return rc; enable_s5k6a2ya_rst_fail: gpio_set (MSM_RAW_1V2_EN,0); RAW_FAIL_1V2: rc = gpio_request(MSM_CAMIO_1V8_EN, "V_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); } enable_s5k6a2ya_io_fail: camera_sensor_power_disable(reg_8038_l8); enable_s5k6a2ya_analog_fail: rc = gpio_request(MSM_CAM_VCM_PD, "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); } enable_s5k6a2ya_vcm_pd: #if 0 rc = gpio_request(MSM_V_CAM_D1V8_EN, "V_CAM_D1V8_EN"); if (rc < 0) pr_err("[CAM] 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_s5k6a2ya_digital_fail: #endif camera_sensor_power_disable(reg_8038_l17); enable_s5k6a2ya_vcm_fail: return rc; }
static int msm8930_mt9v113_vreg_on(void) { int rc; pr_info("%s\n", __func__); rc = camera_sensor_power_enable("8038_l17", 2800000, ®_8038_l17); pr_info("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_mt9v113_vcm_fail; } udelay(50); 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); goto enable_mt9v113_rst_fail; } gpio_direction_output(MSM_CAM2_RSTz, 1); gpio_free(MSM_CAM2_RSTz); mdelay(1); 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); goto enable_mt9v113_digital_fail; } gpio_direction_output(MSM_V_CAM_D1V8_EN, 1); gpio_free(MSM_V_CAM_D1V8_EN); mdelay(1); rc = camera_sensor_power_enable("8038_l8", 2800000, ®_8038_l8); pr_info("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_mt9v113_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_mt9v113_io_fail; } gpio_direction_output(MSM_CAMIO_1V8_EN, 1); gpio_free(MSM_CAMIO_1V8_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); goto enable_mt9v113_vcm_pd_fail; } else { gpio_direction_output(MSM_CAM_VCM_PD, 1); gpio_free(MSM_CAM_VCM_PD); rc = 0; } return rc; enable_mt9v113_vcm_pd_fail: rc = gpio_request(MSM_CAMIO_1V8_EN, "V_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); } enable_mt9v113_io_fail: camera_sensor_power_disable(reg_8038_l8); enable_mt9v113_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_mt9v113_digital_fail: rc = gpio_request(MSM_CAM2_RSTz, "mt9v113"); 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); } enable_mt9v113_rst_fail: camera_sensor_power_disable(reg_8038_l17); enable_mt9v113_vcm_fail: return rc; }
static int villec2_rawchip_vreg_on(void) { int rc; pr_info("[CAM] %s\n", __func__); rc = camera_sensor_power_enable("8058_l14", 2850000, &villec2_reg_8058_l14); pr_info("[CAM] sensor_power_enable(\"8058_l14\", 2.85V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] rawchip_power_enable(\"8058_l14\", 2.8V) FAILED %d\n", rc); goto enable_VCM_fail; } rc = camera_sensor_power_enable("8058_l8", 1800000, &villec2_reg_8058_l8); pr_info("[CAM] sensor_power_enable(\"8058_l8\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] rawchip_power_enable(\"8058_l8\", 1.8V) FAILED %d\n", rc); goto enable_1v8_fail; } rc = gpio_request(VILLEC2_GPIO_V_CAM_D1V2_EN, "CAM_D1V2"); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"gpio %d\", 1.2V) FAILED %d\n", VILLEC2_GPIO_V_CAM_D1V2_EN, rc); goto enable_1v2_fail; } gpio_direction_output(VILLEC2_GPIO_V_CAM_D1V2_EN, 1); gpio_free(VILLEC2_GPIO_V_CAM_D1V2_EN); rc = camera_sensor_power_enable("8058_l15", 2800000, &villec2_reg_8058_l15); pr_info("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) FAILED %d\n", rc); goto enable_analog_fail; } votg_2_8v_switch = regulator_get(NULL, "8901_usb_otg"); if (IS_ERR(votg_2_8v_switch)) { pr_err("[CAM] %s: unable to get votg_2_8v_switch\n", __func__); goto enable_analog_fail; } if (regulator_enable(votg_2_8v_switch)) { pr_err("[CAM] %s: Unable to enable the regulator: votg_2_8v_switch\n", __func__); regulator_put(votg_2_8v_switch); votg_2_8v_switch = NULL; goto enable_analog_fail; } msleep(1); rc = camera_sensor_power_enable("8058_l9", 1800000, &villec2_reg_8058_l9); pr_info("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l9\", 2.8V) FAILED %d\n", rc); goto lcmio_hi_fail; } config_rawchip_on_gpios(); 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 lcmio_hi_fail; } gpio_direction_output(VILLEC2_GPIO_MCLK_SWITCH, 0); gpio_free(VILLEC2_GPIO_MCLK_SWITCH); return rc; lcmio_hi_fail: camera_sensor_power_disable(villec2_reg_8058_l9); enable_analog_fail: gpio_request(VILLEC2_GPIO_V_CAM_D1V2_EN, "CAM_D1V2_EN"); gpio_direction_output(VILLEC2_GPIO_V_CAM_D1V2_EN, 0); gpio_free(VILLEC2_GPIO_V_CAM_D1V2_EN); enable_1v2_fail: camera_sensor_power_disable(villec2_reg_8058_l8); enable_1v8_fail: camera_sensor_power_disable(villec2_reg_8058_l14); enable_VCM_fail: return rc; }
static int Villec2_mt9v113_vreg_on(void) { int rc = 0; pr_info("[CAM] %s\n", __func__); rc = camera_sensor_power_enable("8058_l14", 2850000, &villec2_reg_8058_l14); pr_info("[CAM] sensor_power_enable(\"8058_l14\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l14\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l8", 1800000, &villec2_reg_8058_l8); pr_info("[CAM] sensor_power_enable(\"8058_l8\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l8\", 1.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l15", 2800000, &villec2_reg_8058_l15); pr_info("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l9", 1800000, &villec2_reg_8058_l9); pr_info("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); pr_info("[CAM] Do Reset pin On\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, 1); msleep(2); gpio_free(VILLEC2_GPIO_CAM2_RSTz); udelay(50); villec2_config_camera_on_gpios(); 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, 1); gpio_free(VILLEC2_GPIO_MCLK_SWITCH); init_fail: return rc; }
static int Ruby_mt9d015_vreg_on(void) { int rc = 0; pr_info("[CAM] %s\n", __func__); if (system_rev >= 3) rc = camera_sensor_power_enable("8058_l8", 2850000, &ruby_reg_8058_l8); else rc = camera_sensor_power_enable("8058_l10", 2850000, &ruby_reg_8058_l10); pr_info("[CAM] sensor_power_enable(\"8058_l10\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l10\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l24", 1200000, &ruby_reg_8058_l24); pr_info("[CAM] sensor_power_enable(\"8058_l24\", 1.2V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l24\", 1.2V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l9", 1800000, &ruby_reg_8058_l9); pr_info("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l15", 2800000, &ruby_reg_8058_l15); pr_info("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l12", 1800000, &ruby_reg_8058_l12); pr_info("[CAM] sensor_power_enable(\"8058_l12\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l12\", 1.8V) FAILED %d\n", rc); goto init_fail; } pr_info("[CAM] Do Reset pin On\n"); rc = gpio_request(RUBY_CAM2_RSTz, "mt9d015"); if (rc < 0) { pr_err("[CAM] %s:RUBY_CAM2_RSTz gpio %d request failed, rc=%d\n", __func__, RUBY_CAM2_RSTz, rc); goto init_fail; } gpio_direction_output(RUBY_CAM2_RSTz, 1); msleep(2); gpio_free(RUBY_CAM2_RSTz); udelay(50); ruby_config_camera_on_gpios(); rc = gpio_request(RUBY_GPIO_MCLK_SWITCH, "CAM_SEL"); if (rc < 0) { pr_err("[CAM] GPIO (%d) request fail\n", RUBY_GPIO_MCLK_SWITCH); goto init_fail; } gpio_direction_output(RUBY_GPIO_MCLK_SWITCH, 1); gpio_free(RUBY_GPIO_MCLK_SWITCH); init_fail: return rc; }
static int pyramid_s5k3h1gx_vreg_on(void) { static int first_run = 1; int rc = 0; pr_info("[CAM] %s\n", __func__); if (first_run == 1) { first_run = 0; config_gpio_table(camera_on_gpio_table_workaround, ARRAY_SIZE(camera_on_gpio_table_workaround)); mdelay(10); rc = camera_sensor_power_enable("8058_l10", 2850000, &pyramid_reg_8058_l10); pr_info("[CAM] sensor_power_enable(\"8058_l10\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l10\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l12", 1800000, &pyramid_reg_8058_l12); pr_info("[CAM] sensor_power_enable(\"8058_l12\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l12\", 1.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l15", 2800000, &pyramid_reg_8058_l15); pr_info("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l9", 1800000, &pyramid_reg_8058_l9); pr_info("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) FAILED %d\n", rc); goto init_fail; } mdelay(20); rc = camera_sensor_power_disable(pyramid_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(pyramid_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(pyramid_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(pyramid_reg_8058_l10); if (rc < 0) { pr_err("[CAM] sensor_power_disable(\"8058_l10\") FAILED %d\n", rc); goto init_fail; } mdelay(20); } rc = camera_sensor_power_enable("8058_l10", 2850000, &pyramid_reg_8058_l10); pr_info("[CAM] sensor_power_enable(\"8058_l10\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l10\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l12", 1800000, &pyramid_reg_8058_l12); pr_info("[CAM] sensor_power_enable(\"8058_l12\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l12\", 1.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l15", 2800000, &pyramid_reg_8058_l15); pr_info("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l15\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8058_l9", 1800000, &pyramid_reg_8058_l9); pr_info("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) == %d\n", rc); if (rc < 0) { pr_err("[CAM] sensor_power_enable(\"8058_l9\", 1.8V) FAILED %d\n", rc); goto init_fail; } pyramid_config_camera_on_gpios(); init_fail: return rc; }
static int ville_mt9v113_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("sensor_power_enable(\"8921_l9\", 2.8V) FAILED %d\n", rc); goto init_fail; } udelay(50); rc = camera_sensor_power_enable("8921_lvs6", 1800000, ®_8921_lvs6); pr_info("sensor_power_enable(\"8921_lvs6\", 1.8V) == %d\n", rc); if (rc < 0) goto init_fail; udelay(50); rc = camera_sensor_power_enable("8921_l8", 2800000, ®_8921_l8); pr_info("sensor_power_enable(\"8921_l8\", 2.8V) == %d\n", rc); if (rc < 0) goto init_fail; udelay(50); rc = gpio_request(VILLE_GPIO_V_LCMIO_1V8_EN, "CAM_D1V8_EN"); pr_info("ville_mt9v113_vreg_on %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, 1); gpio_free(VILLE_GPIO_V_LCMIO_1V8_EN); udelay(50); 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, 1); msleep(2); gpio_free(VILLE_GPIO_CAM2_RSTz); udelay(50); init_fail: return rc; }
static int ville_csi_vreg_on(void) { pr_info("%s\n", __func__); return camera_sensor_power_enable("8921_l2", 1200000, ®_8921_l2); }
static int ville_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(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); 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(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 lcmio_hi_fail; } gpio_direction_output(VILLE_GPIO_V_LCMIO_1V8_EN, 1); gpio_free(VILLE_GPIO_V_LCMIO_1V8_EN); 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; }