synaptics_rmi_dev.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. /*
  2. * Synaptics RMI4 touchscreen driver
  3. *
  4. * Copyright (C) 2012 Synaptics Incorporated
  5. *
  6. * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
  7. * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/module.h>
  21. #include <linux/slab.h>
  22. #include <linux/i2c.h>
  23. #include <linux/interrupt.h>
  24. #include <linux/delay.h>
  25. #include <linux/input.h>
  26. #include <linux/gpio.h>
  27. #include <linux/uaccess.h>
  28. #include <linux/cdev.h>
  29. #include <linux/input/synaptics_dsx.h>
  30. #include "synaptics_i2c_rmi4.h"
  31. #define CHAR_DEVICE_NAME "rmi"
  32. #define DEVICE_CLASS_NAME "rmidev"
  33. #define DEV_NUMBER 1
  34. #define REG_ADDR_LIMIT 0xFFFF
  35. static ssize_t rmidev_sysfs_open_store(struct device *dev,
  36. struct device_attribute *attr, const char *buf, size_t count);
  37. static ssize_t rmidev_sysfs_release_store(struct device *dev,
  38. struct device_attribute *attr, const char *buf, size_t count);
  39. static ssize_t rmidev_sysfs_address_store(struct device *dev,
  40. struct device_attribute *attr, const char *buf, size_t count);
  41. static ssize_t rmidev_sysfs_length_store(struct device *dev,
  42. struct device_attribute *attr, const char *buf, size_t count);
  43. static ssize_t rmidev_sysfs_data_show(struct device *dev,
  44. struct device_attribute *attr, char *buf);
  45. static ssize_t rmidev_sysfs_data_store(struct device *dev,
  46. struct device_attribute *attr, const char *buf, size_t count);
  47. struct rmidev_handle {
  48. dev_t dev_no;
  49. unsigned short address;
  50. unsigned int length;
  51. struct device dev;
  52. struct synaptics_rmi4_data *rmi4_data;
  53. struct synaptics_rmi4_exp_fn_ptr *fn_ptr;
  54. struct kobject *sysfs_dir;
  55. void *data;
  56. };
  57. struct rmidev_data {
  58. int ref_count;
  59. struct cdev main_dev;
  60. struct class *device_class;
  61. struct mutex file_mutex;
  62. struct rmidev_handle *rmi_dev;
  63. };
  64. static struct device_attribute attrs[] = {
  65. __ATTR(open, S_IWUGO,
  66. synaptics_rmi4_show_error,
  67. rmidev_sysfs_open_store),
  68. __ATTR(release, S_IWUGO,
  69. synaptics_rmi4_show_error,
  70. rmidev_sysfs_release_store),
  71. __ATTR(address, S_IWUGO,
  72. synaptics_rmi4_show_error,
  73. rmidev_sysfs_address_store),
  74. __ATTR(length, S_IWUGO,
  75. synaptics_rmi4_show_error,
  76. rmidev_sysfs_length_store),
  77. __ATTR(data, (S_IRUGO | S_IWUGO),
  78. rmidev_sysfs_data_show,
  79. rmidev_sysfs_data_store),
  80. };
  81. static int rmidev_major_num;
  82. static struct class *rmidev_device_class;
  83. static struct rmidev_handle *rmidev;
  84. static struct completion remove_complete;
  85. static ssize_t rmidev_sysfs_open_store(struct device *dev,
  86. struct device_attribute *attr, const char *buf, size_t count)
  87. {
  88. unsigned int input;
  89. if (sscanf(buf, "%u", &input) != 1)
  90. return -EINVAL;
  91. if (input != 1)
  92. return -EINVAL;
  93. rmidev->fn_ptr->enable(rmidev->rmi4_data, false);
  94. dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
  95. "%s: Attention interrupt disabled\n",
  96. __func__);
  97. return count;
  98. }
  99. static ssize_t rmidev_sysfs_release_store(struct device *dev,
  100. struct device_attribute *attr, const char *buf, size_t count)
  101. {
  102. unsigned int input;
  103. if (sscanf(buf, "%u", &input) != 1)
  104. return -EINVAL;
  105. if (input != 1)
  106. return -EINVAL;
  107. rmidev->fn_ptr->enable(rmidev->rmi4_data, true);
  108. dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
  109. "%s: Attention interrupt enabled\n",
  110. __func__);
  111. return count;
  112. }
  113. static ssize_t rmidev_sysfs_address_store(struct device *dev,
  114. struct device_attribute *attr, const char *buf, size_t count)
  115. {
  116. unsigned int input;
  117. if (sscanf(buf, "%u", &input) != 1)
  118. return -EINVAL;
  119. if (input > REG_ADDR_LIMIT)
  120. return -EINVAL;
  121. rmidev->address = (unsigned short)input;
  122. return count;
  123. }
  124. static ssize_t rmidev_sysfs_length_store(struct device *dev,
  125. struct device_attribute *attr, const char *buf, size_t count)
  126. {
  127. unsigned int input;
  128. if (sscanf(buf, "%u", &input) != 1)
  129. return -EINVAL;
  130. if (input > REG_ADDR_LIMIT)
  131. return -EINVAL;
  132. rmidev->length = input;
  133. return count;
  134. }
  135. static ssize_t rmidev_sysfs_data_show(struct device *dev,
  136. struct device_attribute *attr, char *buf)
  137. {
  138. int retval;
  139. unsigned int data_length = rmidev->length;
  140. if (data_length > (REG_ADDR_LIMIT - rmidev->address))
  141. data_length = REG_ADDR_LIMIT - rmidev->address;
  142. if (data_length) {
  143. retval = rmidev->fn_ptr->read(rmidev->rmi4_data,
  144. rmidev->address,
  145. (unsigned char *)buf,
  146. data_length);
  147. if (retval < 0) {
  148. dev_err(&rmidev->rmi4_data->i2c_client->dev,
  149. "%s: Failed to read data\n",
  150. __func__);
  151. return retval;
  152. }
  153. } else {
  154. return -EINVAL;
  155. }
  156. return data_length;
  157. }
  158. static ssize_t rmidev_sysfs_data_store(struct device *dev,
  159. struct device_attribute *attr, const char *buf, size_t count)
  160. {
  161. int retval;
  162. unsigned int data_length = rmidev->length;
  163. if (data_length > (REG_ADDR_LIMIT - rmidev->address))
  164. data_length = REG_ADDR_LIMIT - rmidev->address;
  165. if (data_length) {
  166. retval = rmidev->fn_ptr->write(rmidev->rmi4_data,
  167. rmidev->address,
  168. (unsigned char *)buf,
  169. data_length);
  170. if (retval < 0) {
  171. dev_err(&rmidev->rmi4_data->i2c_client->dev,
  172. "%s: Failed to write data\n",
  173. __func__);
  174. return retval;
  175. }
  176. } else {
  177. return -EINVAL;
  178. }
  179. return data_length;
  180. }
  181. /*
  182. * rmidev_llseek - used to set up register address
  183. *
  184. * @filp: file structure for seek
  185. * @off: offset
  186. * if whence == SEEK_SET,
  187. * high 16 bits: page address
  188. * low 16 bits: register address
  189. * if whence == SEEK_CUR,
  190. * offset from current position
  191. * if whence == SEEK_END,
  192. * offset from end position (0xFFFF)
  193. * @whence: SEEK_SET, SEEK_CUR, or SEEK_END
  194. */
  195. static loff_t rmidev_llseek(struct file *filp, loff_t off, int whence)
  196. {
  197. loff_t newpos;
  198. struct rmidev_data *dev_data = filp->private_data;
  199. if (IS_ERR(dev_data)) {
  200. pr_err("%s: Pointer of char device data is invalid", __func__);
  201. return -EBADF;
  202. }
  203. mutex_lock(&(dev_data->file_mutex));
  204. switch (whence) {
  205. case SEEK_SET:
  206. newpos = off;
  207. break;
  208. case SEEK_CUR:
  209. newpos = filp->f_pos + off;
  210. break;
  211. case SEEK_END:
  212. newpos = REG_ADDR_LIMIT + off;
  213. break;
  214. default:
  215. newpos = -EINVAL;
  216. goto clean_up;
  217. }
  218. if (newpos < 0 || newpos > REG_ADDR_LIMIT) {
  219. dev_err(&rmidev->rmi4_data->i2c_client->dev,
  220. "%s: New position 0x%04x is invalid\n",
  221. __func__, (unsigned int)newpos);
  222. newpos = -EINVAL;
  223. goto clean_up;
  224. }
  225. filp->f_pos = newpos;
  226. clean_up:
  227. mutex_unlock(&(dev_data->file_mutex));
  228. return newpos;
  229. }
  230. /*
  231. * rmidev_read: - use to read data from rmi device
  232. *
  233. * @filp: file structure for read
  234. * @buf: user space buffer pointer
  235. * @count: number of bytes to read
  236. * @f_pos: offset (starting register address)
  237. */
  238. static ssize_t rmidev_read(struct file *filp, char __user *buf,
  239. size_t count, loff_t *f_pos)
  240. {
  241. ssize_t retval;
  242. unsigned char tmpbuf[count + 1];
  243. struct rmidev_data *dev_data = filp->private_data;
  244. if (IS_ERR(dev_data)) {
  245. pr_err("%s: Pointer of char device data is invalid", __func__);
  246. return -EBADF;
  247. }
  248. if (count == 0)
  249. return 0;
  250. if (count > (REG_ADDR_LIMIT - *f_pos))
  251. count = REG_ADDR_LIMIT - *f_pos;
  252. mutex_lock(&(dev_data->file_mutex));
  253. retval = rmidev->fn_ptr->read(rmidev->rmi4_data,
  254. *f_pos,
  255. tmpbuf,
  256. count);
  257. if (retval < 0)
  258. goto clean_up;
  259. if (copy_to_user(buf, tmpbuf, count))
  260. retval = -EFAULT;
  261. else
  262. *f_pos += retval;
  263. clean_up:
  264. mutex_unlock(&(dev_data->file_mutex));
  265. return retval;
  266. }
  267. /*
  268. * rmidev_write: - used to write data to rmi device
  269. *
  270. * @filep: file structure for write
  271. * @buf: user space buffer pointer
  272. * @count: number of bytes to write
  273. * @f_pos: offset (starting register address)
  274. */
  275. static ssize_t rmidev_write(struct file *filp, const char __user *buf,
  276. size_t count, loff_t *f_pos)
  277. {
  278. ssize_t retval;
  279. unsigned char tmpbuf[count + 1];
  280. struct rmidev_data *dev_data = filp->private_data;
  281. if (IS_ERR(dev_data)) {
  282. pr_err("%s: Pointer of char device data is invalid", __func__);
  283. return -EBADF;
  284. }
  285. if (count == 0)
  286. return 0;
  287. if (count > (REG_ADDR_LIMIT - *f_pos))
  288. count = REG_ADDR_LIMIT - *f_pos;
  289. if (copy_from_user(tmpbuf, buf, count))
  290. return -EFAULT;
  291. mutex_lock(&(dev_data->file_mutex));
  292. retval = rmidev->fn_ptr->write(rmidev->rmi4_data,
  293. *f_pos,
  294. tmpbuf,
  295. count);
  296. if (retval >= 0)
  297. *f_pos += retval;
  298. mutex_unlock(&(dev_data->file_mutex));
  299. return retval;
  300. }
  301. /*
  302. * rmidev_open: enable access to rmi device
  303. * @inp: inode struture
  304. * @filp: file structure
  305. */
  306. static int rmidev_open(struct inode *inp, struct file *filp)
  307. {
  308. int retval = 0;
  309. struct rmidev_data *dev_data =
  310. container_of(inp->i_cdev, struct rmidev_data, main_dev);
  311. if (!dev_data)
  312. return -EACCES;
  313. filp->private_data = dev_data;
  314. mutex_lock(&(dev_data->file_mutex));
  315. rmidev->fn_ptr->enable(rmidev->rmi4_data, false);
  316. dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
  317. "%s: Attention interrupt disabled\n",
  318. __func__);
  319. if (dev_data->ref_count < 1)
  320. dev_data->ref_count++;
  321. else
  322. retval = -EACCES;
  323. mutex_unlock(&(dev_data->file_mutex));
  324. return retval;
  325. }
  326. /*
  327. * rmidev_release: - release access to rmi device
  328. * @inp: inode structure
  329. * @filp: file structure
  330. */
  331. static int rmidev_release(struct inode *inp, struct file *filp)
  332. {
  333. struct rmidev_data *dev_data =
  334. container_of(inp->i_cdev, struct rmidev_data, main_dev);
  335. if (!dev_data)
  336. return -EACCES;
  337. mutex_lock(&(dev_data->file_mutex));
  338. dev_data->ref_count--;
  339. if (dev_data->ref_count < 0)
  340. dev_data->ref_count = 0;
  341. rmidev->fn_ptr->enable(rmidev->rmi4_data, true);
  342. dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
  343. "%s: Attention interrupt enabled\n",
  344. __func__);
  345. mutex_unlock(&(dev_data->file_mutex));
  346. return 0;
  347. }
  348. static const struct file_operations rmidev_fops = {
  349. .owner = THIS_MODULE,
  350. .llseek = rmidev_llseek,
  351. .read = rmidev_read,
  352. .write = rmidev_write,
  353. .open = rmidev_open,
  354. .release = rmidev_release,
  355. };
  356. static void rmidev_device_cleanup(struct rmidev_data *dev_data)
  357. {
  358. dev_t devno;
  359. if (dev_data) {
  360. devno = dev_data->main_dev.dev;
  361. if (dev_data->device_class)
  362. device_destroy(dev_data->device_class, devno);
  363. cdev_del(&dev_data->main_dev);
  364. unregister_chrdev_region(devno, 1);
  365. dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
  366. "%s: rmidev device removed\n",
  367. __func__);
  368. }
  369. return;
  370. }
  371. static char *rmi_char_devnode(struct device *dev, mode_t *mode)
  372. {
  373. if (!mode)
  374. return NULL;
  375. *mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
  376. return kasprintf(GFP_KERNEL, "rmi/%s", dev_name(dev));
  377. }
  378. static int rmidev_create_device_class(void)
  379. {
  380. rmidev_device_class = class_create(THIS_MODULE, DEVICE_CLASS_NAME);
  381. if (IS_ERR(rmidev_device_class)) {
  382. pr_err("%s: Failed to create /dev/%s\n",
  383. __func__, CHAR_DEVICE_NAME);
  384. return -ENODEV;
  385. }
  386. rmidev_device_class->devnode = rmi_char_devnode;
  387. return 0;
  388. }
  389. static int rmidev_init_device(struct synaptics_rmi4_data *rmi4_data)
  390. {
  391. int retval;
  392. dev_t dev_no;
  393. unsigned char attr_count;
  394. struct rmidev_data *dev_data;
  395. struct device *device_ptr;
  396. rmidev = kzalloc(sizeof(*rmidev), GFP_KERNEL);
  397. if (!rmidev) {
  398. dev_err(&rmi4_data->i2c_client->dev,
  399. "%s: Failed to alloc mem for rmidev\n",
  400. __func__);
  401. retval = -ENOMEM;
  402. goto err_rmidev;
  403. }
  404. rmidev->fn_ptr = kzalloc(sizeof(*(rmidev->fn_ptr)), GFP_KERNEL);
  405. if (!rmidev) {
  406. dev_err(&rmi4_data->i2c_client->dev,
  407. "%s: Failed to alloc mem for fn_ptr\n",
  408. __func__);
  409. retval = -ENOMEM;
  410. goto err_fn_ptr;
  411. }
  412. rmidev->fn_ptr->read = rmi4_data->i2c_read;
  413. rmidev->fn_ptr->write = rmi4_data->i2c_write;
  414. rmidev->fn_ptr->enable = rmi4_data->irq_enable;
  415. rmidev->rmi4_data = rmi4_data;
  416. retval = rmidev_create_device_class();
  417. if (retval < 0) {
  418. dev_err(&rmi4_data->i2c_client->dev,
  419. "%s: Failed to create device class\n",
  420. __func__);
  421. goto err_device_class;
  422. }
  423. if (rmidev_major_num) {
  424. dev_no = MKDEV(rmidev_major_num, DEV_NUMBER);
  425. retval = register_chrdev_region(dev_no, 1, CHAR_DEVICE_NAME);
  426. } else {
  427. retval = alloc_chrdev_region(&dev_no, 0, 1, CHAR_DEVICE_NAME);
  428. if (retval < 0) {
  429. dev_err(&rmi4_data->i2c_client->dev,
  430. "%s: Failed to allocate char device region\n",
  431. __func__);
  432. goto err_device_region;
  433. }
  434. rmidev_major_num = MAJOR(dev_no);
  435. dev_dbg(&rmi4_data->i2c_client->dev,
  436. "%s: Major number of rmidev = %d\n",
  437. __func__, rmidev_major_num);
  438. }
  439. dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
  440. if (!dev_data) {
  441. dev_err(&rmi4_data->i2c_client->dev,
  442. "%s: Failed to alloc mem for dev_data\n",
  443. __func__);
  444. retval = -ENOMEM;
  445. goto err_dev_data;
  446. }
  447. mutex_init(&dev_data->file_mutex);
  448. dev_data->rmi_dev = rmidev;
  449. rmidev->data = dev_data;
  450. cdev_init(&dev_data->main_dev, &rmidev_fops);
  451. retval = cdev_add(&dev_data->main_dev, dev_no, 1);
  452. if (retval < 0) {
  453. dev_err(&rmi4_data->i2c_client->dev,
  454. "%s: Failed to add rmi char device\n",
  455. __func__);
  456. goto err_char_device;
  457. }
  458. dev_set_name(&rmidev->dev, "rmidev%d", MINOR(dev_no));
  459. dev_data->device_class = rmidev_device_class;
  460. device_ptr = device_create(dev_data->device_class, NULL, dev_no,
  461. NULL, CHAR_DEVICE_NAME"%d", MINOR(dev_no));
  462. if (IS_ERR(device_ptr)) {
  463. dev_err(&rmi4_data->i2c_client->dev,
  464. "%s: Failed to create rmi char device\n",
  465. __func__);
  466. retval = -ENODEV;
  467. goto err_char_device;
  468. }
  469. retval = gpio_export(rmi4_data->board->irq_gpio, false);
  470. if (retval < 0) {
  471. dev_err(&rmi4_data->i2c_client->dev,
  472. "%s: Failed to export attention gpio\n",
  473. __func__);
  474. } else {
  475. retval = gpio_export_link(&(rmi4_data->input_dev->dev),
  476. "attn", rmi4_data->board->irq_gpio);
  477. if (retval < 0) {
  478. dev_err(&rmi4_data->input_dev->dev,
  479. "%s Failed to create gpio symlink\n",
  480. __func__);
  481. } else {
  482. dev_dbg(&rmi4_data->input_dev->dev,
  483. "%s: Exported attention gpio %d\n",
  484. __func__, rmi4_data->board->irq_gpio);
  485. }
  486. }
  487. rmidev->sysfs_dir = kobject_create_and_add("rmidev",
  488. &rmi4_data->input_dev->dev.kobj);
  489. if (!rmidev->sysfs_dir) {
  490. dev_err(&rmi4_data->i2c_client->dev,
  491. "%s: Failed to create sysfs directory\n",
  492. __func__);
  493. goto err_sysfs_dir;
  494. }
  495. for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++) {
  496. retval = sysfs_create_file(rmidev->sysfs_dir,
  497. &attrs[attr_count].attr);
  498. if (retval < 0) {
  499. dev_err(&rmi4_data->input_dev->dev,
  500. "%s: Failed to create sysfs attributes\n",
  501. __func__);
  502. retval = -ENODEV;
  503. goto err_sysfs_attrs;
  504. }
  505. }
  506. init_completion(&remove_complete);
  507. return 0;
  508. err_sysfs_attrs:
  509. for (attr_count--; attr_count >= 0; attr_count--) {
  510. sysfs_remove_file(&rmi4_data->input_dev->dev.kobj,
  511. &attrs[attr_count].attr);
  512. }
  513. kobject_put(rmidev->sysfs_dir);
  514. err_sysfs_dir:
  515. err_char_device:
  516. rmidev_device_cleanup(dev_data);
  517. kfree(dev_data);
  518. err_dev_data:
  519. unregister_chrdev_region(dev_no, 1);
  520. err_device_region:
  521. class_destroy(rmidev_device_class);
  522. err_device_class:
  523. kfree(rmidev->fn_ptr);
  524. err_fn_ptr:
  525. kfree(rmidev);
  526. err_rmidev:
  527. return retval;
  528. }
  529. static void rmidev_remove_device(struct synaptics_rmi4_data *rmi4_data)
  530. {
  531. unsigned char attr_count;
  532. struct rmidev_data *dev_data;
  533. if (!rmidev)
  534. return;
  535. for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++)
  536. sysfs_remove_file(rmidev->sysfs_dir, &attrs[attr_count].attr);
  537. kobject_put(rmidev->sysfs_dir);
  538. dev_data = rmidev->data;
  539. if (dev_data) {
  540. rmidev_device_cleanup(dev_data);
  541. kfree(dev_data);
  542. }
  543. unregister_chrdev_region(rmidev->dev_no, 1);
  544. class_destroy(rmidev_device_class);
  545. kfree(rmidev->fn_ptr);
  546. kfree(rmidev);
  547. complete(&remove_complete);
  548. return;
  549. }
  550. static int __init rmidev_module_init(void)
  551. {
  552. synaptics_rmi4_new_function(RMI_DEV, true,
  553. rmidev_init_device,
  554. rmidev_remove_device,
  555. NULL);
  556. return 0;
  557. }
  558. static void __exit rmidev_module_exit(void)
  559. {
  560. init_completion(&remove_complete);
  561. synaptics_rmi4_new_function(RMI_DEV, false,
  562. rmidev_init_device,
  563. rmidev_remove_device,
  564. NULL);
  565. wait_for_completion(&remove_complete);
  566. return;
  567. }
  568. module_init(rmidev_module_init);
  569. module_exit(rmidev_module_exit);
  570. MODULE_AUTHOR("Synaptics, Inc.");
  571. MODULE_DESCRIPTION("RMI4 RMI_Dev Module");
  572. MODULE_LICENSE("GPL v2");