static int ce147_sensor_power_set(enum v4l2_power power)
{
	static enum v4l2_power c_previous_pwr = V4L2_POWER_OFF;

	int err = 0;

	printk(CE147_MOD_NAME "ce147_sensor_power_set is called...[%x] (0:OFF, 1:ON)\n", power);

	switch (power) {
	case V4L2_POWER_OFF:
		err = ce147_disable_gpio();
		break;

	case V4L2_POWER_ON:
		isp_configure_interface(NULL,&ce147_if_config);

		if (c_previous_pwr != V4L2_POWER_OFF) 
			err = ce147_disable_gpio();

		err = ce147_enable_gpio();       
		break;

	case V4L2_POWER_STANDBY:
		break;

	case V4L2_POWER_RESUME:
		break;
	}

	c_previous_pwr = power;

	return err;
}
Ejemplo n.º 2
0
static int ce147_sensor_power_set(enum v4l2_power power)
{
  static enum v4l2_power c_previous_pwr = V4L2_POWER_OFF;

  int err = 0;

  printk("ce147_sensor_power_set is called...[%x]\n", power);

  switch (power) 
  {
    case V4L2_POWER_OFF:
    {
      err = ce147_disable_gpio();
    }
    break;

    case V4L2_POWER_ON:
    {
      isp_configure_interface(0,&ce147_if_config);

      err = ce147_enable_gpio();    
	if(err)
	{
	       printk("ce147_sensor_power_set RETRY...[%x]\n", err);	
	       err = ce147_disable_gpio();	
		err = ce147_enable_gpio();    	
	}			  
    }
    break;

    case V4L2_POWER_STANDBY:
      break;

    case V4L2_POWER_RESUME:
      break;
  }
  
  c_previous_pwr = power;

  return err;
}