int32_t s5k4e5ya_sensor_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int rc = 0;
	struct msm_camera_sensor_info *s_info;

	pr_err("s5k4e5ya_sensor_i2c_probe: enter");

	rc = msm_sensor_i2c_probe(client, id);

	s_info = client->dev.platform_data;
	if (s_info == NULL) {
		pr_err("%s %s NULL sensor data\n", __func__, client->name);
		return -EFAULT;
	}

	if (s_info->actuator_info->vcm_enable) {
		rc = gpio_request(s_info->actuator_info->vcm_pwd,
				"msm_actuator");
		if (rc < 0)
			pr_err("%s: gpio_request:msm_actuator %d failed\n",
				__func__, s_info->actuator_info->vcm_pwd);
		rc = gpio_direction_output(s_info->actuator_info->vcm_pwd, 0);
		if (rc < 0)
			pr_err("%s: gpio:msm_actuator %d direction can't be set\n",
				__func__, s_info->actuator_info->vcm_pwd);
		gpio_free(s_info->actuator_info->vcm_pwd);
	}

	return rc;
}
Ejemplo n.º 2
0
int32_t ar0543_sensor_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int32_t rc = 0;
	struct msm_camera_sensor_info *s_info = NULL;
    struct msm_sensor_ctrl_t *s_ctrl      = NULL;

    //MM-MC-ImplementReadOtpDataFeature-00*{
    if (g_IsFihMainCamProbe == 1)
    {
        printk("ar0543_sensor_i2c_probe: Main camera has probe success before !\n");
        return -EFAULT;
    }

    /* MM-MC-FixMainCameraI2cBusy-00-{ */
    s_ctrl = (struct msm_sensor_ctrl_t *)(id->driver_data);
    s_ctrl->sensor_i2c_addr = 0x6C;
	rc = msm_sensor_i2c_probe(client, id);//Probe for 0x6C
    if(rc < 0){
        pr_err("%s %s_i2c_probe failed\n", __func__, client->name);
        return rc;
    }
    /* MM-MC-FixMainCameraI2cBusy-00-} */
    g_IsFihMainCamProbe = 1;
    printk("ar0543_sensor_i2c_probe: sensor_i2c_addr(0x6e/0x6c) = 0x%x, g_IsFihMainCamProbe = %d.\n", s_ctrl->sensor_i2c_addr, g_IsFihMainCamProbe);
    //MM-MC-ImplementReadOtpDataFeature-00*}
    
	s_info = client->dev.platform_data;
	if (s_info == NULL) {
		pr_err("%s %s NULL sensor data\n", __func__, client->name);
		return -EFAULT;
	}

	return rc;
}
Ejemplo n.º 3
0
int32_t ov2722_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int	rc = 0;
	
	
	int max_probe_count = 1;
	int probe_count = 0;

	pr_info("%s\n", __func__);

sensor_probe_retry:
	rc = msm_sensor_i2c_probe(client, id);
	if(rc >= 0)
		ov2722_sysfs_init();
	else {
		
		probe_count++;
		if(probe_count < max_probe_count) {
			pr_info("%s  apply sensor probe retry mechanism , probe_count=%d\n", __func__, probe_count);
			goto sensor_probe_retry;
		}
	}

	pr_info("%s: rc(%d)\n", __func__, rc);
	return rc;
}
Ejemplo n.º 4
0
int32_t imx081_sensor_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int rc = 0;
	struct msm_sensor_ctrl_t *s_ctrl;
	CDBG("%s", __func__);
	
	rc = msm_sensor_i2c_probe(client, id, &imx081_s_ctrl);
	if (rc < 0) {
		CDBG("%s msm_sensor_i2c_probe failed\n", __func__);
		return rc;
	}
	
	s_ctrl = (struct msm_sensor_ctrl_t *)(id->driver_data);
	if (!s_ctrl) {
		pr_err("%s:%d sensor ctrl structure NULL\n", __func__,
			__LINE__);
		return -EINVAL;
	}
	
	s_ctrl->clk_info = imx081_clk_info;
	s_ctrl->clk_info_size = ARRAY_SIZE(imx081_clk_info);
	
	return rc;
}
Ejemplo n.º 5
0
static int32_t msm_bf3905_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	CDBG("%s, E.", __func__);

	return msm_sensor_i2c_probe(client, id, &bf3905_s_ctrl);
}
int32_t jt8ev5_sensor_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int rc = 0;
	struct msm_camera_sensor_info *s_info;
	
	s_info = client->dev.platform_data;
	if (s_info == NULL) {
		pr_err("%s %s NULL sensor data\n", __func__, client->name);
		return -EFAULT;
	}
      rc = jt8ev5_probe_init_gpio(s_info);
      if(rc < 0)
      	{
		pr_err("%s probe faild--gpio requeset faild-----\n", __func__);
		return -EFAULT;
	  }
	
	rc = msm_sensor_i2c_probe(client, id);
      if(rc < 0)
      	 {
		pr_err("%s probe faild-------\n", __func__);
		goto probe_faided;
	  }
	pr_err("%s probe OK+++++++++++\n", __func__);
	return rc;
	
probe_faided:
	jt8ev5_release_gpio();
	return rc;
}
Ejemplo n.º 7
0
static int32_t msm_hi258_i2c_probe(struct i2c_client *client,
	   const struct i2c_device_id *id)
{
#if 0 //QCT original
	return msm_sensor_i2c_probe(client, id, &hi258_s_ctrl);
#else
	int rc = 0;

	rc = msm_sensor_i2c_probe(client, id, &hi258_s_ctrl);
	if(rc == 0){
		if(hi258_sysfs_add(&client->dev.kobj) < 0)
			pr_err("hi258: failed hi258_sysfs_add\n");
	}

	return rc;
#endif
}
Ejemplo n.º 8
0
/* this never gets called as we have a platfrom driver and not an i2c driver */
int ov680_sensor_standby_i2c_probe(struct i2c_client
				   *client, const struct
				   i2c_device_id *id)
{
#ifndef OV680_SUPPORT_STANDBY
	int rc;
	ov680_info("%s line %d", __func__, __LINE__);
	ov680_skip_fw_load = 1;
	rc = msm_sensor_i2c_probe(client, id);
	ov680_skip_fw_load = 0;
	return rc;
#else
	int rc;
	ov680_info("%s line %d", __func__, __LINE__);
	// Essentially use the original msm power commands to power on
	// On failure, power down MSM style too.
	ov680_props.fw_state = OV680_FW_MISSING;
	ov680_props.state = OV680_STATE_OFF;
	rc = msm_sensor_i2c_probe(client, id);
	if (rc) {
		// In the case of a camera subsystem failure during boot up (probe failed)
		// it is necessary to turn everything on just so it can all be turned off again!
		ov680_props.state = OV680_STATE_UNWIND;
		ov680_sensor_standby_power_up(&ov680_s_ctrl);
		msm_sensor_power_down(&ov680_s_ctrl);
		ov680_props.state = OV680_STATE_OFF;
		return rc;
	}

	rc = ov680_sensor_standby_power_up(&ov680_s_ctrl);

	if (rc) {
		ov680_err("Unable to load firmware - power on failed.\n");
		msm_sensor_power_down(&ov680_s_ctrl);
		ov680_props.state = OV680_STATE_OFF;
		return rc;
	}
	rc = ov680_fwi_run_force(OV680_FWI_FIRMWARE, OV680_FIRMWARE_INIT);
	ov680_props.fw_state = OV680_FW_LOADED;

	ov680_sensor_standby_power_down(&ov680_s_ctrl);

	return rc;
#endif
}
Ejemplo n.º 9
0
int32_t ov2722_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int	rc = 0;
	pr_info("%s\n", __func__);
	rc = msm_sensor_i2c_probe(client, id);
	if(rc >= 0)
		ov2722_sysfs_init();
	pr_info("%s: rc(%d)\n", __func__, rc);
	return rc;
}
static int32_t OV9740_sensor_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int rc = 0;
	rc = msm_sensor_i2c_probe(client,id);
	if(rc == 0)
		{
	camera_proc_file();
	}
	return rc;
}
Ejemplo n.º 11
0
static int32_t msm_gc2235_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	 int32_t rc=0;
	  rc= msm_sensor_i2c_probe(client, id, &gc2235_s_ctrl);
	  
	if(rc==0)
	{
          camera_proc_file();
       }
	
	return rc;
}
Ejemplo n.º 12
0
static int32_t msm_MT9V113_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int32_t rc;
	rc = msm_sensor_i2c_probe(client, id, &MT9V113_s_ctrl);
	if (rc) {
		pr_err("%s: mt9v113 does not exist!\n", __func__);
		mt9v113_detected = 0;
	} else{
		pr_err("%s: mt9v113 probe succeeded!\n", __func__);
		mt9v113_detected = 1;
	}
	return rc;
}
int32_t s5k5ca_sensor_i2c_probe(struct i2c_client *client,
		const struct i2c_device_id *id)
{
	int32_t rc = 0;
	struct msm_sensor_ctrl_t *s_ctrl;

	//printk(" s5k5ca_sensor_i2c_probe()\n");
	rc = msm_sensor_i2c_probe(client, id);

	if (client->dev.platform_data == NULL) {
		printk("%s: NULL sensor data\n", __func__);
		return -EFAULT;
	}

	s_ctrl = client->dev.platform_data;

	return rc;
};
int32_t ov7695_raw_sensor_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int32_t rc = 0;
	struct msm_sensor_ctrl_t *s_ctrl;

	CDBG("%s IN\r\n", __func__);
	s_ctrl = (struct msm_sensor_ctrl_t *)(id->driver_data);
	s_ctrl->sensor_i2c_addr = s_ctrl->sensor_i2c_addr;
	/* PIP settings */
	ov7695_i2c_address = s_ctrl->sensor_i2c_addr;
	CDBG("%s:PIP front camera I2C addr:0x%x\r\n", __func__, ov7695_i2c_address);

	rc = msm_sensor_i2c_probe(client, id);

	if (client->dev.platform_data == NULL) {
		CDBG_HIGH("%s: NULL sensor data\n", __func__);
		return -EFAULT;
	}

	return rc;
}
Ejemplo n.º 15
0
static int32_t msm_mt9m114b_i2c_probe(struct i2c_client *client,
       const struct i2c_device_id *id)
{
       return msm_sensor_i2c_probe(client, id, &mt9m114b_s_ctrl);
}
Ejemplo n.º 16
0
static int32_t msm_ov8835_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	return msm_sensor_i2c_probe(client, id, &ov8835_s_ctrl);
}
Ejemplo n.º 17
0
static int32_t msm_sr130pc20_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	return msm_sensor_i2c_probe(client, id, &sr130pc20_s_ctrl);
}
Ejemplo n.º 18
0
static int32_t msm_t4k37_qtech_f4k37ab_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	return msm_sensor_i2c_probe(client, id, &t4k37_qtech_f4k37ab_s_ctrl);
}
static int32_t msm_imx214_app_i2c_probe(struct i2c_client *client,
                                        const struct i2c_device_id *id)
{
    return msm_sensor_i2c_probe(client, id, &imx214_app_s_ctrl);
}
static int32_t msm_gc2235_imatec_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	return msm_sensor_i2c_probe(client, id, &gc2235_imatec_s_ctrl);
}
Ejemplo n.º 21
0
static int32_t msm_s5k4e5ya_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	return msm_sensor_i2c_probe(client, id, &imx135_s_ctrl);
}
static int32_t msm_hi841_qtech_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	return msm_sensor_i2c_probe(client, id, &hi841_qtech_s_ctrl);
}
static int32_t msm_s5k4e1_liteon_affli_i2c_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	return msm_sensor_i2c_probe(client, id, &s5k4e1_liteon_affli_s_ctrl);
}