int32_t msm_camera_flash_set_led_state( struct msm_camera_sensor_flash_data *fdata, unsigned led_state) { int32_t rc; CDBG("flash_set_led_state: %d flash_sr_type=%d\n", led_state, fdata->flash_src->flash_sr_type); if (fdata->flash_type != MSM_CAMERA_FLASH_LED) return -ENODEV; switch (fdata->flash_src->flash_sr_type) { case MSM_CAMERA_FLASH_SRC_PMIC: rc = msm_camera_flash_pmic(&fdata->flash_src->_fsrc.pmic_src, led_state); break; case MSM_CAMERA_FLASH_SRC_PWM: rc = msm_camera_flash_pwm(&fdata->flash_src->_fsrc.pwm_src, led_state); break; case MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER: rc = msm_camera_flash_current_driver( &fdata->flash_src->_fsrc.current_driver_src, led_state); break; default: rc = -ENODEV; break; } return rc; }
int32_t msm_camera_flash_set_led_state( struct msm_camera_sensor_flash_data *fdata, unsigned led_state) { int32_t rc; CDBG("flash_set_led_state: %d flash_sr_type=%d\n", led_state, fdata->flash_src->flash_sr_type); if (fdata->flash_type != MSM_CAMERA_FLASH_LED) return -ENODEV; switch (fdata->flash_src->flash_sr_type) { case MSM_CAMERA_FLASH_SRC_PMIC: rc = msm_camera_flash_pmic(&fdata->flash_src->_fsrc.pmic_src, led_state); break; case MSM_CAMERA_FLASH_SRC_PWM: rc = msm_camera_flash_pwm(&fdata->flash_src->_fsrc.pwm_src, led_state); break; #ifdef CONFIG_MACH_SEMC_ZEUS case MSM_CAMERA_FLASH_SRC_LED: rc = msm_camera_flash_gpio(fdata->flash_src->_fsrc.gpio_led_src, led_state); break; #endif /* CONFIG_MACH_SEMC_ZEUS */ default: rc = -ENODEV; break; } return rc; }
int32_t msm_camera_flash_set_led_state( struct msm_camera_sensor_flash_data *fdata, unsigned led_state) { int32_t rc; if (fdata->flash_type != MSM_CAMERA_FLASH_LED || fdata->flash_src == NULL) { pr_err("msm_camera_flash_set_led_state: ERR: fdata->flash_type or fdata->flash_src is invalid !\n"); return -ENODEV; } switch (fdata->flash_src->flash_sr_type) { case MSM_CAMERA_FLASH_SRC_PMIC: CDBG("msm_camera_flash_set_led_state: MSM_CAMERA_FLASH_SRC_PMIC \n"); rc = msm_camera_flash_pmic(&fdata->flash_src->_fsrc.pmic_src, led_state); break; case MSM_CAMERA_FLASH_SRC_PWM: CDBG("msm_camera_flash_set_led_state: MSM_CAMERA_FLASH_SRC_PWM \n"); rc = msm_camera_flash_pwm(&fdata->flash_src->_fsrc.pwm_src, led_state); break; case MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER: CDBG("msm_camera_flash_set_led_state: MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER \n"); rc = msm_camera_flash_current_driver( &fdata->flash_src->_fsrc.current_driver_src, led_state); break; case MSM_CAMERA_FLASH_SRC_EXT: CDBG("msm_camera_flash_set_led_state: MSM_CAMERA_FLASH_SRC_EXT \n"); rc = msm_camera_flash_external( &fdata->flash_src->_fsrc.ext_driver_src, led_state); break; case MSM_CAMERA_FLASH_SRC_LED1: CDBG("msm_camera_flash_set_led_state: MSM_CAMERA_FLASH_SRC_LED1 \n"); rc = msm_camera_flash_led( &fdata->flash_src->_fsrc.ext_driver_src, led_state); break; default: rc = -ENODEV; break; } CDBG("msm_camera_flash_set_led_state: End, rc = %d \n", rc); return rc; }
int32_t msm_camera_flash_set_led_state( struct msm_camera_sensor_flash_data *fdata, unsigned led_state) { int32_t rc; rc = -ENODEV; if (fdata->flash_type != MSM_CAMERA_FLASH_LED || fdata->flash_src == NULL) return -ENODEV; switch (fdata->flash_src->flash_sr_type) { case MSM_CAMERA_FLASH_SRC_PMIC: rc = msm_camera_flash_pmic(&fdata->flash_src->_fsrc.pmic_src, led_state); break; case MSM_CAMERA_FLASH_SRC_PWM: rc = msm_camera_flash_pwm(&fdata->flash_src->_fsrc.pwm_src, led_state); break; case MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER: rc = msm_camera_flash_current_driver( &fdata->flash_src->_fsrc.current_driver_src, led_state); break; case MSM_CAMERA_FLASH_SRC_EXT: rc = msm_camera_flash_external( &fdata->flash_src->_fsrc.ext_driver_src, led_state); break; case MSM_CAMERA_FLASH_SRC_LED1: rc = msm_camera_flash_led( &fdata->flash_src->_fsrc.ext_driver_src, led_state); break; /* OPPO 2013-02-04 kangjian added begin for oppo_led_control */ case MSM_CAMERA_FLASH_SRC_OPPO: if(fdata->flash_src->_fsrc.oppo_src.led_control) rc = fdata->flash_src->_fsrc.oppo_src.led_control(led_state); break; /* OPPO 2013-02-04 kangjian added end */ default: rc = -ENODEV; break; } return rc; }
int32_t msm_camera_flash_set_led_state( struct msm_camera_sensor_flash_data *fdata, unsigned led_state) { int32_t rc; if (fdata->flash_type != MSM_CAMERA_FLASH_LED || fdata->flash_src == NULL) return -ENODEV; switch (fdata->flash_src->flash_sr_type) { case MSM_CAMERA_FLASH_SRC_PMIC: rc = msm_camera_flash_pmic(&fdata->flash_src->_fsrc.pmic_src, led_state); break; case MSM_CAMERA_FLASH_SRC_PWM: rc = msm_camera_flash_pwm(&fdata->flash_src->_fsrc.pwm_src, led_state); break; case MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER: rc = msm_camera_flash_current_driver( &fdata->flash_src->_fsrc.current_driver_src, led_state); break; case MSM_CAMERA_FLASH_SRC_EXT: rc = msm_camera_flash_external( &fdata->flash_src->_fsrc.ext_driver_src, led_state); break; case MSM_CAMERA_FLASH_SRC_LED1: rc = msm_camera_flash_led( &fdata->flash_src->_fsrc.ext_driver_src, led_state); break; default: rc = -ENODEV; break; } return rc; }
int32_t msm_camera_flash_set_led_state( struct msm_camera_sensor_flash_data *fdata, unsigned led_state) { int32_t rc; CDBG("flash_set_led_state: %d flash_sr_type=%d\n", led_state, fdata->flash_src->flash_sr_type); if (fdata->flash_type != MSM_CAMERA_FLASH_LED) return -ENODEV; switch (fdata->flash_src->flash_sr_type) { case MSM_CAMERA_FLASH_SRC_PMIC: rc = msm_camera_flash_pmic(&fdata->flash_src->_fsrc.pmic_src, led_state); break; case MSM_CAMERA_FLASH_SRC_PWM: rc = msm_camera_flash_pwm(&fdata->flash_src->_fsrc.pwm_src, led_state); break; case MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER: rc = msm_camera_flash_current_driver( &fdata->flash_src->_fsrc.current_driver_src, led_state); break; #if (defined(CONFIG_MACH_ACER_A5) || defined(CONFIG_MACH_ACER_A4)) && defined(CONFIG_ADP1650_FLASH_DRIVER) case MSM_CAMERA_FLASH_SRC_DRV_IC: rc = msm_camera_flash_drv_ic( &fdata->flash_src->_fsrc.drv_ic_src, led_state); break; #endif default: rc = -ENODEV; break; } return rc; }