Ejemplo n.º 1
0
static int __init bcm2079x_dev_init(void)
{
	return i2c_add_driver(&bcm2079x_driver);
}
Ejemplo n.º 2
0
static int __init rx8581_init(void)
{
	return i2c_add_driver(&rx8581_driver);
}
Ejemplo n.º 3
0
int32_t msm_sensor_probe(struct msm_sensor_ctrl_t *s_ctrl,
		const struct msm_camera_sensor_info *info,
		struct msm_sensor_ctrl *s)
{
	int rc = 0;
	pr_info("%s\n", __func__);

	rc = i2c_add_driver(s_ctrl->sensor_i2c_driver);
	if (rc < 0 || s_ctrl->sensor_i2c_client->client == NULL) {
		rc = -ENOTSUPP;
#if 1	/*  HTC_START */
		pr_err("%s: _probe_failure I2C add driver failed\n", __func__);
		i2c_del_driver(s_ctrl->sensor_i2c_driver);
		return rc;
#else
		CDBG("I2C add driver failed");
		goto probe_fail;
#endif	/*  HTC_END */
	}

	rc = s_ctrl->func_tbl->sensor_power_up(info);
	if (rc < 0)
		goto probe_fail;

	rc = msm_sensor_match_id(s_ctrl);
	if (rc < 0)
		goto probe_fail;

	if (s_ctrl->sensor_eeprom_client != NULL) {
		struct msm_camera_eeprom_client *eeprom_client =
			s_ctrl->sensor_eeprom_client;
		if (eeprom_client->func_tbl.eeprom_init != NULL &&
			eeprom_client->func_tbl.eeprom_release != NULL) {
			rc = eeprom_client->func_tbl.eeprom_init(
				eeprom_client,
				s_ctrl->sensor_i2c_client->client->adapter);
			if (rc < 0)
				goto probe_fail;

			rc = msm_camera_eeprom_read_tbl(eeprom_client,
			eeprom_client->read_tbl, eeprom_client->read_tbl_size);
			eeprom_client->func_tbl.eeprom_release(eeprom_client);
			if (rc < 0)
				goto probe_fail;
		}
	}

	s->s_init = s_ctrl->func_tbl->sensor_open_init;
	s->s_release = s_ctrl->func_tbl->sensor_release;
	s->s_config  = s_ctrl->func_tbl->sensor_config;
	s->s_camera_type = info->camera_type;
	if (info->sensor_platform_info != NULL)
		s->s_mount_angle = info->sensor_platform_info->mount_angle;
	else
		s->s_mount_angle = 0;

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

	goto power_down;
probe_fail:
	pr_warning("%s: _probe_failure\n", __func__);
	i2c_del_driver(s_ctrl->sensor_i2c_driver);
power_down:
	s_ctrl->func_tbl->sensor_power_down(info);
	return rc;
}
Ejemplo n.º 4
0
static int __init bcm3450_init(void)
{
    return i2c_add_driver(&bcm3450_driver);
}
Ejemplo n.º 5
0
static int CAM_CAL_probe(struct platform_device *pdev)
{
    return i2c_add_driver(&CAM_CAL_i2c_driver);
}
Ejemplo n.º 6
0
static int __init fsa9485_init(void)
{
	return i2c_add_driver(&fsa9485_i2c_driver);
}
Ejemplo n.º 7
0
static int __init smb347_init(void)
{
	return i2c_add_driver(&smb347_i2c_driver);
}
static int __init tpa2028d2_stereo_amp_init(void)
{
	return i2c_add_driver(&tpa2028d_amp2_driver);
}
Ejemplo n.º 9
0
//driver module attach/de-attach
static int __init vdev_dev_init(void) {
	pr_info("Loading vdev driver\n");
	return i2c_add_driver(&vdev_driver);
}
Ejemplo n.º 10
0
static int acc_con_probe(struct platform_device *pdev)
{	
	int 	retval;
	
	ACC_CONDEV_DBG("");	

	acc_dev = &pdev->dev;
#ifdef CONFIG_MHL_SII9234
	
		retval = i2c_add_driver(&SII9234A_i2c_driver);
		if (retval != 0)
			printk("[MHL SII9234A] can't add i2c driver\n");	
		else
			printk("[MHL SII9234A] add i2c driver\n");
	
		retval = i2c_add_driver(&SII9234B_i2c_driver);
		if (retval != 0)
			printk("[MHL SII9234B] can't add i2c driver\n");	
		else
			printk("[MHL SII9234B] add i2c driver\n");
	
		retval = i2c_add_driver(&SII9234C_i2c_driver);
		if (retval != 0)
			printk("[MHL SII9234C] can't add i2c driver\n");	
		else
			printk("[MHL SII9234C] add i2c driver\n");
		
		retval = i2c_add_driver(&SII9234_i2c_driver);
		if (retval != 0)
			printk("[MHL SII9234] can't add i2c driver\n");	
		else
			printk("[MHL SII9234] add i2c driver\n");


	
	//MHD_HW_Reset();  //9234 goes to D2
	MHD_HW_Off();
#endif		
	
	INIT_WORK(&acc_con_work, acc_con_intr_handle);
	acc_con_workqueue = create_singlethread_workqueue("acc_con_workqueue");
	acc_con_interrupt_init();

#if defined (CONFIG_TARGET_LOCALE_EUR) || defined (CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined (CONFIG_TARGET_LOCALE_VZW) || defined (CONFIG_TARGET_LOCALE_USAGSM)
	if(HWREV >=0xB)
	{
	INIT_WORK(&acc_ID_work, acc_ID_intr_handle);
	acc_ID_workqueue = create_singlethread_workqueue("acc_ID_workqueue");
	acc_ID_interrupt_init();
	}
#else
#ifdef CONFIG_TARGET_LOCALE_KOR
	if(HWREV >=0xA)
	{
		INIT_WORK(&acc_ID_work, acc_ID_intr_handle);
		acc_ID_workqueue = create_singlethread_workqueue("acc_ID_workqueue");
		acc_ID_interrupt_init();
	}
#else
	INIT_WORK(&acc_ID_work, acc_ID_intr_handle);
	acc_ID_workqueue = create_singlethread_workqueue("acc_ID_workqueue");
	acc_ID_interrupt_init();
#endif
#endif

	//INIT_WORK(&acc_MHD_work, acc_MHD_intr_handle);
	//acc_MHD_workqueue = create_singlethread_workqueue("acc_MHD_workqueue");
	//acc_MHD_interrupt_init();

	if (device_create_file(acc_dev, &dev_attr_MHD_file) < 0)
		printk("Failed to create device file(%s)!\n", dev_attr_MHD_file.attr.name);

	if (device_create_file(acc_dev, &dev_attr_acc_file) < 0)
		printk("Failed to create device file(%s)!\n", dev_attr_acc_file.attr.name);
	
/*
	init_timer(&connector_detect_timer);
	connector_detect_timer.function = acc_con_detect_timer_handler;
	connector_detect_timer.expires = DETECTION_INTR_DELAY;
	add_timer(&connector_detect_timer);
*/
	
	return 0;
}
Ejemplo n.º 11
0
static int __init sensor_emc1403_init(void)
{
	return i2c_add_driver(&sensor_emc1403);
}
static int __devinit sec_nfc_probe(struct i2c_client *client,
		const struct i2c_device_id *id)
{
	struct device *dev = &client->dev;
#else
static int __devinit sec_nfc_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
#endif
	struct sec_nfc_info *info;
	struct sec_nfc_platform_data *pdata = dev->platform_data;
	int ret = 0;

	if (!pdata) {
		dev_err(dev, "No platform data\n");
		ret = -ENOMEM;
		goto err_pdata;
	}

	info = kzalloc(sizeof(struct sec_nfc_info), GFP_KERNEL);
	if (!info) {
		dev_err(dev, "failed to allocate memory for sec_nfc_info\n");
		ret = -ENOMEM;
		goto err_info_alloc;
	}
	info->dev = dev;
	info->pdata = pdata;
	info->state = SEC_NFC_ST_OFF;

	mutex_init(&info->mutex);
	dev_set_drvdata(dev, info);

#ifdef CONFIG_SEC_NFC_I2C
	info->buflen = SEC_NFC_MAX_BUFFER_SIZE;
	info->buf = kzalloc(SEC_NFC_MAX_BUFFER_SIZE, GFP_KERNEL);
	if (!info->buf) {
		dev_err(dev,
			"failed to allocate memory for sec_nfc_info->buf\n");
		ret = -ENOMEM;
		goto err_buf_alloc;
	}

	/* pdata->cfg_gpio(); */

	ret = gpio_request(pdata->irq, "nfc_int");
	if (ret) {
		dev_err(dev, "[NFC] GPIO request is failed to register IRQ\n");
		goto err_irq_req;
	}

	info->i2c_dev = client;
	info->read_irq = SEC_NFC_NONE;
	mutex_init(&info->read_mutex);
	init_waitqueue_head(&info->read_wait);
	i2c_set_clientdata(client, info);

	dev_info(dev, "%s : requesting IRQ %d\n", __func__,
		 client->irq);

	/*	ret = request_threaded_irq(pdata->irq, NULL,
			sec_nfc_irq_thread_fn,
	*/
	ret = request_threaded_irq(client->irq, NULL, sec_nfc_irq_thread_fn,
			IRQF_TRIGGER_RISING | IRQF_ONESHOT, SEC_NFC_DRIVER_NAME,
			info);

	/* ret = request_irq(client->irq, sec_nfc_irq_thread_fn,
	  IRQF_TRIGGER_RISING, SEC_NFC_DRIVER_NAME, info);
	*/
	if (ret < 0) {
		dev_err(dev, "failed to register IRQ handler\n");
		goto err_irq_req;
	}
#endif

	info->miscdev.minor = MISC_DYNAMIC_MINOR;
	info->miscdev.name = SEC_NFC_DRIVER_NAME;
	info->miscdev.fops = &sec_nfc_fops;
	info->miscdev.parent = dev;

	ret = misc_register(&info->miscdev);

	if (ret < 0) {
		dev_err(dev, "failed to register Device\n");
		goto err_dev_reg;
	}

	ret = gpio_request(pdata->ven, "nfc_ven");
	if (ret) {
		dev_err(dev, "failed to get gpio ven\n");
		goto err_gpio_ven;
	}

	ret = gpio_request(pdata->firm, "nfc_firm");
	if (ret) {
		dev_err(dev, "failed to get gpio firm\n");
		goto err_gpio_firm;
	}

	gpio_direction_output(pdata->ven, 0);
	gpio_direction_output(pdata->firm, 0);

	if (info->pdata->power_onoff)
		info->pdata->power_onoff(1);
	else
		pr_info("%s : no power control function\n", __func__);

	dev_dbg(dev, "%s: info: %p, pdata %p\n", __func__, info, pdata);

	return 0;

err_gpio_firm:
	gpio_free(pdata->firm);
err_gpio_ven:
	gpio_free(pdata->ven);
err_dev_reg:
#ifdef CONFIG_SEC_NFC_I2C
err_irq_req:
	gpio_free(pdata->irq);
err_buf_alloc:
#endif
err_info_alloc:
	kfree(info);
err_pdata:
	return ret;
}

#ifdef CONFIG_SEC_NFC_I2C
static int __devexit sec_nfc_remove(struct i2c_client *client)
{
	struct sec_nfc_info *info = i2c_get_clientdata(client);
	struct sec_nfc_platform_data *pdata = client->dev.platform_data;
#else
static int __devexit sec_nfc_remove(struct platform_device *pdev)
{
	struct sec_nfc_info *info = dev_get_drvdata(&pdev->dev);
	struct sec_nfc_platform_data *pdata = pdev->dev.platform_data;
#endif

	dev_dbg(info->dev, "%s\n", __func__);

	misc_deregister(&info->miscdev);

	if (info->state != SEC_NFC_ST_OFF) {
		gpio_set_value(pdata->firm, 0);
		gpio_set_value(pdata->ven, 0);
	}

	gpio_free(pdata->firm);
	gpio_free(pdata->ven);

#ifdef CONFIG_SEC_NFC_I2C
	free_irq(pdata->irq, info);
#endif

	kfree(info);

	return 0;
}

#ifdef CONFIG_SEC_NFC_I2C
static struct i2c_device_id sec_nfc_id_table[] = {
#else	/* CONFIG_SEC_NFC_I2C */
static struct platform_device_id sec_nfc_id_table[] = {
#endif
	{ SEC_NFC_DRIVER_NAME, 0 },
	{ }
};

#ifdef CONFIG_SEC_NFC_I2C
MODULE_DEVICE_TABLE(i2c, sec_nfc_id_table);
static struct i2c_driver sec_nfc_driver = {
#else
MODULE_DEVICE_TABLE(platform, sec_nfc_id_table);
static struct platform_driver sec_nfc_driver = {
#endif
	.probe = sec_nfc_probe,
	.id_table = sec_nfc_id_table,
	.remove = sec_nfc_remove,
	.driver = {
		.name = SEC_NFC_DRIVER_NAME,
#ifdef CONFIG_PM
		.pm = &sec_nfc_pm_ops,
#endif
	},
};

static int __init sec_nfc_init(void)
{
#ifdef CONFIG_SEC_NFC_I2C
	return i2c_add_driver(&sec_nfc_driver);
#else
	return platform_driver_register(&sec_nfc_driver);
#endif
}

static void __exit sec_nfc_exit(void)
{
#ifdef CONFIG_SEC_NFC_I2C
	i2c_del_driver(&sec_nfc_driver);
#else
	platform_driver_unregister(&sec_nfc_driver);
#endif
}

module_init(sec_nfc_init);
module_exit(sec_nfc_exit);

MODULE_DESCRIPTION("Samsung sec_nfc driver");
MODULE_LICENSE("GPL");
static int __init ina230_init(void)
{
	printk(KERN_INFO "[BPC] ina230_init\n");
	return i2c_add_driver(&ina230_driver);
}
Ejemplo n.º 14
0
static int __init pn544_dev_init(void)
{
	pr_info("Loading pn544 driver\n");
	return i2c_add_driver(&pn544_driver);
}
Ejemplo n.º 15
0
static int __init max77843_i2c_init(void)
{
	return i2c_add_driver(&max77843_i2c_driver);
}
Ejemplo n.º 16
0
static int __init pca953x_init(void)
{
	return i2c_add_driver(&pca953x_driver);
}
Ejemplo n.º 17
0
static int __init sensors_lm63_init(void)
{
	return i2c_add_driver(&lm63_driver);
}
Ejemplo n.º 18
0
static int __init pm2xxx_charger_init(void)
{
	return i2c_add_driver(&pm2xxx_charger_driver);
}
static int __init sec_fuelgauge_init(void)
{
	return i2c_add_driver(&sec_fuelgauge_driver);
}
Ejemplo n.º 20
0
static int __init imx091_eeprom_i2c_add_driver(void)
{
	int rc = 0;
	rc = i2c_add_driver(imx091_eeprom_t.i2c_driver);
	return rc;
}
Ejemplo n.º 21
0
static int __init msm_sensor_init_module(void)
{
	return i2c_add_driver(&s5k3l1yx_i2c_driver);
}
Ejemplo n.º 22
0
static int __init BMA255_init(void)
{
	return i2c_add_driver(&bma255_driver);
}
Ejemplo n.º 23
0
static int __init max17040_init(void)
{
	return i2c_add_driver(&max17040_i2c_driver);
}
static int __init yas_init(void)
{
	return i2c_add_driver(&yas_driver);
}
Ejemplo n.º 25
0
static int sii9234_probe(struct platform_device *pdev)
{
	int ret;
	struct mhl_platform_data *mhl_pdata = pdev->dev.platform_data;
	struct mhl_dev *mhl_dev;
	unsigned int mhl_wakeup_irq;
	struct class *sec_mhl;
	struct input_dev *input;

	if (mhl_pdata == NULL) {
		pr_err("MHL probe fail\n");
		return -ENODEV;
	}

	ret = i2c_add_driver(&sii9234_i2c_driver);
	if (ret != 0) {
		pr_err("[MHL SII9234] can't add i2c driver\n");
		return ret;
	} else {
		pr_err("[MHL SII9234] add i2c driver\n");
	}

	ret = i2c_add_driver(&sii9234a_i2c_driver);
	if (ret != 0) {
		pr_err("[MHL SII9234A] can't add i2c driver\n");
		goto err_i2c_a_add;
	} else {
		pr_err("[MHL SII9234A] add i2c driver\n");
	}

	ret = i2c_add_driver(&sii9234b_i2c_driver);
	if (ret != 0) {
		pr_err("[MHL SII9234B] can't add i2c driver\n");
		goto err_i2c_b_add;
	} else {
		pr_err("[MHL SII9234B] add i2c driver\n");
	}

	ret = i2c_add_driver(&sii9234c_i2c_driver);
	if (ret != 0) {
		pr_err("[MHL SII9234C] can't add i2c driver\n");
		goto err_i2c_c_add;
	} else {
		pr_err("[MHL SII9234C] add i2c driver\n");
	}

	mhl_dev = kzalloc(sizeof(struct mhl_dev), GFP_KERNEL);
	if (!mhl_dev) {
		ret = -ENOMEM;
		goto err_mem;
	}

	input = input_allocate_device();
	if (!input) {
		pr_err("failed to allocate input device.\n");
		ret = -ENOMEM;
		goto err_input;
	}

	set_bit(EV_KEY, input->evbit);
	bitmap_fill(input->keybit, KEY_MAX);
	mhl_dev->input = input;

	input_set_drvdata(input, mhl_dev);
	input->name = "sii9234_rcp";
	input->id.bustype = BUS_I2C;

	ret = input_register_device(input);
	if (ret < 0) {
		pr_err("fail to register input device\n");
		goto err_misc_register;
	}

	mhl_dev->pdata = mhl_pdata;
	mhl_dev->irq_gpio = mhl_pdata->mhl_int;
	mhl_dev->wake_up_gpio = mhl_pdata->mhl_wake_up;

	INIT_WORK(&mhl_dev->sii9234_int_work, sii9234_interrupt_event_work);
	mhl_dev->sii9234_wq = create_singlethread_workqueue("sii9234_wq");

	mhl_dev->mdev.minor = MISC_DYNAMIC_MINOR;
	mhl_dev->mdev.name = "mhl";
	mhl_dev->mdev.fops = &mhl_fops;

	dev_set_drvdata(&pdev->dev, mhl_dev);

	mhl_dev->process_dev = &pdev->dev;

	ret = misc_register(&mhl_dev->mdev);
	if (ret) {
		pr_err("mhl misc_register failed\n");
		goto err_misc_register;
	}
      g_mhl_dev = mhl_dev;

	mhl_pdata->mhl_irq = gpio_to_irq(mhl_dev->irq_gpio);
	irq_set_irq_type(mhl_pdata->mhl_irq, IRQ_TYPE_EDGE_RISING);
	ret = request_threaded_irq(mhl_pdata->mhl_irq, NULL, mhl_int_irq_handler,
			IRQF_DISABLED, "mhl_int", mhl_dev);
	if (ret) {
		pr_err("unable to request irq mhl_int err:: %d\n", ret);
		goto err_irq_request;
	}

	Sii9234_int_irq_disable();

	pr_info("create mhl sysfile\n");

	sec_mhl = class_create(THIS_MODULE, "mhl");
	if (IS_ERR(sec_mhl)) {
		pr_err("Failed to create class(sec_mhl)!\n");
		goto err_exit;
	}

	ret = class_create_file(sec_mhl, &class_attr_test_result);
	if (ret) {
		pr_err("[ERROR] Failed to create device file in sysfs entries!\n");
		goto err_exit;
	}

#if 0
	mhl_wakeup_irq = gpio_to_irq(mhl_dev->wake_up_gpio);
	set_irq_type(mhl_wakeup_irq, IRQ_TYPE_EDGE_RISING);
	ret = request_threaded_irq(mhl_wakeup_irq, NULL,
				mhl_wake_up_irq_handler,
				IRQF_DISABLED,
				"mhl_wake_up",
				mhl_dev);
	if (ret) {
		pr_err("unable to request irq mhl_wake_up err:: %d\n", ret);
		goto err_wake_up_irq_request;
	}
#endif

#if 0
	disable_irq_nosync(mhl_irq);
	disable_irq_nosync(mhl_wakeup_irq);
#endif
	return 0;
err_exit:
	class_destroy(sec_mhl);
err_wake_up_irq_request:
	free_irq(gpio_to_irq(mhl_dev->irq_gpio), mhl_dev);
err_irq_request:
	mhl_pdata->mhl_irq = NULL;
	misc_deregister(&mhl_dev->mdev);
err_misc_register:
	input_free_device(input);
err_input:
	destroy_workqueue(mhl_dev->sii9234_wq);
	kfree(mhl_dev);
err_mem:
	i2c_del_driver(&sii9234c_i2c_driver);
err_i2c_c_add:
	i2c_del_driver(&sii9234b_i2c_driver);
err_i2c_b_add:
	i2c_del_driver(&sii9234a_i2c_driver);
err_i2c_a_add:
	i2c_del_driver(&sii9234_i2c_driver);

	return ret;
}
static int __init ds278x_init(void)
{
	return i2c_add_driver(&ds278x_battery_driver);
}
Ejemplo n.º 27
0
static int __init mhl_Sii8334_init(void)
{
	return i2c_add_driver(&mhl_Sii8334_driver);
}
Ejemplo n.º 28
0
static int __devinit gs1_init(void)
{
	return i2c_add_driver(&gs_driver);
}
Ejemplo n.º 29
0
static int __init lm25066_init(void)
{
	return i2c_add_driver(&lm25066_driver);
}
Ejemplo n.º 30
0
static int __init adxl34x_i2c_init(void)
{
	return i2c_add_driver(&adxl34x_driver);
}