Пример #1
0
static int android_vibrator_probe(struct platform_device *pdev)
{
	int ret = 0;

	vibe_data = (struct android_vibrator_platform_data *)pdev->dev.platform_data;
	atomic_set(&vibe_gain,vibe_data->amp_value);
	vibe_data->pwm_set(1, 32);

	if (android_vibrator_intialize() < 0) {
		printk(KERN_ERR "Android Vibrator Initialization was failed\n");
		return -1;
	}

	android_vibrator_force_set(0); /* disable vibrator */

	hrtimer_init(&android_vibrator_data.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	android_vibrator_data.timer.function = vibrator_timer_func;
	spin_lock_init(&android_vibrator_data.lock);

	ret = timed_output_dev_register(&android_vibrator_data.dev);
	if (ret < 0) {
		timed_output_dev_unregister(&android_vibrator_data.dev);
		return -ENODEV;
	}

	ret = device_create_file(android_vibrator_data.dev.dev, &dev_attr_amp);
	if (ret < 0) {
		timed_output_dev_unregister(&android_vibrator_data.dev);
		device_remove_file(android_vibrator_data.dev.dev, &dev_attr_amp);
		return -ENODEV;
	}
	
	printk(KERN_INFO "LGE: Android Vibrator Initialization was done\n");
	return 0;
}
Пример #2
0
static int android_vibrator_probe(struct platform_device *pdev)
{

    int ret = 0;
    struct timed_vibrator_data *vib;

    platform_set_drvdata(pdev, &android_vibrator_data);
    vib = (struct timed_vibrator_data *)platform_get_drvdata(pdev);

    vib->vibe_data = (struct android_vibrator_platform_data *)pdev->dev.platform_data;

    if (vib->vibe_data->vibrator_init() < 0) {
        printk(KERN_ERR "%s Android Vreg, GPIO set failed\n", __FUNCTION__);
        return -1;
    }

//[LS840][ICS][Display]<*****@*****.**>
#ifdef CONFIG_MACH_LGE_C1_BOARD_SPR
    atomic_set(&vib->vibe_gain, LG_VIBRATOR_GAIN);
#else
    atomic_set(&vib->vibe_gain, 128);
#endif
//[LS840][ICS][Display]<*****@*****.**>
    atomic_set(&vib->vib_status, false);

//	android_vibrator_force_set(vib, 0); /* disable vibrator just for initializing */

    INIT_WORK(&vib->work_vibrator_off, android_vibrator_off);
    INIT_WORK(&vib->work_vibrator_on, android_vibrator_on);

    hrtimer_init(&vib->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
    vib->timer.function = vibrator_timer_func;
    spin_lock_init(&vib->lock);

    ret = timed_output_dev_register(&vib->dev);
    if (ret < 0) {
        timed_output_dev_unregister(&vib->dev);
        return -ENODEV;
    }

    ret = device_create_file(vib->dev.dev, &dev_attr_amp);
    if (ret < 0) {
        timed_output_dev_unregister(&vib->dev);
        device_remove_file(vib->dev.dev, &dev_attr_amp);
        return -ENODEV;
    }

    // printk(KERN_INFO "LGE: Android Vibrator Initialization was done\n");

    return 0;
}
static int android_vibrator_probe(struct platform_device *pdev)
{
	int ret = 0;

	vibe_data = (struct lge_vibrator_platform_data *)pdev->dev.platform_data;
	atomic_set(&vibe_gain,vibe_data->amp_value);

	if (android_vibrator_intialize() < 0) {
		printk(KERN_ERR "Android Vibrator Initialization was failed\n");
		return -1;
	}

#ifdef CONFIG_VIB_USE_HIGH_VOL_OVERDRIVE
	INIT_WORK(&qcoin_overdrive_off_queue, vib_qcoin_off_work);
#endif

#if defined(CONFIG_VIB_USE_WORK_QUEUE)
	INIT_WORK(&vib_power_set_work_queue, vib_power_set_work);

	atomic_set(&nForce, 0);
	schedule_work(&vib_power_set_work_queue);	/* disable vibrator */
#else	/* CONFIG_VIB_USE_WORK_QUEUE */
	android_vibrator_force_set(0); /* disable vibrator */
#endif

	hrtimer_init(&android_vibrator_data.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	android_vibrator_data.timer.function = vibrator_timer_func;
	spin_lock_init(&android_vibrator_data.lock);

	ret = timed_output_dev_register(&android_vibrator_data.dev);
	if (ret < 0) {
		timed_output_dev_unregister(&android_vibrator_data.dev);
		return -ENODEV;
	}

#ifdef CONFIG_VIB_USE_HIGH_VOL_OVERDRIVE
	ret = device_create_file(android_vibrator_data.dev.dev, &dev_attr_rtime);
	ret = device_create_file(android_vibrator_data.dev.dev, &dev_attr_ftime);
#endif

	ret = device_create_file(android_vibrator_data.dev.dev, &dev_attr_amp);
	if (ret < 0) {
		timed_output_dev_unregister(&android_vibrator_data.dev);
		device_remove_file(android_vibrator_data.dev.dev, &dev_attr_amp);
		return -ENODEV;
	}

	printk(KERN_INFO "LGE: Android Vibrator Initialization was done\n");
	return 0;
}
Пример #4
0
static int __devexit dc_motor_remove(struct platform_device *pdev)
{
	struct dc_motor_drvdata *ddata = platform_get_drvdata(pdev);
	timed_output_dev_unregister(&ddata->dev);
	kfree(ddata);
	return 0;
}
static int incident_led_blink_probe(struct platform_device *pdev)
{
  int ret =0;
  struct incident_led_blink_data *data;
  data = kzalloc(sizeof(struct incident_led_blink_data) ,GFP_KERNEL);
  if (!data)
    return -ENOMEM;
  
  INIT_WORK(&data->work_incident_led_blink_on, incident_led_blink_on);
  INIT_WORK(&data->work_incident_led_blink_off, incident_led_blink_off);
  INIT_WORK(&data->work_incident_led_on_all_long, incident_led_on_all_long);

  hrtimer_init(&data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
  data->timer.function = incident_led_blink_timer_func;
  spin_lock_init(&data->lock);

  data->dev.name = "incident_led";
  data->dev.get_time = incident_led_blink_get_time;
  data->dev.enable = incident_led_blink_enable;
	
  ret = timed_output_dev_register(&data->dev);
  if (ret < 0){
    timed_output_dev_unregister(&data->dev);
    kfree(data);
    return ret;
  }
  platform_set_drvdata(pdev, data);
  return 0;
}
static int incident_led_blink_remove(struct platform_device *pdev)
{
  struct incident_led_blink_data *data = platform_get_drvdata(pdev);
  timed_output_dev_unregister(&data->dev);
  kfree(data);
  return 0;
}
Пример #7
0
static int vibrator_probe(struct platform_device *pdev)
{
	int ret = 0;

#if defined(CONFIG_HAS_WAKELOCK)
	wake_lock_init(&vib_wl, WAKE_LOCK_SUSPEND, __stringify(vib_wl));
#endif
	
	/* Setup timed_output obj */
	vibrator_timed_dev.name = "vibrator";
	vibrator_timed_dev.enable = vibrator_enable_set_timeout;
	vibrator_timed_dev.get_time = vibrator_get_remaining_time;
	vib_voltage = pdev->voltage;

	/* Vibrator dev register in /sys/class/timed_output/ */
	ret = timed_output_dev_register(&vibrator_timed_dev);
	if (ret < 0) {
		printk(KERN_ERR "Vibrator: timed_output dev registration failure\n");
		timed_output_dev_unregister(&vibrator_timed_dev);
	}

	init_timer(&vibrate_timer);
	vibrate_timer.function = on_vibrate_timer_expired;
	vibrate_timer.data = (unsigned long)NULL;
	INIT_WORK(&vibrator_off_work,
		 vibrator_off_worker);
	Is_vib_shortly = false;
	return 0;
}
static int __devexit ss_brcm_haptic_remove(struct platform_device *pdev)
{
	t_vib_desc *vib_iter = platform_get_drvdata(pdev);
	timed_output_dev_unregister(&vib_iter->timed_dev);
	regulator_put(vib_iter->vib_regulator);
	return 0;
}
Пример #9
0
static int __devexit lge_isa1200_remove(struct i2c_client *client)
{
	struct lge_isa1200_context *context = i2c_get_clientdata(client);

	dev_info(context->dev.dev, "%s()\n", __func__);

	context_for_debugfs = NULL;

	device_remove_file(context->dev.dev, &dev_attr_amp);

	hrtimer_cancel(&context->timer);
	cancel_work_sync(&context->work);
	lge_isa1200_hw_vib_on_off(context, false);

	timed_output_dev_unregister(&context->dev);

	gpio_free(context->pdata->gpio_hen);

#if 0 /*                                        */
	mutex_destroy(&context->mutex);
#endif
	i2c_set_clientdata(client, NULL);
	kfree(context);

	return 0;
}
static void __exit sprd_exit_vibrator(void)
{
	timed_output_dev_unregister(&sprd_vibrator);
#if defined(CONFIG_HAS_WAKELOCK)
	wake_lock_destroy(&vib_wl);
#endif
	destroy_workqueue(vib_workqueue);
}
static void __exit exit_tegra_vibrator(void)
{
	if(s_hOdmVibrate) {
		timed_output_dev_unregister(&tegra_vibrator);
		NvOdmVibClose(s_hOdmVibrate);
		s_hOdmVibrate = NULL;
	}
}
Пример #12
0
static int vibrator_remove(struct platform_device *pdev)
{
	timed_output_dev_unregister(&data->dev);
	regulator_put(data->regulator);
	kfree(data);

	return 0;
}
Пример #13
0
static int vibrator_remove(struct platform_device *pdev)
{
	struct pm80x_vibrator_info *info;
	info = platform_get_drvdata(pdev);

	timed_output_dev_unregister(&info->vibrator_timed_dev);
	return 0;
}
static void __exit isa1400_vibrator_exit(void)
{
	VibeOSKernelLinuxTerminateTimer();
	wake_lock_destroy(&vib_wake_lock);
       mutex_destroy(&g_drvdata->mutex_lock);
       timed_output_dev_unregister(&g_drvdata->dev);
	i2c_del_driver(&isa1400_vibrator_i2c_driver);
}
Пример #15
0
static int vibrator_remove(struct i2c_client *client)
{
	struct drv2604_vibrator_info *info = i2c_get_clientdata(client);

	timed_output_dev_unregister(&info->vibrator_timed_dev);
	i2c_unregister_device(client);
	devm_kfree(&client->dev, info);
	return 0;
}
Пример #16
0
static int android_vibrator_remove(struct platform_device *dev)
{
	vibe_data->power_set(0);
	vibe_data->ic_enable_set(0);
	vibe_data->pwm_set(0, 0);
	timed_output_dev_unregister(&android_vibrator_data.dev);

	return 0;
}
Пример #17
0
static int __devexit vibrator_remove(struct platform_device *pdev)
{
	struct vibrator_drvdata *data = platform_get_drvdata(pdev);
	timed_output_dev_unregister(&data->dev);
	regulator_put(data->regulator);
	pwm_free(data->pwm);
	kfree(data);
	return 0;
}
Пример #18
0
static int vib_pwm_probe(struct platform_device *pdev)
{
	struct vib_pwm_platform_data *pdata = pdev->dev.platform_data;
	struct vib_pwm_data *pwm_data;
	int ret = 0;

	if (!pdata) {
		ret = -EBUSY;
		printk(KERN_ERR "vib-pwm platform data is null\n");
		goto err0;
	}

	pwm_data = kzalloc(sizeof(struct vib_pwm_data), GFP_KERNEL);
	if (!pwm_data) {
		printk(KERN_ERR "vib-pwm: memory allocation failed\n");
		ret = -ENOMEM;
		goto err0;
	}

	pwm_data->pdata = pdata;

	INIT_WORK(&pwm_data->vib_work, vib_pwm_update);

	hrtimer_init(&pwm_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);

	pwm_data->timer.function = pwm_timer_func;
	spin_lock_init(&pwm_data->lock);

	pwm_data->dev.name = pdata->device_name;
	pwm_data->dev.get_time = vib_pwm_get_time;
	pwm_data->dev.enable = vib_pwm_enable;
	ret = timed_output_dev_register(&pwm_data->dev);
	if (ret < 0) {
		printk(KERN_ERR "timed o/p dev. lvib. registration failed\n");
		goto err1;
	}

	if (pwm_data->pdata->init)
		ret = pwm_data->pdata->init();
	if (ret < 0) {
		printk(KERN_ERR "vib-pwm: platform data not available\n");
		goto err2;
	}

	misc_data = pwm_data;
	platform_set_drvdata(pdev, pwm_data);

	printk(KERN_ALERT "vib-pwm probed\n");
	return 0;
err2:
	timed_output_dev_unregister(&pwm_data->dev);
err1:
	kfree(pwm_data);
err0:
	return ret;
}
Пример #19
0
static int vib_gpio_probe(struct platform_device *pdev)
{
	struct vib_gpio_platform_data *pdata = pdev->dev.platform_data;
	struct vib_gpio_data *gpio_data;
	int ret = 0;

	if (!pdata) {
		ret = -EBUSY;
		goto err0;
	}

	gpio_data = kzalloc(sizeof(struct vib_gpio_data), GFP_KERNEL);
	if (!gpio_data) {
		ret = -ENOMEM;
		goto err0;
	}

	gpio_data->pdata = pdata;

	INIT_WORK(&gpio_data->vib_work, vib_gpio_update);

	hrtimer_init(&gpio_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);

	gpio_data->timer.function = gpio_timer_func;
	spin_lock_init(&gpio_data->lock);

	gpio_data->dev.name = "vibrator";
	gpio_data->dev.get_time = vib_gpio_get_time;
	gpio_data->dev.enable = vib_gpio_enable;
	ret = timed_output_dev_register(&gpio_data->dev);
	if (ret < 0)
		goto err1;

	if (gpio_data->pdata->init)
		ret = gpio_data->pdata->init();
	if (ret < 0)
		goto err2;

	gpio_direction_output(gpio_data->pdata->gpio,
			      gpio_data->pdata->active_low);

	misc_data = gpio_data;
	platform_set_drvdata(pdev, gpio_data);

	vib_gpio_enable(&gpio_data->dev, gpio_data->pdata->initial_vibrate);

	return 0;

err2:
	timed_output_dev_unregister(&gpio_data->dev);
err1:
	kfree(gpio_data->pdata);
	kfree(gpio_data);
err0:
	return ret;
}
Пример #20
0
static int qsd_led_remove(struct platform_device *pdev)
{
  
  MSG("%s+", __func__);

  timed_output_dev_unregister(&qsd_timed_vibrator);
  qsd_timed_vibrator_deinit();
  MSG("%s-", __func__);
  return 0;
}
static int __devexit pm8xxx_vib_remove(struct platform_device *pdev)
{
	struct pm8xxx_vib *vib = platform_get_drvdata(pdev);

	hrtimer_cancel(&vib->vib_timer);
	timed_output_dev_unregister(&vib->timed_dev);
	platform_set_drvdata(pdev, NULL);
	kfree(vib);

	return 0;
}
static void __exit wmt_vibrate_exit(void)
{
	platform_device_unregister(vibrate_platform_device);
	platform_driver_unregister(&vibrate_driver);
	timed_output_dev_unregister(&l_vibratedev.vibtimedev);
	device_destroy(l_vibratedev.dev_class, MKDEV(WMT_VIBRATE_MAJOR, 0));
    class_destroy(l_vibratedev.dev_class);
	unregister_chrdev(WMT_VIBRATE_MAJOR, WMT_VIBRATE_DEVICE_NAME);

	printk(KERN_ALERT "WMT vibrate driver is removed.\n");
}
static int __devexit pmic8058_vib_remove(struct platform_device *pdev)
{
	struct pmic8058_vib *vib = platform_get_drvdata(pdev);

	cancel_work_sync(&vib->work);
	hrtimer_cancel(&vib->vib_timer);
	timed_output_dev_unregister(&vib->timed_dev);
	kfree(vib);

	return 0;
}
static int  __devexit qpnp_vibrator_remove(struct spmi_device *spmi)
{
	struct qpnp_vib *vib = dev_get_drvdata(&spmi->dev);

	cancel_work_sync(&vib->work);
	hrtimer_cancel(&vib->vib_timer);
	timed_output_dev_unregister(&vib->timed_dev);
	mutex_destroy(&vib->lock);

	return 0;
}
Пример #25
0
static int vib_probe(struct platform_device *pdev)
{
	struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data;
	struct vib_data *data;
	int ret = 0;

	if (!pdata) {
		ret = -EBUSY;
		goto err0;
	}

	data = kzalloc(sizeof(struct vib_data), GFP_KERNEL);
	if (!data) {
		ret = -ENOMEM;
		goto err0;
	}

	data->pdata = pdata;
	data->twl6040 = dev_get_drvdata(pdev->dev.parent);

	INIT_WORK(&data->vib_work, vib_update);

	hrtimer_init(&data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);

	data->timer.function = vib_timer_func;
	spin_lock_init(&data->lock);

	data->dev.name = "vibrator";
	data->dev.get_time = vib_get_time;
	data->dev.enable = vib_enable;
	ret = timed_output_dev_register(&data->dev);
	if (ret < 0)
		goto err1;

	if (data->pdata->init)
		ret = data->pdata->init();
	if (ret < 0)
		goto err2;

	misc_data = data;
	platform_set_drvdata(pdev, data);

	twl6040_enable(data->twl6040);
	vib_enable(&data->dev, data->pdata->initial_vibrate);

	return 0;

err2:
	timed_output_dev_unregister(&data->dev);
err1:
	kfree(data);
err0:
	return ret;
}
Пример #26
0
static void vibetonz_end(void)
{
	printk("[VIBETONZ] %s \n",__func__);
	/* Disable Vibetonz */
	gpio_set_value(GPIO_HAPTIC_EN, GPIO_LEVEL_LOW);
	gpio_free(GPIO_HAPTIC_EN);
	s5p6442_timer_setup(0, 10,0,0);
	destroy_workqueue(vib_wq);
    /* Deregister timed output devices */
    timed_output_dev_unregister(&timed_output_vt);
}
Пример #27
0
static int android_vibrator_remove(struct platform_device *pdev)
{
    struct timed_vibrator_data *vib = (struct timed_vibrator_data *)platform_get_drvdata(pdev);

//	android_vibrator_force_set(vib, 0);
    schedule_work(&vib->work_vibrator_off);

    timed_output_dev_unregister(&vib->dev);

    return 0;
}
Пример #28
0
static int vib_pwm_remove(struct platform_device *pdev)
{
	struct vib_pwm_data *pwm_data = platform_get_drvdata(pdev);

	if (pwm_data->pdata->exit)
		pwm_data->pdata->exit();

	timed_output_dev_unregister(&pwm_data->dev);
	kfree(pwm_data);
	return 0;
}
static int __devexit vibrator_remove(struct platform_device *pdev)
{
	timed_output_dev_unregister(&vibrator_timed_dev);
   if (vib_regulator) 
	{
         regulator_put(vib_regulator);
         vib_regulator = NULL;
   }
   
	return 0;
}
static int drv2605_remove(struct i2c_client *client)
{
	struct drv2605_data *data = i2c_get_clientdata(client);

	mutex_destroy(&data->lock);
	timed_output_dev_unregister(&data->dev);
	hrtimer_cancel(&data->timer);
	cancel_work_sync(&data->work);
	cancel_work_sync(&data->work_play_eff);

	return 0;
}