Пример #1
0
static int32_t ov10820_platform_probe(struct platform_device *pdev)
{
    int32_t rc = 0;
    const struct of_device_id *match;

    match = of_match_device(ov10820_dt_match, &pdev->dev);
    if (match) {
        rc = msm_sensor_platform_probe(pdev, match->data);
    } else {
        pr_err("%s:%d failed match device\n", __func__, __LINE__);
        return -EINVAL;
    }

    ov10820_kobject = kobject_create_and_add("ov10820", fs_kobj);
    if (ov10820_kobject == NULL) {
        pr_err("%s: unable to create kobject!\n", __func__);
        return -EINVAL;
    }

    rc = sysfs_create_group(ov10820_kobject, &ov10820_group);
    if (rc) {
        pr_err("%s: unable to create kobject group!\n", __func__);
        kobject_del(ov10820_kobject);
        ov10820_kobject = NULL;
    }

    return rc;
}
static int32_t ov2722_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(ov2722_dt_match, &pdev->dev);
	if (match)
	
	{
		if(msm_sensor_get_boardinfo(pdev->dev.of_node))
		{
			ov2722_s_ctrl.power_setting_array.power_setting = ov2722_sub_power_setting_XC;
			ov2722_s_ctrl.power_setting_array.size = ARRAY_SIZE(ov2722_sub_power_setting_XC);
		}
	
		rc = msm_sensor_platform_probe(pdev, match->data);
	
	}
	
	else {
		pr_err("%s:%d match is null\n", __func__, __LINE__);
		rc = -EINVAL;
	}
	pr_info("%s %s\n", __func__, dev_name(&pdev->dev));
	return rc;
}
static int32_t ar0261_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
#ifdef SET_ALT_I2C_ADDRESS
	struct msm_sensor_fn_t *ar0261_sensor_func_tbl;
#endif

	match = of_match_device(ar0261_dt_match, &pdev->dev);

	if (match) {
		rc = msm_sensor_platform_probe(pdev, match->data);
	} else {
		pr_err("%s:%d failed match device\n", __func__, __LINE__);
		return -EINVAL;
	}
#ifdef SET_ALT_I2C_ADDRESS
	/* highjack power up to facilitate alternate I2C address */
	ar0261_sensor_func_tbl = kzalloc(sizeof(struct msm_sensor_fn_t),
		GFP_KERNEL);
	if (!ar0261_sensor_func_tbl) {
		pr_err("%s:%d failed nomem\n", __func__, __LINE__);
		return -ENOMEM;
	}
	memcpy(ar0261_sensor_func_tbl,
		ar0261_s_ctrl.func_tbl,
		sizeof(struct msm_sensor_fn_t));

	ar0261_sensor_func_tbl->sensor_match_id = ar0261_sensor_match_id;
	ar0261_s_ctrl.func_tbl = ar0261_sensor_func_tbl;
#endif

	return rc;
}
Пример #4
0
static int32_t imx135_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(imx135_dt_match, &pdev->dev);

	if (match) {
		if (of_property_read_bool(pdev->dev.of_node,
					"qcom,mot-cam-usedevboard")
				== true)
			imx135_devboard_config = true;

		imx135_s_ctrl.sensor_otp.otp_info = devm_kzalloc(&pdev->dev,
				IMX135_EEPROM_SIZE, GFP_KERNEL);
		if (imx135_s_ctrl.sensor_otp.otp_info == NULL) {
			pr_err("%s: Unable to allocate memory for EEPROM!\n",
					__func__);
			return -ENOMEM;
		}

		imx135_s_ctrl.sensor_otp.size = IMX135_EEPROM_SIZE;

		rc = msm_sensor_platform_probe(pdev, match->data);
	} else {
		pr_err("%s: Failed to match device tree!\n", __func__);
		rc = -EINVAL;
	}

	return rc;
}
Пример #5
0
static int32_t imx219_asus_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	int i;
	pr_err("%s E\n",__func__);
	for(i=0; i<ARRAY_SIZE(imx219_asus_power_setting); i++){
		if((imx219_asus_power_setting[i].seq_val == SENSOR_GPIO_CAM_1P8 )&&
			(imx219_asus_power_setting[i].config_val == GPIO_OUT_HIGH)){
				if(g_ASUS_hwID < A500KL_SR2){
					//After SR2, EE change Capacitance
					imx219_asus_power_setting[i].delay = 70;
				}else{
					imx219_asus_power_setting[i].delay = 10;
				}
			pr_err("%dth is 1P8 PULL HIGH and delay %dms\n",
				i,imx219_asus_power_setting[i].delay);
			break;
		}
	}
	match = of_match_device(imx219_asus_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	pr_err("%s X rc = %d\n",__func__,rc);
	return rc;
}
Пример #6
0
static int32_t sr130pc20_platform_probe(struct platform_device *pdev)
{
	int32_t rc;
	const struct of_device_id *match;
	match = of_match_device(sr130pc20_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
Пример #7
0
static int32_t t4k37_qtech_f4k37ab_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(t4k37_qtech_f4k37ab_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
static int32_t s5k4e1_liteon_affli_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(s5k4e1_liteon_affli_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
static int32_t ov13850_1140m_platform_probe(struct platform_device *pdev)
{
    int32_t rc = 0;
    const struct of_device_id *match;
    match = of_match_device(ov13850_1140m_dt_match, &pdev->dev);
    rc = msm_sensor_platform_probe(pdev, match->data);
    return rc;
}
Пример #10
0
static int32_t bf3905_platform_probe(struct platform_device *pdev)
{
	int32_t rc;
	const struct of_device_id *match;
	CDBG("%s, E.", __func__);
	match = of_match_device(bf3905_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
Пример #11
0
static int32_t ov8835_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	printk("ov8835_platform_probe zx!\n");
	match = of_match_device(ov8835_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);

	return rc;
}  
Пример #12
0
static int32_t imx119_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(imx119_dt_match, &pdev->dev);
	if(!match)
		return -EINVAL;
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
Пример #13
0
static int32_t imx135_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	pr_err("%s: E\n", __func__);
	match = of_match_device(imx135_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	pr_err("%s: X\n", __func__);
	return rc;
}
static int32_t s5k4h5ya_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	CDBG("E\n");
	match = of_match_device(s5k4h5ya_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	CDBG("X\n");
	return rc;
}
Пример #15
0
static int mt9m114b_platform_probe(struct platform_device *pdev)
{
	int rc = 0;
	const struct of_device_id *match;

	CDBG("%s E\n", __func__);
	match = of_match_device(mt9m114b_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	CDBG("%s: X, rc = %d\n", __func__, rc);
	return rc;
}
static int32_t ov13850_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(ov13850_dt_match, &pdev->dev);
	/*htc start: clean_li added for klocwork issue 3053*/
	if(!match)
		return -ENODEV;
	/*htc end: clean_li added for klocwork issue 3053*/
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
Пример #17
0
static int32_t t4k71_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;

	match = of_match_device(t4k71_dt_match, &pdev->dev);

	rc = msm_sensor_platform_probe(pdev, match->data);
	if (!rc)
		pr_info("%s:%d Success", __func__, __LINE__);
	return rc;
}
Пример #18
0
static int32_t ov5670_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(ov5670_dt_match, &pdev->dev);
	if(!match)
	{
		  pr_err(" %s failed ",__func__);
		  return -ENODEV;
	 }
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
Пример #19
0
static int32_t mt9m114_platform_probe(struct platform_device *pdev)
{
	int32_t rc;
	const struct of_device_id *match;
	match = of_match_device(mt9m114_dt_match, &pdev->dev);
	if (match)
		rc = msm_sensor_platform_probe(pdev, match->data);
	else {
		pr_err("%s:%d match is null\n", __func__, __LINE__);
		rc = -EINVAL;
	}
	return rc;
}
static int32_t s5k5e_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(s5k5e_dt_match, &pdev->dev);
	
	if (!match) {
		pr_err("%s:%d match is NULL\n", __func__, __LINE__);
		return -EINVAL;
	}
	
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
static int32_t ov2722_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(ov2722_dt_match, &pdev->dev);
	/* HTC_START_sungfeng klocwork */
	if (!match) {
		pr_err("%s:%d\n", __func__, __LINE__);
		return -EINVAL;
	}
	/* HTC_END */
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
Пример #22
0
static int32_t MT9V113_platform_probe(struct platform_device *pdev)
{
	int32_t rc;
	const struct of_device_id *match;
	match = of_match_device(MT9V113_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	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;
}
Пример #23
0
static int32_t imx091_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(imx091_dt_match, &pdev->dev);
    /* LGE_CHANGE_S : WBT 2014-03-21 [email protected] */
    if(!match)
    {
      pr_err(" %s failed ",__func__);
      return -ENODEV;
    }
    /* LGE_CHANGE_E : WBT 2014-03-21 [email protected] */
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
static int32_t hi543_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(hi543_dt_match, &pdev->dev);
/* LGE_CHANGE_S : WBT, 2013-5-31, [email protected] */
	if(!match)
	{
		  pr_err(" %s failed ",__func__);
		  return -ENODEV;
	 }
/* LGE_CHANGE_E : WBT, 2013-5-31, [email protected] */
	rc = msm_sensor_platform_probe(pdev, match->data);
	return rc;
}
static int32_t imx134_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	struct device   *cam_dev_back;
	struct device   *cam_dev_front;

	match = of_match_device(imx134_dt_match, &pdev->dev);
	camera_class = class_create(THIS_MODULE, "camera");
	if (IS_ERR(camera_class))
		pr_err("failed to create device cam_dev_rear!\n");

	rc = msm_sensor_platform_probe(pdev, match->data);
	printk("%s00:%d\n", __func__, __LINE__);

	printk("%s01:%d\n", __func__, __LINE__);

	cam_dev_back = device_create(camera_class, NULL,
				     1, NULL, "rear");
	if (IS_ERR(cam_dev_back)) {
		printk("Failed to create cam_dev_back device!\n");
	}

	if (device_create_file(cam_dev_back, &dev_attr_rear_camtype) < 0) {
		printk("Failed to create device file!(%s)!\n",
		       dev_attr_rear_camtype.attr.name);
	}
	if (device_create_file(cam_dev_back, &dev_attr_rear_camfw) < 0) {
		printk("Failed to create device file!(%s)!\n",
		       dev_attr_rear_camfw.attr.name);
	}

	cam_dev_front = device_create(camera_class, NULL,
				      2, NULL, "front");
	if (IS_ERR(cam_dev_front)) {
		printk("Failed to create cam_dev_front device!");
	}

	if (device_create_file(cam_dev_front, &dev_attr_front_camtype) < 0) {
		printk("Failed to create device file!(%s)!\n",
		       dev_attr_front_camtype.attr.name);
	}
	if (device_create_file(cam_dev_front, &dev_attr_front_camfw) < 0) {
		printk("Failed to create device file!(%s)!\n",
		       dev_attr_front_camfw.attr.name);
	}
	return rc;
}
Пример #26
0
static int32_t s5k4e5ya_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	match = of_match_device(s5k4e5ya_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
// Implementation KTD267 flashIC
#if defined(CONFIG_MACH_VIENNAEUR) || defined(CONFIG_MACH_LT03EUR)\
	|| defined(CONFIG_MACH_LT03SKT)	|| defined(CONFIG_MACH_LT03KTT)\
	|| defined(CONFIG_MACH_LT03LGT)
	camera_class = class_create(THIS_MODULE, "camera");
	if (IS_ERR(camera_class))
		pr_err("failed to create device cam_dev_rear!\n");
#endif
	return rc;
}
Пример #27
0
static int32_t hi258_platform_probe(struct platform_device *pdev)
{
	int32_t rc;
	const struct of_device_id *match;
	match = of_match_device(hi258_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);

	if(rc < 0){
		pr_err("%s: %d failed\n",__func__,__LINE__);
		return -EIO;
	}

	rc = hi258_sysfs_add_symlink(&pdev->dev);

	return rc;
}
static int32_t imx214_800m_fov87_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	static int probe_success = 0; 

	if (probe_success){
		pr_info("%s:probe_success %d skip %s\n", __func__, probe_success, dev_name(&pdev->dev));
		return -ENODEV;
	}
	match = of_match_device(imx214_800m_fov87_dt_match, &pdev->dev);
	rc = msm_sensor_platform_probe(pdev, match->data);
	if (rc ==0)
		probe_success = 1;

	return rc;
}
Пример #29
0
static int32_t hi544_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	CDBG("%s E\n", __func__);
	match = of_match_device(hi544_dt_match, &pdev->dev);

	if(!match)
	{
	      pr_err(" %s failed ",__func__);
	      return -ENODEV;
    }
	rc = msm_sensor_platform_probe(pdev, match->data);

	CDBG("%s: X, rc = %d\n", __func__, rc);
	return rc;
}