ilitek_ts_i2c.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  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 <luca_hsu@ilitek.com>
  7. * Copyright (C) 2021 Joe Hung <joe_hung@ilitek.com>
  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/consumer.h>
  18. #include <linux/errno.h>
  19. #include <linux/acpi.h>
  20. #include <linux/input/touchscreen.h>
  21. #include <linux/unaligned.h>
  22. #define ILITEK_TS_NAME "ilitek_ts"
  23. #define BL_V1_8 0x108
  24. #define BL_V1_7 0x107
  25. #define BL_V1_6 0x106
  26. #define ILITEK_TP_CMD_GET_TP_RES 0x20
  27. #define ILITEK_TP_CMD_GET_SCRN_RES 0x21
  28. #define ILITEK_TP_CMD_SET_IC_SLEEP 0x30
  29. #define ILITEK_TP_CMD_SET_IC_WAKE 0x31
  30. #define ILITEK_TP_CMD_GET_FW_VER 0x40
  31. #define ILITEK_TP_CMD_GET_PRL_VER 0x42
  32. #define ILITEK_TP_CMD_GET_MCU_VER 0x61
  33. #define ILITEK_TP_CMD_GET_IC_MODE 0xC0
  34. #define ILITEK_TP_I2C_REPORT_ID 0x48
  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. fsleep(delay * 1000);
  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. return error;
  142. }
  143. if (buf[0] != ILITEK_TP_I2C_REPORT_ID) {
  144. dev_err(dev, "get touch info failed. Wrong id: 0x%02X\n", buf[0]);
  145. return -EINVAL;
  146. }
  147. report_max_point = buf[REPORT_COUNT_ADDRESS];
  148. if (report_max_point > ts->max_tp) {
  149. dev_err(dev, "FW report max point:%d > panel info. max:%d\n",
  150. report_max_point, ts->max_tp);
  151. return -EINVAL;
  152. }
  153. count = DIV_ROUND_UP(report_max_point, packet_max_point);
  154. for (i = 1; i < count; i++) {
  155. error = ilitek_i2c_write_and_read(ts, NULL, 0, 0,
  156. buf + i * 64, 64);
  157. if (error) {
  158. dev_err(dev, "get touch info. failed, cnt:%d, err:%d\n",
  159. count, error);
  160. return error;
  161. }
  162. }
  163. for (i = 0; i < report_max_point; i++) {
  164. status = buf[i * packet_len + 1] & 0x40;
  165. if (!status)
  166. continue;
  167. id = buf[i * packet_len + 1] & 0x3F;
  168. x = get_unaligned_le16(buf + i * packet_len + 2);
  169. y = get_unaligned_le16(buf + i * packet_len + 4);
  170. if (x > ts->screen_max_x || x < ts->screen_min_x ||
  171. y > ts->screen_max_y || y < ts->screen_min_y) {
  172. dev_warn(dev, "invalid position, X[%d,%u,%d], Y[%d,%u,%d]\n",
  173. ts->screen_min_x, x, ts->screen_max_x,
  174. ts->screen_min_y, y, ts->screen_max_y);
  175. continue;
  176. }
  177. ilitek_touch_down(ts, id, x, y);
  178. }
  179. input_mt_sync_frame(input);
  180. input_sync(input);
  181. return 0;
  182. }
  183. /* APIs of cmds for ILITEK Touch IC */
  184. static int api_protocol_set_cmd(struct ilitek_ts_data *ts,
  185. u16 idx, u8 *inbuf, u8 *outbuf)
  186. {
  187. u16 cmd;
  188. int error;
  189. if (idx >= MAX_CMD_CNT)
  190. return -EINVAL;
  191. cmd = ts->ptl_cb_func[idx].cmd;
  192. error = ts->ptl_cb_func[idx].func(ts, cmd, inbuf, outbuf);
  193. if (error)
  194. return error;
  195. return 0;
  196. }
  197. static int api_protocol_get_ptl_ver(struct ilitek_ts_data *ts,
  198. u16 cmd, u8 *inbuf, u8 *outbuf)
  199. {
  200. int error;
  201. u8 buf[64];
  202. buf[0] = cmd;
  203. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 3);
  204. if (error)
  205. return error;
  206. ts->ptl.ver = get_unaligned_be16(outbuf);
  207. ts->ptl.ver_major = outbuf[0];
  208. return 0;
  209. }
  210. static int api_protocol_get_mcu_ver(struct ilitek_ts_data *ts,
  211. u16 cmd, u8 *inbuf, u8 *outbuf)
  212. {
  213. int error;
  214. u8 buf[64];
  215. buf[0] = cmd;
  216. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 32);
  217. if (error)
  218. return error;
  219. ts->mcu_ver = get_unaligned_le16(outbuf);
  220. memset(ts->product_id, 0, sizeof(ts->product_id));
  221. memcpy(ts->product_id, outbuf + 6, 26);
  222. return 0;
  223. }
  224. static int api_protocol_get_fw_ver(struct ilitek_ts_data *ts,
  225. u16 cmd, u8 *inbuf, u8 *outbuf)
  226. {
  227. int error;
  228. u8 buf[64];
  229. buf[0] = cmd;
  230. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 8);
  231. if (error)
  232. return error;
  233. memcpy(ts->firmware_ver, outbuf, 8);
  234. return 0;
  235. }
  236. static int api_protocol_get_scrn_res(struct ilitek_ts_data *ts,
  237. u16 cmd, u8 *inbuf, u8 *outbuf)
  238. {
  239. int error;
  240. u8 buf[64];
  241. buf[0] = cmd;
  242. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 8);
  243. if (error)
  244. return error;
  245. ts->screen_min_x = get_unaligned_le16(outbuf);
  246. ts->screen_min_y = get_unaligned_le16(outbuf + 2);
  247. ts->screen_max_x = get_unaligned_le16(outbuf + 4);
  248. ts->screen_max_y = get_unaligned_le16(outbuf + 6);
  249. return 0;
  250. }
  251. static int api_protocol_get_tp_res(struct ilitek_ts_data *ts,
  252. u16 cmd, u8 *inbuf, u8 *outbuf)
  253. {
  254. int error;
  255. u8 buf[64];
  256. buf[0] = cmd;
  257. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 15);
  258. if (error)
  259. return error;
  260. ts->max_tp = outbuf[8];
  261. if (ts->max_tp > ILITEK_SUPPORT_MAX_POINT) {
  262. dev_err(&ts->client->dev, "Invalid MAX_TP:%d from FW\n",
  263. ts->max_tp);
  264. return -EINVAL;
  265. }
  266. return 0;
  267. }
  268. static int api_protocol_get_ic_mode(struct ilitek_ts_data *ts,
  269. u16 cmd, u8 *inbuf, u8 *outbuf)
  270. {
  271. int error;
  272. u8 buf[64];
  273. buf[0] = cmd;
  274. error = ilitek_i2c_write_and_read(ts, buf, 1, 5, outbuf, 2);
  275. if (error)
  276. return error;
  277. ts->ic_mode = outbuf[0];
  278. return 0;
  279. }
  280. static int api_protocol_set_ic_sleep(struct ilitek_ts_data *ts,
  281. u16 cmd, u8 *inbuf, u8 *outbuf)
  282. {
  283. u8 buf[64];
  284. buf[0] = cmd;
  285. return ilitek_i2c_write_and_read(ts, buf, 1, 0, NULL, 0);
  286. }
  287. static int api_protocol_set_ic_wake(struct ilitek_ts_data *ts,
  288. u16 cmd, u8 *inbuf, u8 *outbuf)
  289. {
  290. u8 buf[64];
  291. buf[0] = cmd;
  292. return ilitek_i2c_write_and_read(ts, buf, 1, 0, NULL, 0);
  293. }
  294. static const struct ilitek_protocol_map ptl_func_map[] = {
  295. /* common cmds */
  296. [GET_PTL_VER] = {
  297. ILITEK_TP_CMD_GET_PRL_VER, "GET_PTL_VER",
  298. api_protocol_get_ptl_ver
  299. },
  300. [GET_FW_VER] = {
  301. ILITEK_TP_CMD_GET_FW_VER, "GET_FW_VER",
  302. api_protocol_get_fw_ver
  303. },
  304. [GET_SCRN_RES] = {
  305. ILITEK_TP_CMD_GET_SCRN_RES, "GET_SCRN_RES",
  306. api_protocol_get_scrn_res
  307. },
  308. [GET_TP_RES] = {
  309. ILITEK_TP_CMD_GET_TP_RES, "GET_TP_RES",
  310. api_protocol_get_tp_res
  311. },
  312. [GET_IC_MODE] = {
  313. ILITEK_TP_CMD_GET_IC_MODE, "GET_IC_MODE",
  314. api_protocol_get_ic_mode
  315. },
  316. [GET_MCU_VER] = {
  317. ILITEK_TP_CMD_GET_MCU_VER, "GET_MOD_VER",
  318. api_protocol_get_mcu_ver
  319. },
  320. [SET_IC_SLEEP] = {
  321. ILITEK_TP_CMD_SET_IC_SLEEP, "SET_IC_SLEEP",
  322. api_protocol_set_ic_sleep
  323. },
  324. [SET_IC_WAKE] = {
  325. ILITEK_TP_CMD_SET_IC_WAKE, "SET_IC_WAKE",
  326. api_protocol_set_ic_wake
  327. },
  328. };
  329. /* Probe APIs */
  330. static void ilitek_reset(struct ilitek_ts_data *ts, int delay)
  331. {
  332. if (ts->reset_gpio) {
  333. gpiod_set_value_cansleep(ts->reset_gpio, 1);
  334. fsleep(10000);
  335. gpiod_set_value_cansleep(ts->reset_gpio, 0);
  336. fsleep(delay * 1000);
  337. }
  338. }
  339. static int ilitek_protocol_init(struct ilitek_ts_data *ts)
  340. {
  341. int error;
  342. u8 outbuf[64];
  343. ts->ptl_cb_func = ptl_func_map;
  344. ts->reset_time = 600;
  345. error = api_protocol_set_cmd(ts, GET_PTL_VER, NULL, outbuf);
  346. if (error)
  347. return error;
  348. /* Protocol v3 is not support currently */
  349. if (ts->ptl.ver_major == 0x3 ||
  350. ts->ptl.ver == BL_V1_6 ||
  351. ts->ptl.ver == BL_V1_7)
  352. return -EINVAL;
  353. return 0;
  354. }
  355. static int ilitek_read_tp_info(struct ilitek_ts_data *ts, bool boot)
  356. {
  357. u8 outbuf[256];
  358. int error;
  359. error = api_protocol_set_cmd(ts, GET_PTL_VER, NULL, outbuf);
  360. if (error)
  361. return error;
  362. error = api_protocol_set_cmd(ts, GET_MCU_VER, NULL, outbuf);
  363. if (error)
  364. return error;
  365. error = api_protocol_set_cmd(ts, GET_FW_VER, NULL, outbuf);
  366. if (error)
  367. return error;
  368. if (boot) {
  369. error = api_protocol_set_cmd(ts, GET_SCRN_RES, NULL,
  370. outbuf);
  371. if (error)
  372. return error;
  373. }
  374. error = api_protocol_set_cmd(ts, GET_TP_RES, NULL, outbuf);
  375. if (error)
  376. return error;
  377. error = api_protocol_set_cmd(ts, GET_IC_MODE, NULL, outbuf);
  378. if (error)
  379. return error;
  380. return 0;
  381. }
  382. static int ilitek_input_dev_init(struct device *dev, struct ilitek_ts_data *ts)
  383. {
  384. int error;
  385. struct input_dev *input;
  386. input = devm_input_allocate_device(dev);
  387. if (!input)
  388. return -ENOMEM;
  389. ts->input_dev = input;
  390. input->name = ILITEK_TS_NAME;
  391. input->id.bustype = BUS_I2C;
  392. __set_bit(INPUT_PROP_DIRECT, input->propbit);
  393. input_set_abs_params(input, ABS_MT_POSITION_X,
  394. ts->screen_min_x, ts->screen_max_x, 0, 0);
  395. input_set_abs_params(input, ABS_MT_POSITION_Y,
  396. ts->screen_min_y, ts->screen_max_y, 0, 0);
  397. touchscreen_parse_properties(input, true, &ts->prop);
  398. error = input_mt_init_slots(input, ts->max_tp,
  399. INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
  400. if (error) {
  401. dev_err(dev, "initialize MT slots failed, err:%d\n", error);
  402. return error;
  403. }
  404. error = input_register_device(input);
  405. if (error) {
  406. dev_err(dev, "register input device failed, err:%d\n", error);
  407. return error;
  408. }
  409. return 0;
  410. }
  411. static irqreturn_t ilitek_i2c_isr(int irq, void *dev_id)
  412. {
  413. struct ilitek_ts_data *ts = dev_id;
  414. int error;
  415. error = ilitek_process_and_report_v6(ts);
  416. if (error < 0) {
  417. dev_err(&ts->client->dev, "[%s] err:%d\n", __func__, error);
  418. return IRQ_NONE;
  419. }
  420. return IRQ_HANDLED;
  421. }
  422. static ssize_t firmware_version_show(struct device *dev,
  423. struct device_attribute *attr, char *buf)
  424. {
  425. struct i2c_client *client = to_i2c_client(dev);
  426. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  427. return sysfs_emit(buf,
  428. "fw version: [%02X%02X.%02X%02X.%02X%02X.%02X%02X]\n",
  429. ts->firmware_ver[0], ts->firmware_ver[1],
  430. ts->firmware_ver[2], ts->firmware_ver[3],
  431. ts->firmware_ver[4], ts->firmware_ver[5],
  432. ts->firmware_ver[6], ts->firmware_ver[7]);
  433. }
  434. static DEVICE_ATTR_RO(firmware_version);
  435. static ssize_t product_id_show(struct device *dev,
  436. struct device_attribute *attr, char *buf)
  437. {
  438. struct i2c_client *client = to_i2c_client(dev);
  439. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  440. return sysfs_emit(buf, "product id: [%04X], module: [%s]\n",
  441. ts->mcu_ver, ts->product_id);
  442. }
  443. static DEVICE_ATTR_RO(product_id);
  444. static struct attribute *ilitek_sysfs_attrs[] = {
  445. &dev_attr_firmware_version.attr,
  446. &dev_attr_product_id.attr,
  447. NULL
  448. };
  449. ATTRIBUTE_GROUPS(ilitek_sysfs);
  450. static int ilitek_ts_i2c_probe(struct i2c_client *client)
  451. {
  452. struct ilitek_ts_data *ts;
  453. struct device *dev = &client->dev;
  454. int error;
  455. if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
  456. dev_err(dev, "i2c check functionality failed\n");
  457. return -ENXIO;
  458. }
  459. ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
  460. if (!ts)
  461. return -ENOMEM;
  462. ts->client = client;
  463. i2c_set_clientdata(client, ts);
  464. ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
  465. if (IS_ERR(ts->reset_gpio)) {
  466. error = PTR_ERR(ts->reset_gpio);
  467. dev_err(dev, "request gpiod failed: %d", error);
  468. return error;
  469. }
  470. ilitek_reset(ts, 1000);
  471. error = ilitek_protocol_init(ts);
  472. if (error) {
  473. dev_err(dev, "protocol init failed: %d", error);
  474. return error;
  475. }
  476. error = ilitek_read_tp_info(ts, true);
  477. if (error) {
  478. dev_err(dev, "read tp info failed: %d", error);
  479. return error;
  480. }
  481. error = ilitek_input_dev_init(dev, ts);
  482. if (error) {
  483. dev_err(dev, "input dev init failed: %d", error);
  484. return error;
  485. }
  486. error = devm_request_threaded_irq(dev, ts->client->irq,
  487. NULL, ilitek_i2c_isr, IRQF_ONESHOT,
  488. "ilitek_touch_irq", ts);
  489. if (error) {
  490. dev_err(dev, "request threaded irq failed: %d\n", error);
  491. return error;
  492. }
  493. return 0;
  494. }
  495. static int ilitek_suspend(struct device *dev)
  496. {
  497. struct i2c_client *client = to_i2c_client(dev);
  498. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  499. int error;
  500. disable_irq(client->irq);
  501. if (!device_may_wakeup(dev)) {
  502. error = api_protocol_set_cmd(ts, SET_IC_SLEEP, NULL, NULL);
  503. if (error)
  504. return error;
  505. }
  506. return 0;
  507. }
  508. static int ilitek_resume(struct device *dev)
  509. {
  510. struct i2c_client *client = to_i2c_client(dev);
  511. struct ilitek_ts_data *ts = i2c_get_clientdata(client);
  512. int error;
  513. if (!device_may_wakeup(dev)) {
  514. error = api_protocol_set_cmd(ts, SET_IC_WAKE, NULL, NULL);
  515. if (error)
  516. return error;
  517. ilitek_reset(ts, ts->reset_time);
  518. }
  519. enable_irq(client->irq);
  520. return 0;
  521. }
  522. static DEFINE_SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume);
  523. static const struct i2c_device_id ilitek_ts_i2c_id[] = {
  524. { ILITEK_TS_NAME },
  525. { }
  526. };
  527. MODULE_DEVICE_TABLE(i2c, ilitek_ts_i2c_id);
  528. #ifdef CONFIG_ACPI
  529. static const struct acpi_device_id ilitekts_acpi_id[] = {
  530. { "ILTK0001", 0 },
  531. { },
  532. };
  533. MODULE_DEVICE_TABLE(acpi, ilitekts_acpi_id);
  534. #endif
  535. #ifdef CONFIG_OF
  536. static const struct of_device_id ilitek_ts_i2c_match[] = {
  537. {.compatible = "ilitek,ili2130",},
  538. {.compatible = "ilitek,ili2131",},
  539. {.compatible = "ilitek,ili2132",},
  540. {.compatible = "ilitek,ili2316",},
  541. {.compatible = "ilitek,ili2322",},
  542. {.compatible = "ilitek,ili2323",},
  543. {.compatible = "ilitek,ili2326",},
  544. {.compatible = "ilitek,ili2520",},
  545. {.compatible = "ilitek,ili2521",},
  546. { },
  547. };
  548. MODULE_DEVICE_TABLE(of, ilitek_ts_i2c_match);
  549. #endif
  550. static struct i2c_driver ilitek_ts_i2c_driver = {
  551. .driver = {
  552. .name = ILITEK_TS_NAME,
  553. .dev_groups = ilitek_sysfs_groups,
  554. .pm = pm_sleep_ptr(&ilitek_pm_ops),
  555. .of_match_table = of_match_ptr(ilitek_ts_i2c_match),
  556. .acpi_match_table = ACPI_PTR(ilitekts_acpi_id),
  557. },
  558. .probe = ilitek_ts_i2c_probe,
  559. .id_table = ilitek_ts_i2c_id,
  560. };
  561. module_i2c_driver(ilitek_ts_i2c_driver);
  562. MODULE_AUTHOR("ILITEK");
  563. MODULE_DESCRIPTION("ILITEK I2C Touchscreen Driver");
  564. MODULE_LICENSE("GPL");