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);
}
static int __devexit drv2604_remove(struct i2c_client *client)
{
	DbgOut((KERN_INFO "tspdrv: drv2604_remove_module.\n"));
	DbgRecorderTerminate(());
	VibeOSKernelLinuxTerminateTimer();
	ImmVibeSPI_ForceOut_Terminate();
	misc_deregister(&miscdev);
	gpio_free(vibrator_drvdata.motor_en);
	return 0;
}
static int __devexit isa1200_remove(struct i2c_client *client)
{
    DbgOut((KERN_INFO "tspdrv: isa1200_remove_module.\n"));
    iounmap(virt_mmss_gp1_base);
    DbgRecorderTerminate(());
    VibeOSKernelLinuxTerminateTimer();
    ImmVibeSPI_ForceOut_Terminate();
    wake_lock_destroy(&vib_wake_lock);
    misc_deregister(&miscdev);
    gpio_free(vibrator_drvdata.motor_en);
    return 0;
}
Ejemplo n.º 4
0
static int __devexit tspdrv_remove(struct platform_device *pdev)
{
	DbgOut((KERN_INFO "tspdrv: tspdrv_remove.\n"));

	DbgRecorderTerminate(());

	VibeOSKernelLinuxTerminateTimer();
	ImmVibeSPI_ForceOut_Terminate();

	wake_lock_destroy(&vib_wake_lock);

	return 0;
}
Ejemplo n.º 5
0
void cleanup_module(void)
{
    DbgOut((KERN_INFO "tspdrv: cleanup_module.\n"));

    VibeOSKernelLinuxTerminateTimer();
    ImmVibeSPI_ForceOut_Terminate();

	platform_driver_unregister(&platdrv);
	platform_device_unregister(&platdev);

    misc_deregister(&miscdev);
    gpio_free(VIB_EN);
}
Ejemplo n.º 6
0
void cleanup_module(void)
{
    DbgOut((KERN_INFO "vtmdrv: cleanup_module.\n"));

    VibeOSKernelLinuxTerminateTimer();
    ImmVibeSPI_ForceOut_Terminate();

	platform_driver_unregister(&platdrv);
	platform_device_unregister(&platdev);

#ifdef IMPLEMENT_AS_CHAR_DRIVER
    unregister_chrdev(g_nMajor, MODULE_NAME);
#else
    misc_deregister(&miscdev);
#endif
}
Ejemplo n.º 7
0
static void __exit tspdrv_exit(void)
{
	DbgOut((DBL_INFO, "tspdrv: cleanup_module.\n"));

	DbgRecorderTerminate(());

	VibeOSKernelLinuxTerminateTimer();
	ImmVibeSPI_ForceOut_Terminate();

	platform_driver_unregister(&platdrv);
	platform_device_unregister(&platdev);

#ifdef IMPLEMENT_AS_CHAR_DRIVER
	unregister_chrdev(g_nMajor, MODULE_NAME);
#else
	misc_deregister(&miscdev);
#endif
}
Ejemplo n.º 8
0
//[LGSI_SP4_BSP_START][[email protected]]
void __exit tspdrv_exit(void)
//[LGSI_SP4_BSP_END][[email protected]]
{
    DbgOut((KERN_INFO "tspdrv: cleanup_module.\n"));

    DbgRecorderTerminate(());

    VibeOSKernelLinuxTerminateTimer();
    ImmVibeSPI_ForceOut_Terminate();

	platform_driver_unregister(&platdrv);
	platform_device_unregister(&platdev);

#ifdef IMPLEMENT_AS_CHAR_DRIVER
    unregister_chrdev(g_nMajor, MODULE_NAME);
#else
    misc_deregister(&miscdev);
#endif
}
Ejemplo n.º 9
0
static int vibrator_remove(struct platform_device *pdev)
{
    DbgOut((KERN_INFO "tspdrv: vibrator_remove.\n"));

    DbgRecorderTerminate(());

    VibeOSKernelLinuxTerminateTimer();
    ImmVibeSPI_ForceOut_Terminate();

#ifdef IMPLEMENT_AS_CHAR_DRIVER
    unregister_chrdev(g_nMajor, MODULE_NAME);
#else
    misc_deregister(&miscdev);
#endif

#if !defined(CONFIG_MACH_LGE_L9II_OPEN_EU)
    kfree(vib_dev);
#endif

    return 0;
}
Ejemplo n.º 10
0
static int vibrator_remove(struct platform_device *pdev)
{
	/* LGE_SJIT 2011-11-30 [[email protected]] support for timed output class */
	struct pwm_vib_data *data = platform_get_drvdata(pdev);

	DbgOut((KERN_INFO "tspdrv: cleanup_module.\n"));

	DbgRecorderTerminate(());

	/* LGE_SJIT 2011-11-30 [[email protected]] support for timed output class */
#if defined(CONFIG_TSPDRV_TIMED_OUTPUT)
	timed_output_dev_unregister(&timed_dev);
	hrtimer_cancel(&vibe_timer);
#endif

	VibeOSKernelLinuxTerminateTimer();
	ImmVibeSPI_ForceOut_Terminate();
	misc_deregister(&miscdev);

	/* LGE_SJIT 2011-11-30 [[email protected]] fix the memory leak */
	kfree(data);

	return 0;
}
Ejemplo n.º 11
0
static int vibrator_probe(struct platform_device *pdev)
{
	int nRet, i;   /* initialized below */

	struct pwm_vibrator_platform_data *pdata = pdev->dev.platform_data;
	struct pwm_vib_data *data;

	DbgOut((KERN_DEBUG "tspdrv: %s\n", __func__));
	data = kzalloc(sizeof(struct pwm_vib_data), GFP_KERNEL);
	if (!data) {
		dev_err(&pdev->dev, "tspdrv: %s: no memory\n", __func__);
		return -ENOMEM;
	}
	/* LGE_SJIT 2011-12-01 [[email protected]]
	 * To make it as platform-independent driver
	 */
	pwm_priv = data;

	if (pdata) {
		data->power = pdata->power;
		data->gpio_enable = pdata->gpio_enable;
		data->pwm_port = pdata->port;
		data->pwm_freq = pdata->freq;
		data->pwm_duty = pdata->duty;
	}
	if(data->power)
		data->power(1);
	
	/* /register a miscellaneous device */
	nRet = misc_register(&miscdev);
	if (nRet) {
		dev_err(&pdev->dev, "tspdrv: %s: misc_register failed\n",
				__func__);
		goto err_misc_register;
	}

	DbgRecorderInit(());
	/* to set PWM freq, disable amp, etc...*/
	ImmVibeSPI_ForceOut_Initialize();//Currently, Timer stats is disabled. 
	/* 5milliseconds's timer setting!!*/
	VibeOSKernelLinuxInitTimer();

	/* Get and concatenate device name and initialize data buffer */
	g_cchDeviceName = 0;
	for (i=0; i<NUM_ACTUATORS; i++) {
		char *szName = g_szDeviceName + g_cchDeviceName;
		ImmVibeSPI_Device_GetName(i, szName, VIBE_MAX_DEVICE_NAME_LENGTH);

		/* Append version information and get buffer length */
		strcat(szName, VERSION_STR);
		g_cchDeviceName += strlen(szName);

		g_SamplesBuffer[i].nIndexPlayingBuffer = -1; /* Not playing */
		g_SamplesBuffer[i].actuatorSamples[0].nBufferSize = 0;
		g_SamplesBuffer[i].actuatorSamples[1].nBufferSize = 0;
	}

	/* LGE_SJIT 2011-11-30 [[email protected]] support for timed output class */
#if defined(CONFIG_TSPDRV_TIMED_OUTPUT)
	spin_lock_init(&vibe_lock);

	hrtimer_init(&vibe_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	vibe_timer.function = vibrator_timer_func;

	timed_dev.name     = "vibrator";
	timed_dev.get_time = vibrator_get_time;
	timed_dev.enable   = vibrator_enable;
	nRet = timed_output_dev_register(&timed_dev);
	if (nRet < 0) {
		dev_err(&pdev->dev, "tspdrv: %s: timed_output_dev_register failed\n", __func__);
		goto err_timed_output_dev_register;
	}
#endif

	platform_set_drvdata(pdev, data);

	dev_info(&pdev->dev, "tspdrv: probed\n");
	return 0;

/* LGE_SJIT 2011-11-30 [[email protected]] support for timed output class */
#if defined(CONFIG_TSPDRV_TIMED_OUTPUT)
	timed_output_dev_unregister(&timed_dev);
err_timed_output_dev_register:
	hrtimer_cancel(&vibe_timer);
#endif
	DbgRecorderTerminate(());
	VibeOSKernelLinuxTerminateTimer();
	ImmVibeSPI_ForceOut_Terminate();
	misc_deregister(&miscdev);
err_misc_register:
	kfree(data);
	return nRet;
}