cst816s_cob_tpkey_acts.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. /*
  2. * Copyright (c) 2017 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file
  8. * @brief TP Keyboard driver for Actions SoC
  9. */
  10. #include <errno.h>
  11. #include <kernel.h>
  12. #include <string.h>
  13. #include <stdbool.h>
  14. #include <init.h>
  15. #include <irq.h>
  16. #include <drivers/adc.h>
  17. #include <drivers/input/input_dev.h>
  18. #include <sys/util.h>
  19. #include <sys/byteorder.h>
  20. #include <board.h>
  21. #include <soc_pmu.h>
  22. #include <logging/log.h>
  23. #include <device.h>
  24. #include <drivers/gpio.h>
  25. #include <soc.h>
  26. #include <string.h>
  27. #include <drivers/i2c.h>
  28. #include <board_cfg.h>
  29. #include "capacitive_hynitron_cst816t_update.h"
  30. LOG_MODULE_REGISTER(tpkey, 2);
  31. #define tp_slaver_addr (0x2A>>1) // 0x15
  32. #define tp_slaver_boot_addr (0x6A)
  33. #define REG_LEN_1B 1
  34. #define REG_LEN_2B 2
  35. #define POINT_REPORT_MODE 1
  36. #define GESTURE_REPORT_MODE 2
  37. #define GESTURE_AND_POINT_REPORT_MODE 3
  38. static const struct gpio_cfg reset_gpio_cfg = CONFIG_TPKEY_RESET_GPIO;
  39. static const struct gpio_cfg power_gpio_cfg = CONFIG_TPKEY_POWER_GPIO;
  40. static const struct gpio_cfg isr_gpio_cfg = CONFIG_TPKEY_ISR_GPIO;
  41. struct acts_tpkey_data {
  42. input_notify_t notify;
  43. const struct device *i2c_dev;
  44. const struct device *gpio_dev;
  45. const struct device *this_dev;
  46. struct gpio_callback key_gpio_cb;
  47. struct k_work init_timer;
  48. bool inited;
  49. #ifdef CONFIG_PM_DEVICE
  50. uint32_t pm_state;
  51. #endif
  52. };
  53. struct acts_tpkey_config {
  54. uint16_t poll_interval_ms;
  55. uint32_t poll_total_ms;
  56. };
  57. uint16_t tp_crc[2] __attribute((used)) = {0};
  58. static struct acts_tpkey_data tpkey_acts_ddata;
  59. static void _cst816t_read_touch(const struct device *i2c_dev, struct input_value *val);
  60. extern int tpkey_put_point(struct input_value *value, uint32_t timestamp);
  61. extern int tpkey_get_last_point(struct input_value *value, uint32_t timestamp);
  62. #define mode_pin (GPIO_PULL_UP | GPIO_INPUT | GPIO_INT_DEBOUNCE)
  63. static void _cst816t_poweron(const struct device *dev, bool is_on)
  64. {
  65. const struct device *gpios_power = device_get_binding(power_gpio_cfg.gpio_dev_name);
  66. gpio_pin_configure(gpios_power, power_gpio_cfg.gpion, GPIO_OUTPUT| GPIO_PULL_UP);
  67. gpio_pin_set_raw(gpios_power, power_gpio_cfg.gpion, is_on ? 0 : 1);
  68. }
  69. static void _tpkey_irq_callback(const struct device *port, struct gpio_callback *cb, uint32_t pins)
  70. {
  71. struct acts_tpkey_data *tpkey = &tpkey_acts_ddata;
  72. struct input_value val;
  73. sys_trace_void(SYS_TRACE_ID_TP_IRQ);
  74. #if 0
  75. static int time_stame = 0;
  76. printk("irq duration : %d \n",k_cyc_to_ns_floor32(k_cycle_get_32() - time_stame));
  77. time_stame = k_cycle_get_32();
  78. #endif
  79. if(tpkey->inited) {
  80. _cst816t_read_touch(tpkey->i2c_dev, &val);
  81. }
  82. sys_trace_end_call(SYS_TRACE_ID_TP_IRQ);
  83. }
  84. static void _cst816t_irq_config(const struct device *dev, bool is_on)
  85. {
  86. struct acts_tpkey_data *tpkey = dev->data;
  87. gpio_pin_configure(tpkey->gpio_dev , isr_gpio_cfg.gpion, mode_pin);
  88. gpio_init_callback(&tpkey->key_gpio_cb , _tpkey_irq_callback, BIT(isr_gpio_cfg.gpion));
  89. if (is_on) {
  90. gpio_add_callback(tpkey->gpio_dev , &tpkey->key_gpio_cb);
  91. } else {
  92. gpio_remove_callback(tpkey->gpio_dev , &tpkey->key_gpio_cb);
  93. }
  94. }
  95. static void _cst816t_reset(const struct device *dev)
  96. {
  97. const struct device *gpios_reset = device_get_binding(reset_gpio_cfg.gpio_dev_name);
  98. gpio_pin_configure(gpios_reset , reset_gpio_cfg.gpion, GPIO_OUTPUT | GPIO_PULL_UP);
  99. gpio_pin_set_raw(gpios_reset , reset_gpio_cfg.gpion, 1);
  100. k_msleep(50);
  101. gpio_pin_set_raw(gpios_reset , reset_gpio_cfg.gpion, 0);
  102. k_msleep(10);
  103. gpio_pin_set_raw(gpios_reset , reset_gpio_cfg.gpion, 1);
  104. k_msleep(5);
  105. }
  106. static int8_t _cst816t_enter_bootmode(const struct device *dev)
  107. {
  108. struct acts_tpkey_data *tpkey = dev->data;
  109. uint8_t retrycnt = 10;
  110. _cst816t_reset(dev);
  111. while(retrycnt--){
  112. uint8_t cmd[4] = {0};
  113. cmd[0] = 0xA0;
  114. cmd[1] = 0x01;
  115. cmd[2] = 0xab;
  116. if(-1 == i2c_write(tpkey->i2c_dev, cmd, 3, tp_slaver_boot_addr)) {
  117. k_busy_wait(4*1000);
  118. continue;
  119. }
  120. cmd[0] = 0xA0;
  121. cmd[1] = 0x03;
  122. if(-1 == i2c_write(tpkey->i2c_dev, cmd, 2, tp_slaver_boot_addr)) {
  123. k_busy_wait(4*1000);
  124. continue;
  125. }
  126. if(-1 == i2c_read(tpkey->i2c_dev, cmd, 1, tp_slaver_boot_addr)) {
  127. k_busy_wait(2*1000);
  128. continue;
  129. } else {
  130. if(cmd[0] != 0xC1) {
  131. k_busy_wait(2*1000);
  132. continue;
  133. } else {
  134. return 0;
  135. }
  136. }
  137. }
  138. return -1;
  139. }
  140. static bool _cst816t_write_bytes(const struct device *dev, uint16_t reg,
  141. uint8_t *data, uint16_t len, uint8_t regLen)
  142. {
  143. int i2c_op_ret = 0;
  144. struct acts_tpkey_data *tpkey = dev->data;
  145. uint8_t retrycnt = 10;
  146. uint8_t sendBuf[140];
  147. int lenT=0;
  148. if (regLen == 2) {
  149. sendBuf[0] = reg / 0x100;
  150. sendBuf[1] = reg % 0x100;
  151. lenT = 2;
  152. } else {
  153. sendBuf[0]=reg % 0x100;
  154. lenT = 1;
  155. }
  156. memcpy(sendBuf + lenT, data, len);
  157. lenT += len;
  158. while (retrycnt--)
  159. {
  160. i2c_op_ret = i2c_write(tpkey->i2c_dev, sendBuf, lenT, tp_slaver_boot_addr);
  161. if (0 != i2c_op_ret) {
  162. k_busy_wait(4*1000);
  163. LOG_ERR("err = %d\n", i2c_op_ret);
  164. } else {
  165. return true;
  166. }
  167. }
  168. return false;
  169. }
  170. static bool _cst816t_read_bytes(const struct device *dev, uint16_t reg, uint8_t *value, uint16_t len,uint8_t regLen)
  171. {
  172. int i2c_op_ret = 0;
  173. struct acts_tpkey_data *tpkey = dev->data;
  174. uint8_t retrycnt = 10;
  175. uint8_t sendBuf[4];
  176. int lenT=0;
  177. if (regLen==2) {
  178. sendBuf[0] = reg / 0x100;
  179. sendBuf[1] = reg % 0x100;
  180. lenT=2;
  181. } else {
  182. sendBuf[0] = reg % 0x100;
  183. lenT=1;
  184. }
  185. while (retrycnt--)
  186. {
  187. i2c_op_ret = i2c_write(tpkey->i2c_dev, sendBuf, lenT, tp_slaver_boot_addr);
  188. if(0 != i2c_op_ret) {
  189. k_busy_wait(4*1000);
  190. LOG_ERR("err = %d\n", i2c_op_ret);
  191. if (retrycnt == 1)
  192. {
  193. return false;
  194. }
  195. }
  196. else
  197. {
  198. break;
  199. }
  200. }
  201. retrycnt = 10;
  202. while (retrycnt--)
  203. {
  204. i2c_op_ret = i2c_read(tpkey->i2c_dev, value, len, tp_slaver_boot_addr);
  205. if(0 != i2c_op_ret) {
  206. k_busy_wait(4*1000);
  207. LOG_ERR("err = %d\n", i2c_op_ret);
  208. }
  209. else
  210. {
  211. return true;
  212. }
  213. }
  214. return false;
  215. }
  216. static int32_t cst816t_read_checksum(const struct device *dev, uint16_t startAddr,uint16_t len)
  217. {
  218. union {
  219. uint32_t sum;
  220. uint8_t buf[4];
  221. } checksum;
  222. uint8_t cmd[3] = {0};
  223. memset(&checksum, 0, sizeof(checksum));
  224. //uint8_t readback[4] = {0};
  225. if (_cst816t_enter_bootmode(dev) == -1) {
  226. return -1;
  227. }
  228. cmd[0] = 0;
  229. if (false == _cst816t_write_bytes(dev, 0xA003, cmd, 1, REG_LEN_2B)) {
  230. return -1;
  231. }
  232. k_busy_wait(500*1000);
  233. checksum.sum = 0;
  234. if (false == _cst816t_read_bytes(dev, 0xA008, checksum.buf, 2, REG_LEN_2B)) {
  235. return -1;
  236. }
  237. return checksum.sum;
  238. }
  239. static int _cst816t_update(const struct device *dev, uint16_t startAddr, uint16_t len, const uint8_t* src)
  240. {
  241. uint16_t sum_len;
  242. uint8_t cmd[10];
  243. if (_cst816t_enter_bootmode(dev) == -1) {
  244. return -1;
  245. }
  246. sum_len = 0;
  247. #define PER_LEN 512
  248. do
  249. {
  250. if (sum_len >= len)
  251. {
  252. return 0;
  253. }
  254. // send address
  255. cmd[0] = startAddr&0xFF;
  256. cmd[1] = startAddr>>8;
  257. _cst816t_write_bytes(dev, 0xA014, cmd, 2, REG_LEN_2B);
  258. int piece_len = 128;
  259. for(int x=0;x<512;x=x+piece_len)
  260. {
  261. _cst816t_write_bytes(dev, 0xA018 + x, (uint8_t*)src + x, piece_len, REG_LEN_2B);
  262. }
  263. cmd[0] = 0xEE;
  264. _cst816t_write_bytes(dev, 0xA004, cmd, 1, REG_LEN_2B);
  265. k_busy_wait(100*1000);
  266. {
  267. uint8_t retrycnt = 50;
  268. while(retrycnt--)
  269. {
  270. cmd[0] = 0;
  271. _cst816t_read_bytes(dev, 0xA005, cmd, 1, REG_LEN_2B);
  272. if (cmd[0] == 0x55)
  273. {
  274. // success
  275. break;
  276. }
  277. k_busy_wait(10*1000);
  278. }
  279. }
  280. startAddr += PER_LEN;
  281. src += PER_LEN;
  282. sum_len += PER_LEN;
  283. } while(len);
  284. // exit program mode
  285. cmd[0] = 0x00;
  286. _cst816t_write_bytes(dev, 0xA003, cmd, 1, REG_LEN_2B);
  287. return 0;
  288. }
  289. static bool _cst816t_hynitron_update(const struct device *dev, bool fource_update)
  290. {
  291. if (_cst816t_enter_bootmode(dev) == 0) {
  292. if(sizeof(app_bin) > 10) {
  293. uint16_t startAddr = app_bin[1];
  294. uint16_t length = app_bin[3];
  295. uint16_t checksum = app_bin[5];
  296. startAddr <<= 8;
  297. startAddr |= app_bin[0];
  298. length <<= 8;
  299. length |= app_bin[2];
  300. checksum <<= 8;
  301. checksum |= app_bin[4];
  302. tp_crc[0] = cst816t_read_checksum(dev, startAddr, length);
  303. tp_crc[0] = cst816t_read_checksum(dev, startAddr, length);
  304. tp_crc[0] = cst816t_read_checksum(dev, startAddr, length);
  305. tp_crc[1] = checksum;
  306. if ((tp_crc[0] != checksum) || fource_update) {
  307. int update_ret = -1;
  308. //LCD_Init();
  309. //tPUpdatePage(0);
  310. update_ret = _cst816t_update(dev, startAddr, length, app_bin+6);
  311. uint32_t crcR=cst816t_read_checksum(dev, startAddr, length);
  312. k_busy_wait(2000*1000);
  313. LOG_INF("crc_now:0x%x, crc_fw:0x%x\n", crcR, checksum);
  314. } else {
  315. LOG_INF("cst816s checksum, crc_now=%x, crc_fw=%x, no need to update tp firmware\n", tp_crc[0], checksum);
  316. }
  317. }
  318. return true;
  319. } else {
  320. printk("_cst816t_enter_bootmode failed\n");
  321. }
  322. return false;
  323. }
  324. static int i2c_async_write_cb(void *cb_data, struct i2c_msg *msgs,
  325. uint8_t num_msgs, bool is_err)
  326. {
  327. if (is_err) {
  328. LOG_ERR("i2c write err\n");
  329. }
  330. return 0;
  331. }
  332. static int i2c_async_read_cb(void *cb_data, struct i2c_msg *msgs,
  333. uint8_t num_msgs, bool is_err)
  334. {
  335. if (!is_err) {
  336. struct input_value val;
  337. //int temp_read = k_cycle_get_32();
  338. val.point.loc_x = (((uint16_t)(msgs->buf[2]&0x0f))<<8) | msgs->buf[3];
  339. val.point.loc_y = (((uint16_t)(msgs->buf[4]&0x0f))<<8) | msgs->buf[5];
  340. val.point.pessure_value = msgs->buf[1];
  341. val.point.gesture = msgs->buf[0];
  342. tpkey_put_point(&val, k_cycle_get_32());
  343. #if 0
  344. LOG_DBG("finger_num = %d, gesture = %d,local:(%d,%d)\n",
  345. msgs->buf[1], val.point.gesture,val.point.loc_x, val.point.loc_y);
  346. #endif
  347. } else {
  348. LOG_ERR("i2c read err\n");
  349. }
  350. return 0;
  351. }
  352. static void _cst816t_read_touch(const struct device *i2c_dev, struct input_value *val)
  353. {
  354. static uint8_t write_cmd[1] = {0};
  355. static uint8_t read_cmd[6] = {0};
  356. int ret = 0;
  357. sys_trace_void(SYS_TRACE_ID_TP_READ);
  358. write_cmd[0] = 0x01;
  359. ret = i2c_write_async(i2c_dev, write_cmd, 1, tp_slaver_addr, i2c_async_write_cb, NULL);
  360. if (ret == -1)
  361. goto exit;
  362. ret = i2c_read_async(i2c_dev, read_cmd, 6, tp_slaver_addr, i2c_async_read_cb, NULL);
  363. if (ret == -1)
  364. goto exit;
  365. exit:
  366. sys_trace_end_call(SYS_TRACE_ID_TP_READ);
  367. }
  368. static void _cst816t_enter_low_power_mode(const struct device *dev, bool low_power)
  369. {
  370. uint8_t cmd[6] = {0};
  371. cmd[0] = 0xfe;
  372. if (low_power) {
  373. cmd[1] = 0;
  374. } else {
  375. cmd[1] = 1;
  376. }
  377. i2c_write(tpkey_acts_ddata.i2c_dev, cmd, 2, tp_slaver_addr);
  378. }
  379. #if 0
  380. static void _cst816t_set_report_mode(const struct device *dev, int mode)
  381. {
  382. uint8_t cmd[6] = {0};
  383. cmd[0] = 0xFA;
  384. if (mode == POINT_REPORT_MODE) {
  385. cmd[1] = 0x60;
  386. } else if (mode == GESTURE_REPORT_MODE) {
  387. cmd[1] = 0x11;
  388. } else if (mode == GESTURE_AND_POINT_REPORT_MODE) {
  389. cmd[1] = 0x71;
  390. }
  391. i2c_write(tpkey_acts_ddata.i2c_dev, cmd, 2, tp_slaver_addr);
  392. }
  393. static void _cst816t_turn_off_auto_reset()
  394. {
  395. uint8_t cmd[6] = {0};
  396. cmd[0] = 0xfb;
  397. cmd[1] = 0;
  398. i2c_write(tpkey_acts_ddata.i2c_dev, cmd, 2, tp_slaver_addr);
  399. cmd[0] = 0xfc;
  400. cmd[1] = 0;
  401. i2c_write(tpkey_acts_ddata.i2c_dev, cmd, 2, tp_slaver_addr);
  402. }
  403. #endif
  404. static const struct acts_tpkey_config _tpkey_acts_cdata = {
  405. .poll_interval_ms = 0,
  406. .poll_total_ms = 0,
  407. };
  408. static void _tpkey_acts_enable(const struct device *dev)
  409. {
  410. struct acts_tpkey_data *tpkey = dev->data;
  411. //const struct acts_tpkey_config *cfg = dev->config;
  412. gpio_pin_interrupt_configure(tpkey->gpio_dev , isr_gpio_cfg.gpion, GPIO_INT_EDGE_FALLING);//GPIO_INT_DISABLE
  413. LOG_DBG("enable tpkey");
  414. }
  415. static void _tpkey_acts_disable(const struct device *dev)
  416. {
  417. struct acts_tpkey_data *tpkey = dev->data;
  418. //const struct acts_tpkey_config *cfg = dev->config;
  419. gpio_pin_interrupt_configure(tpkey->gpio_dev , isr_gpio_cfg.gpion, GPIO_INT_DISABLE);//GPIO_INT_DISABLE
  420. LOG_DBG("disable tpkey");
  421. }
  422. static void _tpkey_acts_inquiry(const struct device *dev, struct input_value *val)
  423. {
  424. //struct acts_tpkey_data *tpkey = dev->data;
  425. tpkey_get_last_point(val, k_cycle_get_32());
  426. }
  427. static void _tpkey_acts_register_notify(const struct device *dev, input_notify_t notify)
  428. {
  429. struct acts_tpkey_data *tpkey = dev->data;
  430. LOG_DBG("register notify 0x%x", (uint32_t)notify);
  431. tpkey->notify = notify;
  432. }
  433. static void _tpkey_acts_unregister_notify(const struct device *dev, input_notify_t notify)
  434. {
  435. struct acts_tpkey_data *tpkey = dev->data;
  436. LOG_DBG("unregister notify 0x%x", (uint32_t)notify);
  437. tpkey->notify = NULL;
  438. }
  439. static void _tpkey_init_work(struct k_work *work)
  440. {
  441. struct acts_tpkey_data *tpkey = &tpkey_acts_ddata;
  442. if (!tpkey->inited) {
  443. _cst816t_poweron(tpkey->this_dev, true);
  444. _cst816t_reset(tpkey->this_dev);
  445. _cst816t_hynitron_update(tpkey->this_dev, false);
  446. _cst816t_reset(tpkey->this_dev);
  447. _cst816t_irq_config(tpkey->this_dev, true);
  448. tpkey->inited = true;
  449. } else {
  450. _cst816t_poweron(tpkey->this_dev, true);
  451. _cst816t_reset(tpkey->this_dev);
  452. _cst816t_irq_config(tpkey->this_dev, true);
  453. LOG_INF("ok\n");
  454. }
  455. }
  456. static int _tpkey_acts_init(const struct device *dev)
  457. {
  458. struct acts_tpkey_data *tpkey = dev->data;
  459. tpkey->this_dev = (struct device *)dev;
  460. tpkey->i2c_dev = (struct device *)device_get_binding(CONFIG_TPKEY_I2C_NAME);
  461. if (!tpkey->i2c_dev) {
  462. printk("can not access right i2c device\n");
  463. return -1;
  464. }
  465. tpkey->gpio_dev = device_get_binding(isr_gpio_cfg.gpio_dev_name);
  466. tpkey->inited = false;
  467. k_work_init(&tpkey->init_timer, _tpkey_init_work);
  468. k_work_submit(&tpkey->init_timer);
  469. return 0;
  470. }
  471. static bool low_power_mode = false;
  472. void tpkey_acts_dump(void)
  473. {
  474. struct acts_tpkey_data *tpkey = &tpkey_acts_ddata;
  475. _cst816t_reset(tpkey->this_dev);
  476. k_busy_wait(30*1000);
  477. if (low_power_mode) {
  478. _cst816t_enter_low_power_mode(tpkey->this_dev,false);
  479. low_power_mode = false;
  480. } else {
  481. low_power_mode = true;
  482. _cst816t_enter_low_power_mode(tpkey->this_dev,true);
  483. }
  484. }
  485. static const struct input_dev_driver_api _tpkey_acts_driver_api = {
  486. .enable = _tpkey_acts_enable,
  487. .disable = _tpkey_acts_disable,
  488. .inquiry = _tpkey_acts_inquiry,
  489. .register_notify = _tpkey_acts_register_notify,
  490. .unregister_notify = _tpkey_acts_unregister_notify,
  491. };
  492. #ifdef CONFIG_PM_DEVICE
  493. static void _cst816t_suspend(const struct device *dev)
  494. {
  495. struct acts_tpkey_data *tpkey = (struct acts_tpkey_data *)dev->data;
  496. _cst816t_irq_config(tpkey->this_dev, false);
  497. _cst816t_poweron(tpkey->this_dev, false);
  498. LOG_INF("ok\n");
  499. }
  500. static void _cst816t_resume(const struct device *dev)
  501. {
  502. struct acts_tpkey_data *tpkey = (struct acts_tpkey_data *)dev->data;
  503. k_work_submit(&tpkey->init_timer);
  504. }
  505. static int _cst816t_pm_control(const struct device *dev, enum pm_device_action action)
  506. {
  507. int ret = 0;
  508. //struct acts_tpkey_data *data = (struct acts_tpkey_data *)dev->data;
  509. switch (action) {
  510. case PM_DEVICE_ACTION_SUSPEND:
  511. _cst816t_suspend(dev);
  512. break;
  513. case PM_DEVICE_ACTION_RESUME:
  514. _cst816t_resume(dev);
  515. break;
  516. default:
  517. break;
  518. }
  519. return ret;
  520. }
  521. #else /* CONFIG_PM_DEVICE */
  522. static int _cst816t_pm_control(const struct device *dev, uint32_t ctrl_command,
  523. void *context, device_pm_cb cb, void *arg)
  524. {
  525. }
  526. #endif
  527. #if IS_ENABLED(CONFIG_TPKEY)
  528. DEVICE_DEFINE(tpkey, CONFIG_TPKEY_DEV_NAME, _tpkey_acts_init,
  529. _cst816t_pm_control, &tpkey_acts_ddata, &_tpkey_acts_cdata, POST_KERNEL,
  530. 60, &_tpkey_acts_driver_api);
  531. #endif