示例#1
0
int32_t msm_camera_flash_led_enable(void)
{
    int32_t gpio_val;
    int32_t rc = 0;
    pr_err("%s: entry: flash_led_enable=%d\n", __func__, flash_led_enable);

    if (flash_led_enable==1)
    {
        //MSM_LED_MODE_ON
        gpio_val = 1;
        rc = msm_camera_flash_set_led_gpio(gpio_val);

    }
    else if(flash_led_enable==2)
    {
      //MSM_LED_MODE_AUTO
       if(zte_get_flash_auto_flag_value()== 1)
	 {
	    gpio_val = 1;
            rc = msm_camera_flash_set_led_gpio(gpio_val);
          }  
	}

	return rc;
}
示例#2
0
/*
 * Refer to MSM_CAM_IOCTL_FLASH_LED_CFG used by mm-camera in user space
 * flash_led_enable is set in apps's menu item selected by user
 * 0: disable Flash LED
 * 1: enable Flash LED
 */
int32_t msm_camera_flash_set_led_state(struct msm_camera_sensor_flash_data *fdata,
		unsigned led_state)
{
    int32_t rc = 0;

	pr_err("%s: led_state: %d,fdata->flash_type=%d\n", __func__, led_state,fdata->flash_type);

    if (fdata->flash_type != MSM_CAMERA_FLASH_LED)
    {
		return -ENODEV;
    }

    switch(led_state)
    {
        case MSM_CAMERA_LED_OFF:
			if( __gpio_get_value(MSM_CAMERA_FLASH_LED_GPIO))
			msm_camera_flash_set_led_gpio(0);
            break;

        case MSM_CAMERA_LED_LOW:
			if (flash_led_enable==1)
            {//MSM_LED_MODE_ON
              msm_camera_set_flash_torch_mode(5);
            }
		    else if(flash_led_enable==2)
		    {
		      //MSM_LED_MODE_AUTO
		       if(zte_get_flash_auto_flag_value()== 1)
			   {
		          msm_camera_set_flash_torch_mode(5);
		       }  
			}
			
			break;
			
        case MSM_CAMERA_LED_HIGH:
            msm_camera_flash_led_enable();
            break;

        case MSM_CAMERA_LED_RELEASE:
			if( __gpio_get_value(MSM_CAMERA_FLASH_LED_GPIO))
			 msm_camera_flash_set_led_gpio(0);
            break;

        default:
            rc = -EFAULT;
			pr_err("%s: rc=%d\n", __func__, rc);

            return rc;
    }

    return rc;
}
示例#3
0
/*
 * External Function
 */
int32_t msm_camera_flash_led_disable(void)
{

    int32_t gpio_val;
    int32_t rc;
    gpio_val = 0;
    rc = msm_camera_flash_set_led_gpio(gpio_val);

    return rc;
}
示例#4
0
/*
 * External Function
 */
int32_t msm_camera_flash_led_disable(void)
{
    int32_t gpio_val;
    int32_t rc;

    CDBG("%s: entry\n", __func__);

    gpio_val = 0;
    rc = msm_camera_flash_set_led_gpio(gpio_val);

    return rc;
}
示例#5
0
/*
 * External Function
 */
int32_t msm_camera_flash_led_enable(void)
{
    int32_t gpio_val;
    int32_t rc = 0;

    CDBG("%s: entry: flash_led_enable=%d\n", __func__, flash_led_enable);

    if (flash_led_enable)
    {
        gpio_val = 1;
        rc = msm_camera_flash_set_led_gpio(gpio_val);
    }

    return rc;
}
示例#6
0
int32_t msm_camera_flash_set_led_mode(struct msm_camera_sensor_flash_data *fdata,
                                                 unsigned led_mode)
{
    int32_t rc = 0;

    pr_err("%s: led_mode: %d\n", __func__, led_mode);

   if(fdata)
   {
	    if (fdata->flash_type != MSM_CAMERA_FLASH_LED)
	    {
	             pr_err("%s: flash type not support\n", __func__);
			return -ENODEV;
	    }
   }

    switch(led_mode)
    {
        case MSM_LED_MODE_OFF:
	     msm_camera_flash_set_led_gpio(0);
            flash_led_enable = 0;
		break;

        case MSM_LED_MODE_ON:
            flash_led_enable = 1;
		break;

	case MSM_LED_MODE_AUTO:
            flash_led_enable = 2;
		break;

	case MSM_LED_MODE_TORCH:
		msm_camera_set_flash_torch_mode(13);
		break;

	default:
            //flash_led_enable = 0;
		rc = -EFAULT;
            CDBG("%s: rc=%d\n", __func__, rc);
            return rc;
    }

    return rc;
}