ilitek_ts_i2c.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * ILITEK Touch IC driver for 23XX, 25XX and Lego series
  4. *
  5. * Copyright (C) 2011 ILI Technology Corporation.
  6. * Copyright (C) 2020 Luca Hsu <[email protected]>
  7. * Copyright (C) 2021 Joe Hung <[email protected]>
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/module.h>
  11. #include <linux/input.h>
  12. #include <linux/input/mt.h>
  13. #include <linux/i2c.h>
  14. #include <linux/slab.h>
  15. #include <linux/delay.h>
  16. #include <linux/interrupt.h>
  17. #include <linux/gpio.h>
  18. #include <linux/gpio/consumer.h>
  19. #include <linux/errno.h>
  20. #include <linux/acpi.h>
  21. #include <linux/input/touchscreen.h>
  22. #include <asm/unaligned.h>
  23. #define ILITEK_TS_NAME "ilitek_ts"
  24. #define BL_V1_8 0x108
  25. #define BL_V1_7 0x107
  26. #define BL_V1_6 0x106
  27. #define ILITEK_TP_CMD_GET_TP_RES 0x20
  28. #define ILITEK_TP_CMD_GET_SCRN_RES 0x21
  29. #define ILITEK_TP_CMD_SET_IC_SLEEP 0x30
  30. #define ILITEK_TP_CMD_SET_IC_WAKE 0x31
  31. #define ILITEK_TP_CMD_GET_FW_VER 0x40
  32. #define ILITEK_TP_CMD_GET_PRL_VER 0x42
  33. #define ILITEK_TP_CMD_GET_MCU_VER 0x61
  34. #define ILITEK_TP_CMD_GET_IC_MODE 0xC0
  35. #define REPORT_COUNT_ADDRESS 61
  36. #define ILITEK_SUPPORT_MAX_POINT 40
  37. struct ilitek_protocol_info {
  38. u16 ver;
  39. u8 ver_major;
  40. };
  41. struct ilitek_ts_data {
  42. struct i2c_client *client;
  43. struct gpio_desc *reset_gpio;
  44. struct input_dev *input_dev;
  45. struct touchscreen_properties prop;
  46. const struct ilitek_protocol_map *ptl_cb_func;
  47. struct ilitek_protocol_info ptl;
  48. char product_id[30];
  49. u16 mcu_ver;
  50. u8 ic_mode;
  51. u8 firmware_ver[8];
  52. s32 reset_time;
  53. s32 screen_max_x;
  54. s32 screen_max_y;
  55. s32 screen_min_x;
  56. s32 screen_min_y;
  57. s32 max_tp;
  58. };
  59. struct ilitek_protocol_map {
  60. u16 cmd;
  61. const char *name;
  62. int (*func)(struct ilitek_ts_data *ts, u16 cmd, u8 *inbuf, u8 *outbuf);
  63. };
  64. enum ilitek_cmds {
  65. /* common cmds */
  66. GET_PTL_VER = 0,
  67. GET_FW_VER,
  68. GET_SCRN_RES,
  69. GET_TP_RES,
  70. GET_IC_MODE,
  71. GET_MCU_VER,
  72. SET_IC_SLEEP,
  73. SET_IC_WAKE,
  74. /* ALWAYS keep at the end */
  75. MAX_CMD_CNT
  76. };
  77. /* ILITEK I2C R/W APIs */
  78. static int ilitek_i2c_write_and_read(struct ilitek_ts_data *ts,
  79. u8 *cmd, int write_len, int delay,
  80. u8 *data, int read_len)
  81. {
  82. int error;
  83. struct i2c_client *client = ts->client;
  84. struct i2c_msg msgs[] = {
  85. {
  86. .addr = client->addr,
  87. .flags = 0,
  88. .len = write_len,
  89. .buf = cmd,
  90. },
  91. {
  92. .addr = client->addr,
  93. .flags = I2C_M_RD,
  94. .len = read_len,
  95. .buf = data,
  96. },
  97. };
  98. if (delay == 0 && write_len > 0 && read_len > 0) {
  99. error = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
  100. if (error < 0)
  101. return error;
  102. } else {
  103. if (write_len > 0) {
  104. error = i2c_transfer(client->adapter, msgs, 1);
  105. if (error < 0)
  106. return error;
  107. }
  108. if (delay > 0)
  109. mdelay(delay);
  110. if (read_len > 0) {
  111. error = i2c_transfer(client->adapter, msgs + 1, 1);
  112. if (error < 0)
  113. return error;
  114. }
  115. }
  116. return 0;
  117. }
  118. /* ILITEK ISR APIs */
  119. static void ilitek_touch_down(struct ilitek_ts_data *ts, unsigned int id,
  120. unsigned int x, unsigned int y)
  121. {
  122. struct input_dev *input = ts->input_dev;
  123. input_mt_slot(input, id);
  124. input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
  125. touchscreen_report_pos(input, &ts->prop, x, y, true);
  126. }
  127. static int ilitek_process_and_report_v6(struct ilitek_ts_data *ts)
  128. {
  129. int error = 0;
  130. u8 buf[512];
  131. int packet_len = 5;
  132. int packet_max_point = 10;
  133. int report_max_point;
  134. int i, count;
  135. struct input_dev *input = ts->input_dev;
  136. struct device *dev = &ts->client->dev;
  137. unsigned int x, y, status, id;
  138. error = ilitek_i2c_write_and_read(ts, NULL, 0, 0, buf, 64);
  139. if (error) {
  140. dev_err(dev, "get touch info failed, err:%d\n", error);
  141. goto err_sync_frame;
  142. }
  143. report_max_point = buf[REPORT_COUNT_ADDRESS];
  144. if (report_max_point > ts->max_tp) {
  145. dev_err(dev, "FW report max point:%d > panel info. max:%d\n",
  146. report_max_point, ts->max_tp);
  147. error = -EINVAL;
  148. goto err_sync_frame;
  149. }
  150. count = DIV_ROUND_UP(report_max_point, packet_max_point);
  151. for (i = 1; i < count; i++) {
  152. error = ilitek_i2c_write_and_read(ts, NULL, 0, 0,
  153. buf + i * 64, 64);
  154. if (error) {
  155. dev_err(dev, "get touch info. failed, cnt:%d, err:%d\n",
  156. count, error);
  157. goto err_sync_frame;
  158. }
  159. }
  160. for (i = 0; i < report_max_point; i++) {
  161. status = buf[i * packet_len + 1] & 0x40;
  162. if (!status)
  163. continue;
  164. id = buf[i * packet_len + 1] & 0x3F;
  165. x = get_unaligned_le16(buf + i * packet_len + 2);
  166. y = get_unaligned_le16(buf + i * packet_len + 4);
  167. if (x > ts->screen_max_x || x < ts->screen_min_x ||
  168. y > ts->screen_max_y || y < ts->screen_min_y) {
  169. dev_warn(dev, "invalid position, X[%d,%u,%d], Y[%d,%u,%d]\n",
  170. ts->screen_min_x, x, ts->screen_max_x,
  171. ts->screen_min_y, y, ts->screen_max_y);
  172. continue;
  173. }
  174. ilitek_touch_down(ts, id, x, y);
  175. }
  176. err_sync_frame:
  177. input_mt_sync_frame(input);
  178. input_sync(input);
  179. return error;
  180. }
  181. /* APIs of cmds for ILITEK Touch IC */
  182. static int api_protocol_set_cmd(struct ilitek_ts_data *ts,
  183. u16 idx, u8 *inbuf, u8 *outbuf)
  184. {
  185. u16 cmd;
  186. int error;
  187. if (idx >= MAX_CMD_CNT)
  188. return -EINVAL;
  189. cmd = ts->ptl_cb_func[idx].cmd;
  190. error = ts->ptl_cb_func[idx].func(ts, cmd, inbuf, outbuf);
  191. if (error)
  192. return error;
  193. return 0;
  194. }
  195. static int api_protocol_get_ptl_ver(struct ilitek_ts_data *ts,
  196. u16 cmd, u8 *inbuf, u8 *outbuf)
  197. {
  198. int error;
  199. u8 buf[64];
  200. buf[0] = cmd;
  201. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 3);
  202. if (error)
  203. return error;
  204. ts->ptl.ver = get_unaligned_be16(outbuf);
  205. ts->ptl.ver_major = outbuf[0];
  206. return 0;
  207. }
  208. static int api_protocol_get_mcu_ver(struct ilitek_ts_data *ts,
  209. u16 cmd, u8 *inbuf, u8 *outbuf)
  210. {
  211. int error;
  212. u8 buf[64];
  213. buf[0] = cmd;
  214. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 32);
  215. if (error)
  216. return error;
  217. ts->mcu_ver = get_unaligned_le16(outbuf);
  218. memset(ts->product_id, 0, sizeof(ts->product_id));
  219. memcpy(ts->product_id, outbuf + 6, 26);
  220. return 0;
  221. }
  222. static int api_protocol_get_fw_ver(struct ilitek_ts_data *ts,
  223. u16 cmd, u8 *inbuf, u8 *outbuf)
  224. {
  225. int error;
  226. u8 buf[64];
  227. buf[0] = cmd;
  228. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 8);
  229. if (error)
  230. return error;
  231. memcpy(ts->firmware_ver, outbuf, 8);
  232. return 0;
  233. }
  234. static int api_protocol_get_scrn_res(struct ilitek_ts_data *ts,
  235. u16 cmd, u8 *inbuf, u8 *outbuf)
  236. {
  237. int error;
  238. u8 buf[64];
  239. buf[0] = cmd;
  240. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 8);
  241. if (error)
  242. return error;
  243. ts->screen_min_x = get_unaligned_le16(outbuf);
  244. ts->screen_min_y = get_unaligned_le16(outbuf + 2);
  245. ts->screen_max_x = get_unaligned_le16(outbuf + 4);
  246. ts->screen_max_y = get_unaligned_le16(outbuf + 6);
  247. return 0;
  248. }
  249. static int api_protocol_get_tp_res(struct ilitek_ts_data *ts,
  250. u16 cmd, u8 *inbuf, u8 *outbuf)
  251. {
  252. int error;
  253. u8 buf[64];
  254. buf[0] = cmd;
  255. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 15);
  256. if (error)
  257. return error;
  258. ts->max_tp = outbuf[8];
  259. if (ts->max_tp > ILITEK_SUPPORT_MAX_POINT) {
  260. dev_err(&ts->client->dev, "Invalid MAX_TP:%d from FW\n",
  261. ts->max_tp);
  262. return -EINVAL;
  263. }
  264. return 0;
  265. }
  266. static int api_protocol_get_ic_mode(struct ilitek_ts_data *ts,
  267. u16 cmd, u8 *inbuf, u8 *outbuf)
  268. {
  269. int error;
  270. u8 buf[64];
  271. buf[0] = cmd;
  272. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 2);
  273. if (error)
  274. return error;
  275. ts->ic_mode = outbuf[0];
  276. return 0;
  277. }
  278. static int api_protocol_set_ic_sleep(struct ilitek_ts_data *ts,
  279. u16 cmd, u8 *inbuf, u8 *outbuf)
  280. {
  281. u8 buf[64];
  282. buf[0] = cmd;
  283. return ilitek_i2c_write_and_read(ts, buf, 1, 0, NULL, 0);
  284. }
  285. static int api_protocol_set_ic_wake(struct ilitek_ts_data *ts,
  286. u16 cmd, u8 *inbuf, u8 *outbuf)
  287. {
  288. u8 buf[64];
  289. buf[0] = cmd;
  290. return ilitek_i2c_write_and_read(ts, buf, 1, 0, NULL, 0);
  291. }
  292. static const struct ilitek_protocol_map ptl_func_map[] = {
  293. /* common cmds */
  294. [GET_PTL_VER] = {
  295. ILITEK_TP_CMD_GET_PRL_VER, "GET_PTL_VER",
  296. api_protocol_get_ptl_ver
  297. },
  298. [GET_FW_VER] = {
  299. ILITEK_TP_CMD_GET_FW_VER, "GET_FW_VER",
  300. api_protocol_get_fw_ver
  301. },
  302. [GET_SCRN_RES] = {
  303. ILITEK_TP_CMD_GET_SCRN_RES, "GET_SCRN_RES",
  304. api_protocol_get_scrn_res
  305. },
  306. [GET_TP_RES] = {
  307. ILITEK_TP_CMD_GET_TP_RES, "GET_TP_RES",
  308. api_protocol_get_tp_res
  309. },
  310. [GET_IC_MODE] = {
  311. ILITEK_TP_CMD_GET_IC_MODE, "GET_IC_MODE",
  312. api_protocol_get_ic_mode
  313. },
  314. [GET_MCU_VER] = {
  315. ILITEK_TP_CMD_GET_MCU_VER, "GET_MOD_VER",
  316. api_protocol_get_mcu_ver
  317. },
  318. [SET_IC_SLEEP] = {
  319. ILITEK_TP_CMD_SET_IC_SLEEP, "SET_IC_SLEEP",
  320. api_protocol_set_ic_sleep
  321. },
  322. [SET_IC_WAKE] = {
  323. ILITEK_TP_CMD_SET_IC_WAKE, "SET_IC_WAKE",
  324. api_protocol_set_ic_wake
  325. },
  326. };
  327. /* Probe APIs */
  328. static void ilitek_reset(struct ilitek_ts_data *ts, int delay)
  329. {
  330. if (ts->reset_gpio) {
  331. gpiod_set_value(ts->reset_gpio, 1);
  332. mdelay(10);
  333. gpiod_set_value(ts->reset_gpio, 0);
  334. mdelay(delay);
  335. }
  336. }
  337. static int ilitek_protocol_init(struct ilitek_ts_data *ts)
  338. {
  339. int error;
  340. u8 outbuf[64];
  341. ts->ptl_cb_func = ptl_func_map;
  342. ts->reset_time = 600;
  343. error = api_protocol_set_cmd(ts, GET_PTL_VER, NULL, outbuf);
  344. if (error)
  345. return error;
  346. /* Protocol v3 is not support currently */
  347. if (ts->ptl.ver_major == 0x3 ||
  348. ts->ptl.ver == BL_V1_6 ||
  349. ts->ptl.ver == BL_V1_7)
  350. return -EINVAL;
  351. return 0;
  352. }
  353. static int ilitek_read_tp_info(struct ilitek_ts_data *ts, bool boot)
  354. {
  355. u8 outbuf[256];
  356. int error;
  357. error = api_protocol_set_cmd(ts, GET_PTL_VER, NULL, outbuf);
  358. if (error)
  359. return error;
  360. error = api_protocol_set_cmd(ts, GET_MCU_VER, NULL, outbuf);
  361. if (error)
  362. return error;
  363. error = api_protocol_set_cmd(ts, GET_FW_VER, NULL, outbuf);
  364. if (error)
  365. return error;
  366. if (boot) {
  367. error = api_protocol_set_cmd(ts, GET_SCRN_RES, NULL,
  368. outbuf);
  369. if (error)
  370. return error;
  371. }
  372. error = api_protocol_set_cmd(ts, GET_TP_RES, NULL, outbuf);
  373. if (error)
  374. return error;
  375. error = api_protocol_set_cmd(ts, GET_IC_MODE, NULL, outbuf);
  376. if (error)
  377. return error;
  378. return 0;
  379. }
  380. static int ilitek_input_dev_init(struct device *dev, struct ilitek_ts_data *ts)
  381. {
  382. int error;
  383. struct input_dev *input;
  384. input = devm_input_allocate_device(dev);
  385. if (!input)
  386. return -ENOMEM;
  387. ts->input_dev = input;
  388. input->name = ILITEK_TS_NAME;
  389. input->id.bustype = BUS_I2C;
  390. __set_bit(INPUT_PROP_DIRECT, input->propbit);
  391. input_set_abs_params(input, ABS_MT_POSITION_X,
  392. ts->screen_min_x, ts->screen_max_x, 0, 0);
  393. input_set_abs_params(input, ABS_MT_POSITION_Y,
  394. ts->screen_min_y, ts->screen_max_y, 0, 0);
  395. touchscreen_parse_properties(input, true, &ts->prop);
  396. error = input_mt_init_slots(input, ts->max_tp,
  397. INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
  398. if (error) {
  399. dev_err(dev, "initialize MT slots failed, err:%d\n", error);
  400. return error;
  401. }
  402. error = input_register_device(input);
  403. if (error) {
  404. dev_err(dev, "register input device failed, err:%d\n", error);
  405. return error;
  406. }
  407. return 0;
  408. }
  409. static irqreturn_t ilitek_i2c_isr(int irq, void *dev_id)
  410. {
  411. struct ilitek_ts_data *ts = dev_id;
  412. int error;
  413. error = ilitek_process_and_report_v6(ts);
  414. if (error < 0) {
  415. dev_err(&ts->client->dev, "[%s] err:%d\n", __func__, error);
  416. return IRQ_NONE;
  417. }
  418. return IRQ_HANDLED;
  419. }
  420. static ssize_t firmware_version_show(struct device *dev,
  421. struct device_attribute *attr, char *buf)
  422. {
  423. struct i2c_client *client = to_i2c_client(dev);
  424. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  425. return scnprintf(buf, PAGE_SIZE,
  426. "fw version: [%02X%02X.%02X%02X.%02X%02X.%02X%02X]\n",
  427. ts->firmware_ver[0], ts->firmware_ver[1],
  428. ts->firmware_ver[2], ts->firmware_ver[3],
  429. ts->firmware_ver[4], ts->firmware_ver[5],
  430. ts->firmware_ver[6], ts->firmware_ver[7]);
  431. }
  432. static DEVICE_ATTR_RO(firmware_version);
  433. static ssize_t product_id_show(struct device *dev,
  434. struct device_attribute *attr, char *buf)
  435. {
  436. struct i2c_client *client = to_i2c_client(dev);
  437. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  438. return scnprintf(buf, PAGE_SIZE, "product id: [%04X], module: [%s]\n",
  439. ts->mcu_ver, ts->product_id);
  440. }
  441. static DEVICE_ATTR_RO(product_id);
  442. static struct attribute *ilitek_sysfs_attrs[] = {
  443. &dev_attr_firmware_version.attr,
  444. &dev_attr_product_id.attr,
  445. NULL
  446. };
  447. static struct attribute_group ilitek_attrs_group = {
  448. .attrs = ilitek_sysfs_attrs,
  449. };
  450. static int ilitek_ts_i2c_probe(struct i2c_client *client,
  451. const struct i2c_device_id *id)
  452. {
  453. struct ilitek_ts_data *ts;
  454. struct device *dev = &client->dev;
  455. int error;
  456. if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
  457. dev_err(dev, "i2c check functionality failed\n");
  458. return -ENXIO;
  459. }
  460. ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
  461. if (!ts)
  462. return -ENOMEM;
  463. ts->client = client;
  464. i2c_set_clientdata(client, ts);
  465. ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
  466. if (IS_ERR(ts->reset_gpio)) {
  467. error = PTR_ERR(ts->reset_gpio);
  468. dev_err(dev, "request gpiod failed: %d", error);
  469. return error;
  470. }
  471. ilitek_reset(ts, 1000);
  472. error = ilitek_protocol_init(ts);
  473. if (error) {
  474. dev_err(dev, "protocol init failed: %d", error);
  475. return error;
  476. }
  477. error = ilitek_read_tp_info(ts, true);
  478. if (error) {
  479. dev_err(dev, "read tp info failed: %d", error);
  480. return error;
  481. }
  482. error = ilitek_input_dev_init(dev, ts);
  483. if (error) {
  484. dev_err(dev, "input dev init failed: %d", error);
  485. return error;
  486. }
  487. error = devm_request_threaded_irq(dev, ts->client->irq,
  488. NULL, ilitek_i2c_isr, IRQF_ONESHOT,
  489. "ilitek_touch_irq", ts);
  490. if (error) {
  491. dev_err(dev, "request threaded irq failed: %d\n", error);
  492. return error;
  493. }
  494. error = devm_device_add_group(dev, &ilitek_attrs_group);
  495. if (error) {
  496. dev_err(dev, "sysfs create group failed: %d\n", error);
  497. return error;
  498. }
  499. return 0;
  500. }
  501. static int __maybe_unused ilitek_suspend(struct device *dev)
  502. {
  503. struct i2c_client *client = to_i2c_client(dev);
  504. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  505. int error;
  506. disable_irq(client->irq);
  507. if (!device_may_wakeup(dev)) {
  508. error = api_protocol_set_cmd(ts, SET_IC_SLEEP, NULL, NULL);
  509. if (error)
  510. return error;
  511. }
  512. return 0;
  513. }
  514. static int __maybe_unused ilitek_resume(struct device *dev)
  515. {
  516. struct i2c_client *client = to_i2c_client(dev);
  517. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  518. int error;
  519. if (!device_may_wakeup(dev)) {
  520. error = api_protocol_set_cmd(ts, SET_IC_WAKE, NULL, NULL);
  521. if (error)
  522. return error;
  523. ilitek_reset(ts, ts->reset_time);
  524. }
  525. enable_irq(client->irq);
  526. return 0;
  527. }
  528. static SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume);
  529. static const struct i2c_device_id ilitek_ts_i2c_id[] = {
  530. { ILITEK_TS_NAME, 0 },
  531. { },
  532. };
  533. MODULE_DEVICE_TABLE(i2c, ilitek_ts_i2c_id);
  534. #ifdef CONFIG_ACPI
  535. static const struct acpi_device_id ilitekts_acpi_id[] = {
  536. { "ILTK0001", 0 },
  537. { },
  538. };
  539. MODULE_DEVICE_TABLE(acpi, ilitekts_acpi_id);
  540. #endif
  541. #ifdef CONFIG_OF
  542. static const struct of_device_id ilitek_ts_i2c_match[] = {
  543. {.compatible = "ilitek,ili2130",},
  544. {.compatible = "ilitek,ili2131",},
  545. {.compatible = "ilitek,ili2132",},
  546. {.compatible = "ilitek,ili2316",},
  547. {.compatible = "ilitek,ili2322",},
  548. {.compatible = "ilitek,ili2323",},
  549. {.compatible = "ilitek,ili2326",},
  550. {.compatible = "ilitek,ili2520",},
  551. {.compatible = "ilitek,ili2521",},
  552. { },
  553. };
  554. MODULE_DEVICE_TABLE(of, ilitek_ts_i2c_match);
  555. #endif
  556. static struct i2c_driver ilitek_ts_i2c_driver = {
  557. .driver = {
  558. .name = ILITEK_TS_NAME,
  559. .pm = &ilitek_pm_ops,
  560. .of_match_table = of_match_ptr(ilitek_ts_i2c_match),
  561. .acpi_match_table = ACPI_PTR(ilitekts_acpi_id),
  562. },
  563. .probe = ilitek_ts_i2c_probe,
  564. .id_table = ilitek_ts_i2c_id,
  565. };
  566. module_i2c_driver(ilitek_ts_i2c_driver);
  567. MODULE_AUTHOR("ILITEK");
  568. MODULE_DESCRIPTION("ILITEK I2C Touchscreen Driver");
  569. MODULE_LICENSE("GPL");