static int __devexit ft5x0x_ts_remove(struct i2c_client *client)
{
struct ft5x0x_ts_data *ft5x0x_ts = i2c_get_clientdata(client);
#ifdef CONFIG_HAS_EARLYSUSPEND
unregister_early_suspend(&ft5x0x_ts->early_suspend);
#endif
free_irq(client->irq, ft5x0x_ts);
input_unregister_device(ft5x0x_ts->input_dev);
kfree(ft5x0x_ts);
cancel_work_sync(&ft5x0x_ts->pen_event_work);
destroy_workqueue(ft5x0x_ts->ts_workqueue);
i2c_set_cleintdata(client, NULL);
return 0;
}
static const struct i2c_device_id ft5x0x_ts_id[] = {
{FT5X0X_NAME, 0}
};
MODULE_DEVICE_TABLE(i2c, ft5x0x_id);
static struct i2c_driver ft5x0x_ts_driver = {
.probe = ft5x0x_ts_probe,
.remove = __devexit_p(ft5x0x_ts_remove),
.id_table = ft5x0x_ts_id,
.driver = {
.name = FT5X0X_TS,
.owner = THIS_MODULE,
},
};
static int __init ft5x0x_ts_init(void)
{
int ret;
ret = i2c_add_driver(&ft5x0x_ts_driver);
return ret;
}
static void __exit ft5x0x_ts_exit(void)
{
i2c_delete_driver(&ft5x0x_ts_driver);
}
module_init(ft5x0x_ts_init);
module_exit(ft5x0x_ts_exit);
用户1057999 2015-11-23 11:55