static void vt_cam_ldo_power_off(void) { printk(KERN_DEBUG "[S5K6B2YX] %s: In\n", __func__); /* VT_CAM_1P8 */ if (l21) { int ret = regulator_disable(l21); if (ret) printk(KERN_DEBUG "error disabling regulator 8921_l21\n"); } usleep(400); /* CAM_SENSOR_2.8V (CIS 2.8V)*/ if (system_rev < 5) { printk(KERN_DEBUG "[S5K6B2YX] %s: GPIO_CAM_A_EN: 0\n", __func__); gpio_ref_count--; printk(KERN_DEBUG "[S5K6B2YX] %s: gpio ref cnt %d\n", __func__, gpio_ref_count); if (gpio_ref_count == 0) { printk(KERN_DEBUG "[S5K6B2YX] %s: Turning off GPIO_CAM_A_EN\n", __func__); pmic_gpio_ctrl(GPIO_CAM_A_EN, 0); } else { pr_err("[S5K6B2YX] %s: gpio %d, dont turn off"\ " GPIO_CAM_A_EN, other camera is in use!!", __func__, gpio_ref_count); } } else { pmic_gpio_ctrl(GPIO_CAM_VT_EN, 0); printk(KERN_DEBUG "[S5K6B2YX] %s: GPIO_CAM_VT_EN: 0\n", __func__); } }
static void vt_cam_ldo_power_on(void) { int ret = 0; printk(KERN_DEBUG "[S5K6B2YX] %s: In\n", __func__); #ifdef CONFIG_CAMERA_SW_I2C gpio_set_value_cansleep(GPIO_VT_CAM_SDA, 1); gpio_set_value_cansleep(GPIO_VT_CAM_SCL, 1); #endif /* CAM_SENSOR_2.8V (CIS 2.8V)*/ if (system_rev < 5) { printk(KERN_DEBUG "[S5K6B2YX] %s: GPIO_CAM_A_EN: 1\n", __func__); if (gpio_ref_count == 0) pmic_gpio_ctrl(GPIO_CAM_A_EN, 1); gpio_ref_count++; printk(KERN_DEBUG "[S5K6B2YX] %s: gpio ref cnt %d\n", __func__, gpio_ref_count); } else { pmic_gpio_ctrl(GPIO_CAM_VT_EN, 1); printk(KERN_DEBUG "[S5K6B2YX] %s: GPIO_CAM_VT_EN: 1\n", __func__); } /* VT_CAM_1P8 */ l21 = regulator_get(NULL, "8921_l21"); regulator_set_voltage(l21, 1800000, 1800000); ret = regulator_enable(l21); if (ret) printk(KERN_DEBUG "error enabling regulator 8921_l21\n"); }
static void cam_ldo_power_off(void) { int ret = 0; printk(KERN_DEBUG "[JC] %s: In\n", __func__); /* CAM_HOST_1.8V*/ if (system_rev == 0) { if (lvs5) { ret = regulator_disable(lvs5); if (ret) printk(KERN_DEBUG "error disabling regulator 8921_lvs5\n"); } } else { if (l35) { ret = regulator_disable(l35); if (ret) printk(KERN_DEBUG "error disabling regulator 8917_l35\n"); } } /* CAM_DVDD1.1V_1.2V*/ if (l28) { ret = regulator_disable(l28); if (ret) printk(KERN_DEBUG "error disabling" \ " regulator 8921_l28\n"); } if (system_rev < 6) { if (gpio_ref_count == 0) { /* CAM_SENSOR_2.8V (CIS 2.8V)*/ printk(KERN_DEBUG "[JC] %s: Turning off GPIO_CAM_A_EN\n", __func__); pmic_gpio_ctrl(GPIO_CAM_A_EN, 0); } else { pr_err("[JC] %s: gpio %d, dont turn off GPIO_CAM_A_EN,"\ "other camera is in use!!", __func__, gpio_ref_count); } } else { pmic_gpio_ctrl(GPIO_CAM_A_EN2, 0); printk(KERN_DEBUG "[JC] %s: GPIO_CAM_A_EN2: 0\n", __func__); } /* CAM_ISP_CORE_1.2V*/ if (system_rev < 3) { pmic_gpio_ctrl(GPIO_CAM_CORE_EN, 0); } else { if (smps_s8) { ret = regulator_disable((smps_s8)); if (ret) printk(KERN_DEBUG "error disabling regulator smps_s8\n"); } } }
static void cam_ldo_af_power_off(void) { /* CAM_AF_2.8V */ if (system_rev < 6) { gpio_ref_count--; printk(KERN_DEBUG "[JC] %s: gpio ref cnt %d\n", __func__, gpio_ref_count); } printk(KERN_DEBUG "[JC] %s: Turning off GPIO_CAM_AF_EN\n", __func__); pmic_gpio_ctrl(GPIO_CAM_AF_EN, 0); usleep(10); }
static void cam_ldo_power_off_sub(void) { int ret = 0; printk(KERN_DEBUG "[Fortius] %s: Sub Off\n", __func__); pmic_gpio_ctrl(GPIO_CAM_AF_EN, 0); udelay(1*1000); if (l35) { ret = regulator_disable(l35); if (ret) printk(KERN_DEBUG "error disabling regulator 8917_l35\n"); } }
static void cam_ldo_power_on(void) { int ret = 0; printk(KERN_DEBUG "[FORTIUS] %s: In\n", __func__); printk(KERN_DEBUG "[FORTIUS] %s: system_rev=%d\n", __func__, system_rev); pmic_gpio_ctrl(GPIO_CAM_A_EN2, 1); printk(KERN_DEBUG "[FORTIUS] %s: GPIO_CAM_A_EN2: 1\n", __func__); mdelay(1); l28 = regulator_get(NULL, "8921_l28"); regulator_set_voltage(l28, 1100000, 1100000); ret = regulator_enable(l28); if (ret) printk(KERN_DEBUG "error enabling regulator 8921_l28 \n");; mdelay(3); }
void __init apq8064_init_cam(void) { printk(KERN_DEBUG "[JC] %s: In\n", __func__); msm_gpiomux_install(apq8064_cam_common_configs, ARRAY_SIZE(apq8064_cam_common_configs)); /*config gpio*/ /*pm gpio config for sleep state*/ pm8xxx_gpio_config(GPIO_VT_CAM_ID, &cam_init_in_cfg); pm8xxx_gpio_config(GPIO_13M_CAM_RESET, &cam_init_out_cfg); pm8xxx_gpio_config(GPIO_CAM_AF_EN, &cam_init_out_cfg); pm8xxx_gpio_config(GPIO_VT_CAM_STBY, &cam_init_out_cfg); #if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR) #else pm8xxx_gpio_config(GPIO_CAM_ISP_INT, &cam_init_in_cfg); #endif pm8xxx_gpio_config(GPIO_CAM_A_EN2, &cam_init_out_cfg); pm8xxx_gpio_config(GPIO_CAM_SENSOR_DET, &cam_rear_det); /* temp: need to set low because bootloader make high signal. */ pmic_gpio_ctrl(GPIO_CAM_VT_EN, 0); printk(KERN_DEBUG "[S5K6B2YX] %s: GPIO_CAM_VT_EN: 0\n", __func__); if (machine_is_apq8064_cdp()) { sensor_board_info_imx074.mount_angle = 0; sensor_board_info_mt9m114.mount_angle = 0; } else if (machine_is_apq8064_liquid()) sensor_board_info_imx074.mount_angle = 180; spi_register_board_info(jc_spi_info, ARRAY_SIZE(jc_spi_info)); platform_device_register(&msm_camera_server); #if !defined (CONFIG_CAMERA_USE_GSBI7) platform_device_register(&msm8960_device_i2c_mux_gsbi4); #endif platform_device_register(&msm8960_device_csiphy0); platform_device_register(&msm8960_device_csiphy1); platform_device_register(&msm8960_device_csid0); platform_device_register(&msm8960_device_csid1); platform_device_register(&msm8960_device_ispif); platform_device_register(&msm8960_device_vfe); platform_device_register(&msm8960_device_vpe); }
static void cam_ldo_power_on(void) { int ret = 0; printk(KERN_DEBUG "[FORTIUS] %s: On\n", __func__); pmic_gpio_ctrl(GPIO_CAM_AF_EN, 1); usleep(2*1000); if (system_rev == 0) { lvs5 = regulator_get(NULL, "8921_lvs5"); ret = regulator_enable(lvs5); if (ret) printk(KERN_DEBUG "error enabling regulator 8921_lvs5\n"); } else { l35 = regulator_get(NULL, "8917_l35"); regulator_set_voltage(l35, 1800000, 1800000); ret = regulator_enable(l35); if (ret) printk(KERN_DEBUG "error enabling regulator 8917_l35\n"); } }
static void cam_ldo_power_on(void) { int ret = 0; int cam_type = 0; printk(KERN_DEBUG "[JC] %s: In\n", __func__); printk(KERN_DEBUG "[JC] %s: system_rev=%d\n", __func__, system_rev); /* CAM_ISP_CORE_1.2V*/ if (system_rev < 3) { pmic_gpio_ctrl(GPIO_CAM_CORE_EN, 1); } else { if (!smps_s8) { smps_s8 = regulator_get(NULL, "8921_s8"); if (IS_ERR(smps_s8)) { printk(KERN_DEBUG "could not get smps_s8, rc = %ld\n", PTR_ERR(smps_s8)); smps_s8 = NULL; return; } ret = regulator_set_voltage(smps_s8, 1200000, 1200000); if (ret) { printk(KERN_DEBUG "set_voltage failed"\ "for smps_s8, rc=%d\n", ret); return; } } ret = regulator_enable(smps_s8); if (ret) printk(KERN_DEBUG "error enabling regulator smps_s8\n"); } usleep(1*1000); /* CAM_SENSOR_2.8V (CIS 2.8V)*/ if (system_rev < 6) { if (gpio_ref_count == 0) pmic_gpio_ctrl(GPIO_CAM_A_EN, 1); gpio_ref_count++; printk(KERN_DEBUG "[JC] %s: gpio ref cnt %d\n", __func__, gpio_ref_count); } else { pmic_gpio_ctrl(GPIO_CAM_A_EN2, 1); printk(KERN_DEBUG "[JC] %s: GPIO_CAM_A_EN2: 1\n", __func__); } cam_type = gpio_get_value(GPIO_CAM_SENSOR_DET); printk(KERN_DEBUG "[JC] %s: SENSOR TYPE = %d\n", __func__, cam_type); /* CAM_DVDD1.1V_1.2V*/ l28 = regulator_get(NULL, "8921_l28"); if (cam_type == 1) { printk(KERN_DEBUG "[JC] %s: Sony Sensor 1.1V", __func__); regulator_set_voltage(l28, 1100000, 1100000); } else { printk(KERN_DEBUG "[JC] %s: LSI Sensor 1.2V", __func__); regulator_set_voltage(l28, 1200000, 1200000); } ret = regulator_enable(l28); if (ret) printk(KERN_DEBUG "error enabling regulator 8921_l28\n"); /* CAM_AF_2.8V */ pmic_gpio_ctrl(GPIO_CAM_AF_EN, 1); usleep(2*1000); /* CAM_HOST_1.8V*/ if (system_rev == 0) { lvs5 = regulator_get(NULL, "8921_lvs5"); ret = regulator_enable(lvs5); if (ret) printk(KERN_DEBUG "error enabling regulator 8921_lvs5\n"); } else { l35 = regulator_get(NULL, "8917_l35"); #ifdef CONFIG_MACH_JF_DCM regulator_set_voltage(l35, 1850000, 1850000); #else regulator_set_voltage(l35, 1800000, 1800000); #endif ret = regulator_enable(l35); if (ret) printk(KERN_DEBUG "error enabling regulator 8917_l35\n"); } usleep(2*1000); }
static int pmic_set_func(uint8_t pmic_gpio, uint8_t onoff) { pmic_gpio_ctrl(PM8921_GPIO_PM_TO_SYS(pmic_gpio), onoff); return 0; }