Advertisement
arter97

Untitled

Apr 11th, 2019
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 50.40 KB | None | 0 0
  1. arter97@arter97-dgist:~/beryllium$ git diff --diff-filter=M cm/lineage-16.0..@ drivers/input/touchscreen/focaltech_touch drivers/input/touchscreen/nt36xxx | cat
  2. diff --git a/drivers/input/touchscreen/focaltech_touch/Kconfig b/drivers/input/touchscreen/focaltech_touch/Kconfig
  3. index 00deec747a3eb..e1ec3b91202e3 100644
  4. --- a/drivers/input/touchscreen/focaltech_touch/Kconfig
  5. +++ b/drivers/input/touchscreen/focaltech_touch/Kconfig
  6. @@ -1,18 +1,16 @@
  7.  #
  8.  # Focaltech Touchscreen driver configuration
  9.  #
  10. -menuconfig TOUCHSCREEN_FTS
  11. -   bool "Focaltech Touchscreen"
  12. -   depends on I2C
  13. -   default n
  14. -   help
  15. -     Say Y here if you have Focaltech touch panel.
  16. -     If unsure, say N.
  17. +
  18. +config TOUCHSCREEN_FTS
  19. +        bool "Focaltech Touchscreen"
  20. +       depends on I2C
  21. +       default n
  22. +       help
  23. +         Say Y here if you have Focaltech touch panel.
  24. +         If unsure, say N.
  25.  
  26.  config TOUCHSCREEN_FTS_DIRECTORY
  27. -   string "Focaltech ts directory name"
  28. -   default "focaltech_touch"
  29. -   depends on TOUCHSCREEN_FTS
  30. -   help
  31. -     Specify the path for the driver directory.
  32. -     Path should be relative to driver/input/touchscreen/.
  33. +    string "Focaltech ts directory name"
  34. +    default "focaltech_touch"
  35. +    depends on TOUCHSCREEN_FTS
  36. diff --git a/drivers/input/touchscreen/focaltech_touch/Makefile b/drivers/input/touchscreen/focaltech_touch/Makefile
  37. index b15e34efbaab2..66acd75cfa300 100644
  38. --- a/drivers/input/touchscreen/focaltech_touch/Makefile
  39. +++ b/drivers/input/touchscreen/focaltech_touch/Makefile
  40. @@ -10,7 +10,8 @@ obj-$(CONFIG_TOUCHSCREEN_FTS) +=  focaltech_ex_mode.o
  41.  obj-$(CONFIG_TOUCHSCREEN_FTS)  +=  focaltech_flash.o
  42.  obj-$(CONFIG_TOUCHSCREEN_FTS)  +=  focaltech_gesture.o
  43.  obj-$(CONFIG_TOUCHSCREEN_FTS)  +=  focaltech_esdcheck.o
  44. -obj-$(CONFIG_TOUCHSCREEN_FTS)  +=  focaltech_i2c.o
  45. -obj-$(CONFIG_TOUCHSCREEN_FTS)  +=  focaltech_point_report_check.o
  46. -obj-$(CONFIG_TOUCHSCREEN_FTS)  +=  focaltech_flash/
  47. +obj-$(CONFIG_TOUCHSCREEN_FTS)   +=  focaltech_i2c.o
  48. +obj-$(CONFIG_TOUCHSCREEN_FTS)   +=  focaltech_point_report_check.o
  49. +obj-$(CONFIG_TOUCHSCREEN_FTS)   +=  focaltech_flash/
  50. +obj-$(CONFIG_TOUCHSCREEN_FTS)   +=  focaltech_test/
  51.  
  52. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_common.h b/drivers/input/touchscreen/focaltech_touch/focaltech_common.h
  53. index 25b00928dc907..77d0d877164d6 100644
  54. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_common.h
  55. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_common.h
  56. @@ -3,7 +3,6 @@
  57.   * FocalTech fts TouchScreen driver.
  58.   *
  59.   * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
  60. - * Copyright (C) 2018 XiaoMi, Inc.
  61.   *
  62.   * This software is licensed under the terms of the GNU General Public
  63.   * License version 2, as published by the Free Software Foundation, and
  64. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_config.h b/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
  65. index d397030f56831..9c21545fafcbb 100644
  66. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
  67. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
  68. @@ -3,7 +3,6 @@
  69.   * FocalTech TouchScreen driver.
  70.   *
  71.   * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
  72. - * Copyright (C) 2018 XiaoMi, Inc.
  73.   *
  74.   * This software is licensed under the terms of the GNU General Public
  75.   * License version 2, as published by the Free Software Foundation, and
  76. @@ -128,6 +127,12 @@
  77.   */
  78.  #define FTS_ESDCHECK_EN                         0
  79.  
  80. +/*
  81. + * Production test enable
  82. + * 1: enable, 0:disable(default)
  83. + */
  84. +#define FTS_TEST_EN                             1
  85. +
  86.  /*
  87.   * Glove mode enable
  88.   * 1: enable, 0:disable(default)
  89. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
  90. index f610f4622a30b..91a2884beb7b6 100644
  91. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
  92. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
  93. @@ -3,7 +3,6 @@
  94.   * FocalTech TouchScreen driver.
  95.   *
  96.   * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
  97. - * Copyright (C) 2018 XiaoMi, Inc.
  98.   *
  99.   * This software is licensed under the terms of the GNU General Public
  100.   * License version 2, as published by the Free Software Foundation, and
  101. @@ -41,7 +40,6 @@
  102.  #include <linux/earlysuspend.h>
  103.  #define FTS_SUSPEND_LEVEL 1    /* Early-suspend level */
  104.  #endif
  105. -#include <linux/hwinfo.h>
  106.  
  107.  /*****************************************************************************
  108.  * Private constant and macro definitions using #define
  109. @@ -561,7 +559,7 @@ static int fts_pinctrl_select_release(struct fts_ts_data *ts)
  110.  #if (FTS_DEBUG_EN && (FTS_DEBUG_LEVEL == 2))
  111.  char g_sz_debug[1024] = { 0 };
  112.  
  113. -static void fts_show_touch_buffer(u8 *buf, int point_num)
  114. +static void fts_show_touch_buffer(u8 * buf, int point_num)
  115.  {
  116.     int len = point_num * FTS_ONE_TCH_LEN;
  117.     int count = 0;
  118. @@ -1369,7 +1367,7 @@ static const struct attribute_group fts_attr_group = {
  119.  };
  120.  
  121.  #define TP_INFO_MAX_LENGTH 50
  122. -static ssize_t fts_lockdown_info_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
  123. +static ssize_t fts_lockdown_info_read(struct file *file, char __user * buf, size_t count, loff_t * pos)
  124.  {
  125.     int cnt = 0, ret = 0;
  126.     char tmp[TP_INFO_MAX_LENGTH];
  127. @@ -1396,7 +1394,7 @@ static const struct file_operations fts_lockdown_info_ops = {
  128.     .read = fts_lockdown_info_read,
  129.  };
  130.  
  131. -static ssize_t fts_fw_version_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
  132. +static ssize_t fts_fw_version_read(struct file *file, char __user * buf, size_t count, loff_t * pos)
  133.  {
  134.     int cnt = 0, ret = 0;
  135.     char tmp[TP_INFO_MAX_LENGTH];
  136. @@ -1432,7 +1430,7 @@ static int tpdbg_open(struct inode *inode, struct file *file)
  137.     return 0;
  138.  }
  139.  
  140. -static ssize_t tpdbg_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
  141. +static ssize_t tpdbg_read(struct file *file, char __user * buf, size_t size, loff_t * ppos)
  142.  {
  143.  
  144.     const char *str = "cmd support as below:\n \
  145. @@ -1456,7 +1454,7 @@ static ssize_t tpdbg_read(struct file *file, char __user *buf, size_t size, loff
  146.     return len;
  147.  }
  148.  
  149. -static ssize_t tpdbg_write(struct file *file, const char __user *buf, size_t size, loff_t *ppos)
  150. +static ssize_t tpdbg_write(struct file *file, const char __user * buf, size_t size, loff_t * ppos)
  151.  {
  152.     struct fts_ts_data *ts_data = file->private_data;
  153.     char *cmd = kzalloc(size + 1, GFP_KERNEL);
  154. @@ -1760,6 +1758,14 @@ static int fts_ts_probe(struct i2c_client *client, const struct i2c_device_id *i
  155.     }
  156.  #endif
  157.  
  158. +#if FTS_TEST_EN
  159. +   ret = fts_test_init(client);
  160. +   if (ret) {
  161. +       FTS_ERROR("init production test fail");
  162. +       goto err_debugfs_create;
  163. +   }
  164. +#endif
  165. +
  166.  #if FTS_ESDCHECK_EN
  167.     ret = fts_esdcheck_init(ts_data);
  168.     if (ret) {
  169. @@ -1806,8 +1812,6 @@ static int fts_ts_probe(struct i2c_client *client, const struct i2c_device_id *i
  170.     ts_data->early_suspend.resume = fts_ts_late_resume;
  171.     register_early_suspend(&ts_data->early_suspend);
  172.  #endif
  173. -   update_hardware_info(TYPE_TOUCH, 3);
  174. -   update_hardware_info(TYPE_TP_MAKER, ts_data->lockdown_info[0] - 0x30);
  175.  
  176.     FTS_FUNC_EXIT();
  177.     return 0;
  178. @@ -1881,6 +1885,10 @@ static int fts_ts_remove(struct i2c_client *client)
  179.     fts_fwupg_exit(ts_data);
  180.  #endif
  181.  
  182. +#if FTS_TEST_EN
  183. +   fts_test_exit(client);
  184. +#endif
  185. +
  186.  #if FTS_ESDCHECK_EN
  187.     fts_esdcheck_exit(ts_data);
  188.  #endif
  189. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
  190. index 0ee6f1c48ebc7..4648dc1f0fe4c 100644
  191. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
  192. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
  193. @@ -3,7 +3,6 @@
  194.   * FocalTech TouchScreen driver.
  195.   *
  196.   * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
  197. - * Copyright (C) 2018 XiaoMi, Inc.
  198.   *
  199.   * This software is licensed under the terms of the GNU General Public
  200.   * License version 2, as published by the Free Software Foundation, and
  201. @@ -204,7 +203,7 @@ extern struct fts_ts_data *fts_data;
  202.  
  203.  /* i2c communication*/
  204.  int fts_i2c_write_reg(struct i2c_client *client, u8 regaddr, u8 regvalue);
  205. -int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 *regvalue);
  206. +int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 * regvalue);
  207.  int fts_i2c_read(struct i2c_client *client, char *writebuf, int writelen, char *readbuf, int readlen);
  208.  int fts_i2c_write(struct i2c_client *client, char *writebuf, int writelen);
  209.  void fts_i2c_hid2std(struct i2c_client *client);
  210. @@ -244,6 +243,12 @@ int fts_esdcheck_suspend(void);
  211.  int fts_esdcheck_resume(void);
  212.  #endif
  213.  
  214. +/* Production test */
  215. +#if FTS_TEST_EN
  216. +int fts_test_init(struct i2c_client *client);
  217. +int fts_test_exit(struct i2c_client *client);
  218. +#endif
  219. +
  220.  /* Point Report Check*/
  221.  #if FTS_POINT_REPORT_CHECK_EN
  222.  int fts_point_report_check_init(struct fts_ts_data *ts_data);
  223. @@ -267,8 +272,8 @@ int fts_ex_mode_recovery(struct i2c_client *client);
  224.  void fts_irq_disable(void);
  225.  void fts_irq_enable(void);
  226.  
  227. -int fts_flash_read(struct i2c_client *client, u32 addr, u8 *buf, u32 len);
  228. -int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len);
  229. +int fts_flash_read(struct i2c_client *client, u32 addr, u8 * buf, u32 len);
  230. +int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len);
  231.  void fts_gesture_enable(bool enable);
  232.  
  233.  #endif /* __LINUX_FOCALTECH_CORE_H__ */
  234. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c b/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c
  235. index cee3a91e19fc6..31e6b33b531d9 100644
  236. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c
  237. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c
  238. @@ -3,7 +3,6 @@
  239.   * FocalTech TouchScreen driver.
  240.   *
  241.   * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
  242. - * Copyright (C) 2018 XiaoMi, Inc.
  243.   *
  244.   * This software is licensed under the terms of the GNU General Public
  245.   * License version 2, as published by the Free Software Foundation, and
  246. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c
  247. index 0991b41bfe14f..75f8170c04912 100644
  248. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c
  249. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c
  250. @@ -3,7 +3,6 @@
  251.   * FocalTech TouchScreen driver.
  252.   *
  253.   * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
  254. - * Copyright (C) 2018 XiaoMi, Inc.
  255.   *
  256.   * This software is licensed under the terms of the GNU General Public
  257.   * License version 2, as published by the Free Software Foundation, and
  258. @@ -87,7 +86,7 @@ static struct rwreg_operation_t {
  259.  * Output: no
  260.  * Return: data len
  261.  ***********************************************************************/
  262. -static ssize_t fts_debug_write(struct file *filp, const char __user *buff, size_t count, loff_t *ppos)
  263. +static ssize_t fts_debug_write(struct file *filp, const char __user * buff, size_t count, loff_t * ppos)
  264.  {
  265.     u8 writebuf[PROC_WRITE_BUF_SIZE] = { 0 };
  266.     int buflen = count;
  267. @@ -181,7 +180,7 @@ static ssize_t fts_debug_write(struct file *filp, const char __user *buff, size_
  268.  * Output: page point to data
  269.  * Return: read char number
  270.  ***********************************************************************/
  271. -static ssize_t fts_debug_read(struct file *filp, char __user *buff, size_t count, loff_t *ppos)
  272. +static ssize_t fts_debug_read(struct file *filp, char __user * buff, size_t count, loff_t * ppos)
  273.  {
  274.     int ret = 0;
  275.     int num_read_chars = 0;
  276. @@ -256,7 +255,7 @@ static const struct file_operations fts_proc_fops = {
  277.  * Output: no
  278.  * Return: data len
  279.  ***********************************************************************/
  280. -static int fts_debug_write(struct file *filp, const char __user *buff, unsigned long len, void *data)
  281. +static int fts_debug_write(struct file *filp, const char __user * buff, unsigned long len, void *data)
  282.  {
  283.     int ret = 0;
  284.     u8 writebuf[PROC_WRITE_BUF_SIZE] = { 0 };
  285. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c
  286. index b987679e9a8af..4c89cca22a22a 100644
  287. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c
  288. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c
  289. @@ -3,7 +3,6 @@
  290.   * FocalTech ftxxxx TouchScreen driver.
  291.   *
  292.   * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
  293. - * Copyright (C) 2018 XiaoMi, Inc.
  294.   *
  295.   * This software is licensed under the terms of the GNU General Public
  296.   * License version 2, as published by the Free Software Foundation, and
  297. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c
  298. index fa254c5425102..e6eb2c0dcdcf9 100644
  299. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c
  300. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c
  301. @@ -3,7 +3,6 @@
  302.   * FocalTech fts TouchScreen driver.
  303.   *
  304.   * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
  305. - * Copyright (C) 2018 XiaoMi, Inc.
  306.   *
  307.   * This software is licensed under the terms of the GNU General Public
  308.   * License version 2, as published by the Free Software Foundation, and
  309. @@ -74,7 +73,7 @@ struct fts_upgrade *fwupgrade;
  310.  /*****************************************************************************
  311.  * Static function prototypes
  312.  *****************************************************************************/
  313. -static u16 fts_pram_ecc_calc_host(u8 *pbuf, u16 length)
  314. +static u16 fts_pram_ecc_calc_host(u8 * pbuf, u16 length)
  315.  {
  316.     u16 ecc = 0;
  317.     u16 i = 0;
  318. @@ -182,7 +181,7 @@ static int fts_pram_ecc_cal(struct i2c_client *client, u32 saddr, u32 len)
  319.   *
  320.   * return pramboot ecc of host if success, otherwise return error code
  321.   ***********************************************************************/
  322. -static int fts_pram_write_buf(struct i2c_client *client, u8 *buf, u32 len)
  323. +static int fts_pram_write_buf(struct i2c_client *client, u8 * buf, u32 len)
  324.  {
  325.     int ret = 0;
  326.     u32 i = 0;
  327. @@ -447,7 +446,7 @@ int fts_pram_write_init(struct i2c_client *client)
  328.  * Output:
  329.  * Return: return true if fw is valid, otherwise return false
  330.  ***********************************************************************/
  331. -bool fts_fwupg_check_fw_valid(struct i2c_client *client)
  332. +bool fts_fwupg_check_fw_valid(struct i2c_client * client)
  333.  {
  334.     int ret = 0;
  335.  
  336. @@ -535,7 +534,7 @@ int fts_fwupg_get_boot_state(struct i2c_client *client, enum FW_STATUS *fw_sts)
  337.  * Output:
  338.  * Return: return true if state is match, otherwise return false
  339.  ***********************************************************************/
  340. -bool fts_fwupg_check_state(struct i2c_client *client, enum FW_STATUS rstate)
  341. +bool fts_fwupg_check_state(struct i2c_client * client, enum FW_STATUS rstate)
  342.  {
  343.     int ret = 0;
  344.     int i = 0;
  345. @@ -853,7 +852,7 @@ int fts_fwupg_ecc_cal(struct i2c_client *client, u32 saddr, u32 len)
  346.   * Output:
  347.   * Return: return data ecc of host if success, otherwise return error code
  348.   ***********************************************************************/
  349. -int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len, u32 delay)
  350. +int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len, u32 delay)
  351.  {
  352.     int ret = 0;
  353.     u32 i = 0;
  354. @@ -940,7 +939,7 @@ int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len,
  355.   *
  356.   * Warning: can't call this function directly, need call in boot environment
  357.   ***********************************************************************/
  358. -int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len)
  359. +int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len)
  360.  {
  361.     int ret = 0;
  362.     u32 i = 0;
  363. @@ -1001,7 +1000,7 @@ int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len)
  364.   * Output: buf   - data read from flash
  365.   * Return: return 0 if success, otherwise return error code
  366.   ***********************************************************************/
  367. -int fts_flash_read(struct i2c_client *client, u32 addr, u8 *buf, u32 len)
  368. +int fts_flash_read(struct i2c_client *client, u32 addr, u8 * buf, u32 len)
  369.  {
  370.     int ret = 0;
  371.  
  372. @@ -1040,7 +1039,7 @@ int fts_flash_read(struct i2c_client *client, u32 addr, u8 *buf, u32 len)
  373.   * Output:
  374.   * Return: return file len if succuss, otherwise return error code
  375.   ***********************************************************************/
  376. -int fts_read_file(char *file_name, u8  **file_buf)
  377. +int fts_read_file(char *file_name, u8 ** file_buf)
  378.  {
  379.     int ret = 0;
  380.     char file_path[FILE_NAME_LENGTH] = { 0 };
  381. @@ -1155,7 +1154,7 @@ int fts_upgrade_bin(struct i2c_client *client, char *fw_name, bool force)
  382.  }
  383.  
  384.  #if FTS_AUTO_LIC_UPGRADE_EN
  385. -static int fts_lic_get_vid_in_tp(struct i2c_client *client, u16 *vid)
  386. +static int fts_lic_get_vid_in_tp(struct i2c_client *client, u16 * vid)
  387.  {
  388.     int ret = 0;
  389.     u8 val[2] = { 0 };
  390. @@ -1177,7 +1176,7 @@ static int fts_lic_get_vid_in_tp(struct i2c_client *client, u16 *vid)
  391.     return 0;
  392.  }
  393.  
  394. -static int fts_lic_get_vid_in_host(u16 *vid)
  395. +static int fts_lic_get_vid_in_host(u16 * vid)
  396.  {
  397.     u8 val[2] = { 0 };
  398.     u8 *licbuf = NULL;
  399. @@ -1204,7 +1203,7 @@ static int fts_lic_get_vid_in_host(u16 *vid)
  400.     return 0;
  401.  }
  402.  
  403. -static int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 *ver)
  404. +static int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 * ver)
  405.  {
  406.     int ret = 0;
  407.  
  408. @@ -1222,7 +1221,7 @@ static int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 *ver)
  409.     return 0;
  410.  }
  411.  
  412. -static int fts_lic_get_ver_in_host(u8 *ver)
  413. +static int fts_lic_get_ver_in_host(u8 * ver)
  414.  {
  415.     int ret = 0;
  416.     struct fts_upgrade *upg = fwupgrade;
  417. @@ -1341,7 +1340,7 @@ int fts_lic_upgrade(struct i2c_client *client, struct fts_upgrade *upg)
  418.  }
  419.  #endif /* FTS_AUTO_LIC_UPGRADE_EN */
  420.  
  421. -static int fts_param_get_ver_in_tp(struct i2c_client *client, u8 *ver)
  422. +static int fts_param_get_ver_in_tp(struct i2c_client *client, u8 * ver)
  423.  {
  424.     int ret = 0;
  425.  
  426. @@ -1364,7 +1363,7 @@ static int fts_param_get_ver_in_tp(struct i2c_client *client, u8 *ver)
  427.     return 0;
  428.  }
  429.  
  430. -static int fts_param_get_ver_in_host(u8 *ver)
  431. +static int fts_param_get_ver_in_host(u8 * ver)
  432.  {
  433.     struct fts_upgrade *upg = fwupgrade;
  434.  
  435. @@ -1447,7 +1446,7 @@ static bool fts_param_need_upgrade(struct i2c_client *client)
  436.   *
  437.   * return 0 if success, otherwise return error code
  438.   ***********************************************************************/
  439. -static int fts_fwupg_get_ver_in_tp(struct i2c_client *client, u8 *ver)
  440. +static int fts_fwupg_get_ver_in_tp(struct i2c_client *client, u8 * ver)
  441.  {
  442.     int ret = 0;
  443.  
  444. @@ -1470,7 +1469,7 @@ static int fts_fwupg_get_ver_in_tp(struct i2c_client *client, u8 *ver)
  445.   *
  446.   * return 0 if success, otherwise return error code
  447.   ***********************************************************************/
  448. -static int fts_fwupg_get_ver_in_host(u8 *ver)
  449. +static int fts_fwupg_get_ver_in_host(u8 * ver)
  450.  {
  451.     struct fts_upgrade *upg = fwupgrade;
  452.  
  453. @@ -1642,7 +1641,7 @@ void fts_fwupg_auto_upgrade(struct fts_ts_data *ts_data)
  454.   *
  455.   * return 0 if success, otherwise return error code
  456.   */
  457. -int fts_fwupg_get_vendorid(struct fts_ts_data *ts_data, u16 *vid)
  458. +int fts_fwupg_get_vendorid(struct fts_ts_data *ts_data, u16 * vid)
  459.  {
  460.     int ret = 0;
  461.     bool fwvalid = false;
  462. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h
  463. index d4d983c02cbef..5dd460ee735ca 100644
  464. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h
  465. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h
  466. @@ -1,6 +1,5 @@
  467.  /************************************************************************
  468.  * Copyright (C) 2010-2017, Focaltech Systems (R)��All Rights Reserved.
  469. - * Copyright (C) 2018 XiaoMi, Inc.
  470.  *
  471.  * File Name: focaltech_flash.h
  472.  *
  473. @@ -163,6 +162,6 @@ int fts_fwupg_reset_to_romboot(struct i2c_client *client);
  474.  int fts_fwupg_enter_into_boot(struct i2c_client *client);
  475.  int fts_fwupg_erase(struct i2c_client *client, u32 delay);
  476.  int fts_fwupg_ecc_cal(struct i2c_client *client, u32 saddr, u32 len);
  477. -int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len, u32 delay);
  478. +int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len, u32 delay);
  479.  int fts_fwupg_upgrade(struct i2c_client *client, struct fts_upgrade *upg);
  480.  #endif
  481. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile b/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile
  482. index 9a27096ad991a..21e5dba22ab21 100644
  483. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile
  484. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile
  485. @@ -5,14 +5,4 @@
  486.  # Each configuration option enables a list of files.
  487.  
  488.  
  489. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft5x46.o
  490. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft5822.o
  491. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft6336gu.o
  492. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8006.o
  493. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8606.o
  494. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8607.o
  495. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8716.o
  496. -obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8719.o
  497. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8736.o
  498. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_idc.o
  499. -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_test.o
  500. +obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8719.o
  501. \ No newline at end of file
  502. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash/focaltech_upgrade_ft8719.c b/drivers/input/touchscreen/focaltech_touch/focaltech_flash/focaltech_upgrade_ft8719.c
  503. index 27182d415c69b..72ba847620f42 100644
  504. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash/focaltech_upgrade_ft8719.c
  505. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash/focaltech_upgrade_ft8719.c
  506. @@ -51,7 +51,7 @@ u8 pb_file_ft8719[] = {
  507.   * fts_ft8719_upgrade_mode -
  508.   * Return: return 0 if success, otherwise return error code
  509.   ***********************************************************************/
  510. -static int fts_ft8719_upgrade_mode(struct i2c_client *client, enum FW_FLASH_MODE mode, u8 *buf, u32 len)
  511. +static int fts_ft8719_upgrade_mode(struct i2c_client *client, enum FW_FLASH_MODE mode, u8 * buf, u32 len)
  512.  {
  513.     int ret = 0;
  514.     u32 start_addr = 0;
  515. @@ -129,7 +129,7 @@ static int fts_ft8719_upgrade_mode(struct i2c_client *client, enum FW_FLASH_MODE
  516.  * Output:
  517.  * Return: return 0 if success, otherwise return error code
  518.  ***********************************************************************/
  519. -static int fts_ft8719_upgrade(struct i2c_client *client, u8 *buf, u32 len)
  520. +static int fts_ft8719_upgrade(struct i2c_client *client, u8 * buf, u32 len)
  521.  {
  522.     int ret = 0;
  523.     u8 *tmpbuf = NULL;
  524. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c b/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
  525. index 60d28b9bfabc8..e464e278c47df 100644
  526. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
  527. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
  528. @@ -3,7 +3,6 @@
  529.   * FocalTech TouchScreen driver.
  530.   *
  531.   * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
  532. - * Copyright (C) 2018 XiaoMi, Inc.
  533.   *
  534.   * This software is licensed under the terms of the GNU General Public
  535.   * License version 2, as published by the Free Software Foundation, and
  536. @@ -334,7 +333,7 @@ static void fts_gesture_report(struct input_dev *input_dev, int gesture_id)
  537.  * Output:
  538.  * Return: fail <0
  539.  ***********************************************************************/
  540. -static int fts_gesture_read_buffer(struct i2c_client *client, u8 *buf, int read_bytes)
  541. +static int fts_gesture_read_buffer(struct i2c_client *client, u8 * buf, int read_bytes)
  542.  {
  543.     int remain_bytes;
  544.     int ret;
  545. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c b/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c
  546. index 7614965fd05a0..1ae4afbeb488c 100644
  547. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c
  548. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c
  549. @@ -3,7 +3,6 @@
  550.   * FocalTech TouchScreen driver.
  551.   *
  552.   * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
  553. - * Copyright (C) 2018 XiaoMi, Inc.
  554.   *
  555.   * This software is licensed under the terms of the GNU General Public
  556.   * License version 2, as published by the Free Software Foundation, and
  557. @@ -181,7 +180,7 @@ int fts_i2c_write_reg(struct i2c_client *client, u8 regaddr, u8 regvalue)
  558.  * Output: get reg value
  559.  * Return: fail <0
  560.  ***********************************************************************/
  561. -int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 *regvalue)
  562. +int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 * regvalue)
  563.  {
  564.     return fts_i2c_read(client, &regaddr, 1, regvalue, 1);
  565.  }
  566. diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c b/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c
  567. index c757fc7b89f45..121f4ae9dcf35 100644
  568. --- a/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c
  569. +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c
  570. @@ -3,7 +3,6 @@
  571.   * FocalTech TouchScreen driver.
  572.   *
  573.   * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
  574. - * Copyright (C) 2018 XiaoMi, Inc.
  575.   *
  576.   * This software is licensed under the terms of the GNU General Public
  577.   * License version 2, as published by the Free Software Foundation, and
  578. diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx.c b/drivers/input/touchscreen/nt36xxx/nt36xxx.c
  579. index 9f3538957f043..985fab4211990 100644
  580. --- a/drivers/input/touchscreen/nt36xxx/nt36xxx.c
  581. +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx.c
  582. @@ -29,7 +29,6 @@
  583.  #include <linux/of_irq.h>
  584.  #include <linux/slab.h>
  585.  #include <linux/regulator/consumer.h>
  586. -#include <linux/hwinfo.h>
  587.  
  588.  #ifdef CONFIG_DRM
  589.  #include <drm/drm_notifier.h>
  590. @@ -46,7 +45,7 @@
  591.  #if NVT_TOUCH_ESD_PROTECT
  592.  static struct delayed_work nvt_esd_check_work;
  593.  static struct workqueue_struct *nvt_esd_check_wq;
  594. -static unsigned long irq_timer;
  595. +static unsigned long irq_timer = 0;
  596.  uint8_t esd_check = false;
  597.  uint8_t esd_retry = 0;
  598.  uint8_t esd_retry_max = 5;
  599. @@ -94,6 +93,8 @@ static void nvt_ts_late_resume(struct early_suspend *h);
  600.  #define INPUT_EVENT_PALM_ON        13
  601.  #define INPUT_EVENT_END                13
  602.  
  603. +#define PROC_SYMLINK_PATH "touchpanel"
  604. +
  605.  #if TOUCH_KEY_NUM > 0
  606.  const uint16_t touch_key_array[TOUCH_KEY_NUM] = {
  607.     KEY_BACK,
  608. @@ -120,7 +121,7 @@ const uint16_t gesture_key_array[] = {
  609.  };
  610.  #endif
  611.  
  612. -static uint8_t bTouchIsAwake;
  613. +static uint8_t bTouchIsAwake = 0;
  614.  
  615.  /*******************************************************
  616.  Description:
  617. @@ -206,11 +207,11 @@ int32_t CTP_I2C_WRITE(struct i2c_client *client, uint16_t address, uint8_t *buf,
  618.  *******************************************************/
  619.  void nvt_sw_reset_idle(void)
  620.  {
  621. -   uint8_t buf[4] = {0};
  622. +   uint8_t buf[4]={0};
  623.  
  624.     /*---write i2c cmds to reset idle---*/
  625. -   buf[0] = 0x00;
  626. -   buf[1] = 0xA5;
  627. +   buf[0]=0x00;
  628. +   buf[1]=0xA5;
  629.     CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
  630.  
  631.     msleep(15);
  632. @@ -277,7 +278,7 @@ int32_t nvt_clear_fw_status(void)
  633.  
  634.     if (i >= retry) {
  635.         NVT_ERR("failed, i=%d, buf[1]=0x%02X\n", i, buf[1]);
  636. -       return -EPERM;
  637. +       return -1;
  638.     } else {
  639.         return 0;
  640.     }
  641. @@ -349,7 +350,7 @@ int32_t nvt_check_fw_reset_state(RST_COMPLETE_STATE check_reset_state)
  642.         }
  643.  
  644.         retry++;
  645. -       if (unlikely(retry > 100)) {
  646. +       if(unlikely(retry > 100)) {
  647.             NVT_ERR("error, retry=%d, buf[1]=0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X\n", retry, buf[1], buf[2], buf[3], buf[4], buf[5]);
  648.             ret = -1;
  649.             break;
  650. @@ -432,7 +433,7 @@ int32_t nvt_get_fw_info(void)
  651.         ts->abs_y_max = TOUCH_DEFAULT_MAX_HEIGHT;
  652.         ts->max_button_num = TOUCH_KEY_NUM;
  653.  
  654. -       if (retry_count < 3) {
  655. +       if(retry_count < 3) {
  656.             retry_count++;
  657.             NVT_ERR("retry_count=%d\n", retry_count);
  658.             goto info_retry;
  659. @@ -593,7 +594,7 @@ static const struct file_operations nvt_flash_fops = {
  660.  *******************************************************/
  661.  static int32_t nvt_flash_proc_init(void)
  662.  {
  663. -   NVT_proc_entry = proc_create(DEVICE_NAME, 0444, NULL, &nvt_flash_fops);
  664. +   NVT_proc_entry = proc_create(DEVICE_NAME, 0444, NULL,&nvt_flash_fops);
  665.     if (NVT_proc_entry == NULL) {
  666.         NVT_ERR("Failed!\n");
  667.         return -ENOMEM;
  668. @@ -860,7 +861,6 @@ static const char *nvt_get_config(struct nvt_ts_data *ts)
  669.     NVT_LOG("Choose config %d: %s", i,
  670.          ts->config_array[i].nvt_cfg_name);
  671.     ts->current_index = i;
  672. -
  673.     return ts->config_array[i].nvt_cfg_name;
  674.  }
  675.  
  676. @@ -1026,7 +1026,7 @@ static uint8_t nvt_fw_recovery(uint8_t *point_data)
  677.     uint8_t detected = true;
  678.  
  679.     /* check pattern */
  680. -   for (i = 1 ; i < 7 ; i++) {
  681. +   for (i=1 ; i<7 ; i++) {
  682.         if (point_data[i] != 0x77) {
  683.             detected = false;
  684.             break;
  685. @@ -1066,11 +1066,9 @@ static void nvt_switch_mode_work(struct work_struct *work)
  686.     struct nvt_mode_switch *ms = container_of(work, struct nvt_mode_switch, switch_mode_work);
  687.     struct nvt_ts_data *data = ms->nvt_data;
  688.     unsigned char value = ms->mode;
  689. -   char ch[64] = {0x0,};
  690.  
  691.     if (value >= INPUT_EVENT_WAKUP_MODE_OFF && value <= INPUT_EVENT_WAKUP_MODE_ON) {
  692.         data->gesture_enabled = value - INPUT_EVENT_WAKUP_MODE_OFF;
  693. -       snprintf(ch, sizeof(ch), "%s", data->gesture_enabled ? "enabled" : "disabled");
  694.     } else {
  695.         NVT_ERR("Does not support touch mode %d\n", value);
  696.     }
  697. @@ -1149,6 +1147,13 @@ static void nvt_ts_work_func(struct work_struct *work)
  698.         NVT_ERR("CTP_I2C_READ failed.(%d)\n", ret);
  699.         goto XFER_ERROR;
  700.     }
  701. +/*
  702. +   //--- dump I2C buf ---
  703. +   for (i = 0; i < 10; i++) {
  704. +       printk("%02X %02X %02X %02X %02X %02X  ", point_data[1+i*6], point_data[2+i*6], point_data[3+i*6], point_data[4+i*6], point_data[5+i*6], point_data[6+i*6]);
  705. +   }
  706. +   printk("\n");
  707. +*/
  708.  
  709.  #if NVT_TOUCH_ESD_PROTECT
  710.     if (nvt_fw_recovery(point_data)) {
  711. @@ -1309,13 +1314,13 @@ void nvt_stop_crc_reboot(void)
  712.         for (retry = 5; retry > 0; retry--) {
  713.  
  714.             /*---write i2c cmds to reset idle : 1st---*/
  715. -           buf[0] = 0x00;
  716. -           buf[1] = 0xA5;
  717. +           buf[0]=0x00;
  718. +           buf[1]=0xA5;
  719.             CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
  720.  
  721.             /*---write i2c cmds to reset idle : 2rd---*/
  722. -           buf[0] = 0x00;
  723. -           buf[1] = 0xA5;
  724. +           buf[0]=0x00;
  725. +           buf[1]=0xA5;
  726.             CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
  727.             msleep(1);
  728.  
  729. @@ -1583,17 +1588,68 @@ static ssize_t nvt_panel_display_show(struct device *dev,
  730.     return snprintf(buf, PAGE_SIZE, "%c\n", ts->lockdown_info[1]);
  731.  }
  732.  
  733. +static ssize_t nvt_panel_wake_gesture_show(struct device *dev,
  734. +                    struct device_attribute *attr, char *buf)
  735. +{
  736. +        const char c = ts->gesture_enabled ? '1' : '0';
  737. +        return sprintf(buf, "%c\n", c);
  738. +}
  739. +
  740. +static ssize_t nvt_panel_wake_gesture_store(struct device *dev,
  741. +                    struct device_attribute *attr, const char *buf, size_t count)
  742. +{
  743. +   int i;
  744. +
  745. +   if (sscanf(buf, "%u", &i) == 1 && i < 2) {
  746. +       ts->gesture_enabled = i;
  747. +       return count;
  748. +   } else {
  749. +       dev_dbg(dev, "enable_dt2w write error\n");
  750. +       return -EINVAL;
  751. +   }
  752. +}
  753. +
  754.  static DEVICE_ATTR(panel_vendor, (S_IRUGO), nvt_panel_vendor_show, NULL);
  755.  static DEVICE_ATTR(panel_color, (S_IRUGO), nvt_panel_color_show, NULL);
  756.  static DEVICE_ATTR(panel_display, (S_IRUGO), nvt_panel_display_show, NULL);
  757. +static DEVICE_ATTR(wake_gesture, S_IWUSR | S_IRUSR,
  758. +       nvt_panel_wake_gesture_show, nvt_panel_wake_gesture_store);
  759.  
  760.  static struct attribute *nvt_attr_group[] = {
  761.     &dev_attr_panel_vendor.attr,
  762.     &dev_attr_panel_color.attr,
  763.     &dev_attr_panel_display.attr,
  764. +   &dev_attr_wake_gesture.attr,
  765.     NULL,
  766.  };
  767.  
  768. +static ssize_t novatek_input_symlink(struct nvt_ts_data *ts) {
  769. +   char *driver_path;
  770. +   int ret = 0;
  771. +   if (ts->input_proc) {
  772. +       proc_remove(ts->input_proc);
  773. +       ts->input_proc = NULL;
  774. +   }
  775. +   driver_path = kzalloc(PATH_MAX, GFP_KERNEL);
  776. +   if (!driver_path) {
  777. +       pr_err("%s: failed to allocate memory\n", __func__);
  778. +       return -ENOMEM;
  779. +   }
  780. +
  781. +   sprintf(driver_path, "/sys%s",
  782. +           kobject_get_path(&ts->client->dev.kobj, GFP_KERNEL));
  783. +
  784. +   pr_err("%s: driver_path=%s\n", __func__, driver_path);
  785. +
  786. +   ts->input_proc = proc_symlink(PROC_SYMLINK_PATH, NULL, driver_path);
  787. +
  788. +   if (!ts->input_proc) {
  789. +       ret = -ENOMEM;
  790. +   }
  791. +   kfree(driver_path);
  792. +   return ret;
  793. +}
  794. +
  795.  /*******************************************************
  796.  Description:
  797.     Novatek touchscreen driver probe function.
  798. @@ -1617,6 +1673,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
  799.     }
  800.  
  801.     ts->client = client;
  802. +   ts->input_proc = NULL;
  803.     i2c_set_clientdata(client, ts);
  804.  
  805.     /*---parse dts---*/
  806. @@ -1765,7 +1822,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
  807.             NVT_LOG("request irq %d succeed\n", client->irq);
  808.         }
  809.     }
  810. -   update_hardware_info(TYPE_TOUCH, 5);
  811. +
  812.  
  813.     ret = nvt_get_lockdown_info(ts->lockdown_info);
  814.  
  815. @@ -1775,10 +1832,10 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
  816.         NVT_ERR("Lockdown:0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x\n",
  817.                 ts->lockdown_info[0], ts->lockdown_info[1], ts->lockdown_info[2], ts->lockdown_info[3],
  818.                 ts->lockdown_info[4], ts->lockdown_info[5], ts->lockdown_info[6], ts->lockdown_info[7]);
  819. -       update_hardware_info(TYPE_TP_MAKER, ts->lockdown_info[0] - 0x30);
  820.     }
  821.     ts->fw_name = nvt_get_config(ts);
  822.  
  823. +
  824.     device_init_wakeup(&client->dev, 1);
  825.     ts->dev_pm_suspend = false;
  826.     init_completion(&ts->dev_pm_suspend_completion);
  827. @@ -1830,7 +1887,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
  828.  #if defined(CONFIG_DRM)
  829.     ts->notifier.notifier_call = drm_notifier_callback;
  830.     ret = drm_register_client(&ts->notifier);
  831. -   if (ret) {
  832. +   if(ret) {
  833.         NVT_ERR("register drm_notifier failed. ret=%d\n", ret);
  834.         goto err_register_drm_notif_failed;
  835.     }
  836. @@ -1839,7 +1896,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
  837.     ts->early_suspend.suspend = nvt_ts_early_suspend;
  838.     ts->early_suspend.resume = nvt_ts_late_resume;
  839.     ret = register_early_suspend(&ts->early_suspend);
  840. -   if (ret) {
  841. +   if(ret) {
  842.         NVT_ERR("register early suspend failed. ret=%d\n", ret);
  843.         goto err_register_early_suspend_failed;
  844.     }
  845. @@ -1851,6 +1908,11 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
  846.         NVT_ERR("Cannot create sysfs structure!\n");
  847.     }
  848.  
  849. +   ret = novatek_input_symlink(ts);
  850. +   if (ret < 0) {
  851. +       NVT_ERR("Failed to symlink input device!\n");
  852. +   }
  853. +
  854.     ts->event_wq = alloc_workqueue("nvt-event-queue",
  855.                 WQ_UNBOUND | WQ_HIGHPRI | WQ_CPU_INTENSIVE, 1);
  856.     if (!ts->event_wq) {
  857. @@ -2185,6 +2247,13 @@ static void nvt_ts_late_resume(struct early_suspend *h)
  858.  }
  859.  #endif
  860.  
  861. +#if 0
  862. +static const struct dev_pm_ops nvt_ts_dev_pm_ops = {
  863. +   .suspend = nvt_ts_suspend,
  864. +   .resume  = nvt_ts_resume,
  865. +};
  866. +#endif
  867. +
  868.  static const struct i2c_device_id nvt_ts_id[] = {
  869.     { NVT_I2C_NAME, 0 },
  870.     { }
  871. diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx.h b/drivers/input/touchscreen/nt36xxx/nt36xxx.h
  872. index ddda66983f970..482c1ca1b809c 100644
  873. --- a/drivers/input/touchscreen/nt36xxx/nt36xxx.h
  874. +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx.h
  875. @@ -88,6 +88,7 @@ extern const uint16_t gesture_key_array[];
  876.  #define NVT_TOUCH_ESD_CHECK_PERIOD 1500    /* ms */
  877.  #define NVT_LOCKDOWN_SIZE  8
  878.  
  879. +
  880.  struct nvt_config_info {
  881.     u8 tp_vendor;
  882.     u8 tp_color;
  883. @@ -157,6 +158,8 @@ struct nvt_ts_data {
  884.     struct work_struct resume_work;
  885.     struct workqueue_struct *event_wq;
  886.     struct completion dev_pm_suspend_completion;
  887. +
  888. +   struct proc_dir_entry *input_proc;
  889.  };
  890.  
  891.  struct nvt_mode_switch {
  892. diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c b/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c
  893. index eaa9a173f67e7..52515c7c1ef04 100644
  894. --- a/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c
  895. +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c
  896. @@ -57,17 +57,17 @@ static struct proc_dir_entry *NVT_proc_xiaomi_config_info_entry;
  897.  static struct proc_dir_entry *NVT_proc_xiaomi_lockdown_info_entry;
  898.  
  899.  /* Xiaomi Config Info. */
  900. -static uint8_t nvt_xiaomi_conf_info_fw_ver;
  901. -static uint8_t nvt_xiaomi_conf_info_fae_id;
  902. -static uint64_t nvt_xiaomi_conf_info_reservation;
  903. +static uint8_t nvt_xiaomi_conf_info_fw_ver = 0;
  904. +static uint8_t nvt_xiaomi_conf_info_fae_id = 0;
  905. +static uint64_t nvt_xiaomi_conf_info_reservation = 0;
  906.  /* Xiaomi Lockdown Info */
  907. -static uint8_t tp_maker_cg_lamination;
  908. -static uint8_t display_maker;
  909. -static uint8_t cg_ink_color;
  910. -static uint8_t hw_version;
  911. -static uint16_t project_id;
  912. -static uint8_t cg_maker;
  913. -static uint8_t reservation_byte;
  914. +static uint8_t tp_maker_cg_lamination = 0;
  915. +static uint8_t display_maker = 0;
  916. +static uint8_t cg_ink_color = 0;
  917. +static uint8_t hw_version = 0;
  918. +static uint16_t project_id = 0;
  919. +static uint8_t cg_maker = 0;
  920. +static uint8_t reservation_byte = 0;
  921.  
  922.  /*******************************************************
  923.  Description:
  924. @@ -108,7 +108,7 @@ void nvt_change_mode(uint8_t mode)
  925.  *******************************************************/
  926.  uint8_t nvt_get_fw_pipe(void)
  927.  {
  928. -   uint8_t buf[8] = {0};
  929. +   uint8_t buf[8]= {0};
  930.  
  931.     /*---set xdata index to EVENT BUF ADDR---*/
  932.     buf[0] = 0xFF;
  933. @@ -909,7 +909,7 @@ int32_t nvt_get_lockdown_info(char *lockdata)
  934.  *******************************************************/
  935.  int32_t nvt_extra_proc_init(void)
  936.  {
  937. -   NVT_proc_fw_version_entry = proc_create(NVT_FW_VERSION, 0444, NULL, &nvt_fw_version_fops);
  938. +   NVT_proc_fw_version_entry = proc_create(NVT_FW_VERSION, 0444, NULL,&nvt_fw_version_fops);
  939.     if (NVT_proc_fw_version_entry == NULL) {
  940.         NVT_ERR("create proc/nvt_fw_version Failed!\n");
  941.         return -ENOMEM;
  942. @@ -917,7 +917,7 @@ int32_t nvt_extra_proc_init(void)
  943.         NVT_LOG("create proc/nvt_fw_version Succeeded!\n");
  944.     }
  945.  
  946. -   NVT_proc_baseline_entry = proc_create(NVT_BASELINE, 0444, NULL, &nvt_baseline_fops);
  947. +   NVT_proc_baseline_entry = proc_create(NVT_BASELINE, 0444, NULL,&nvt_baseline_fops);
  948.     if (NVT_proc_baseline_entry == NULL) {
  949.         NVT_ERR("create proc/nvt_baseline Failed!\n");
  950.         return -ENOMEM;
  951. @@ -925,7 +925,7 @@ int32_t nvt_extra_proc_init(void)
  952.         NVT_LOG("create proc/nvt_baseline Succeeded!\n");
  953.     }
  954.  
  955. -   NVT_proc_raw_entry = proc_create(NVT_RAW, 0444, NULL, &nvt_raw_fops);
  956. +   NVT_proc_raw_entry = proc_create(NVT_RAW, 0444, NULL,&nvt_raw_fops);
  957.     if (NVT_proc_raw_entry == NULL) {
  958.         NVT_ERR("create proc/nvt_raw Failed!\n");
  959.         return -ENOMEM;
  960. @@ -933,7 +933,7 @@ int32_t nvt_extra_proc_init(void)
  961.         NVT_LOG("create proc/nvt_raw Succeeded!\n");
  962.     }
  963.  
  964. -   NVT_proc_diff_entry = proc_create(NVT_DIFF, 0444, NULL, &nvt_diff_fops);
  965. +   NVT_proc_diff_entry = proc_create(NVT_DIFF, 0444, NULL,&nvt_diff_fops);
  966.     if (NVT_proc_diff_entry == NULL) {
  967.         NVT_ERR("create proc/nvt_diff Failed!\n");
  968.         return -ENOMEM;
  969. diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c b/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c
  970. index 811f28ac8bae6..649ca711d0da1 100644
  971. --- a/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c
  972. +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c
  973. @@ -46,7 +46,7 @@ int32_t update_firmware_request(char *filename)
  974.     int32_t ret = 0;
  975.  
  976.     if (NULL == filename) {
  977. -       return -EPERM;
  978. +       return -1;
  979.     }
  980.  
  981.     NVT_LOG("filename is %s\n", filename);
  982. @@ -85,7 +85,7 @@ void update_firmware_release(void)
  983.     if (fw_entry) {
  984.         release_firmware(fw_entry);
  985.     }
  986. -   fw_entry = NULL;
  987. +   fw_entry=NULL;
  988.  }
  989.  
  990.  /*******************************************************
  991. @@ -178,7 +178,7 @@ int32_t Resume_PD(void)
  992.         retry++;
  993.         if (unlikely(retry > 20)) {
  994.             NVT_ERR("Check 0xAA (Resume Command) error!! status=0x%02X\n", buf[1]);
  995. -           return -EPERM;
  996. +           return -1;
  997.         }
  998.     }
  999.     msleep(10);
  1000. @@ -256,7 +256,7 @@ int32_t Check_CheckSum(void)
  1001.                 retry++;
  1002.                 if (unlikely(retry > 5)) {
  1003.                     NVT_ERR("Check 0xAA (Fast Read Command) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
  1004. -                   return -EPERM;
  1005. +                   return -1;
  1006.                 }
  1007.             }
  1008.             /* Read Checksum (write addr high byte & middle byte) */
  1009. @@ -336,7 +336,7 @@ int32_t Init_BootLoader(void)
  1010.         retry++;
  1011.         if (unlikely(retry > 20)) {
  1012.             NVT_ERR("Check 0xAA (Inittial Flash Block) error!! status=0x%02X\n", buf[1]);
  1013. -           return -EPERM;
  1014. +           return -1;
  1015.         }
  1016.     }
  1017.  
  1018. @@ -388,7 +388,7 @@ int32_t Erase_Flash(void)
  1019.         retry++;
  1020.         if (unlikely(retry > 20)) {
  1021.             NVT_ERR("Check 0xAA (Write Enable for Write Status Register) error!! status=0x%02X\n", buf[1]);
  1022. -           return -EPERM;
  1023. +           return -1;
  1024.         }
  1025.     }
  1026.  
  1027. @@ -418,7 +418,7 @@ int32_t Erase_Flash(void)
  1028.         retry++;
  1029.         if (unlikely(retry > 20)) {
  1030.             NVT_ERR("Check 0xAA (Write Status Register) error!! status=0x%02X\n", buf[1]);
  1031. -           return -EPERM;
  1032. +           return -1;
  1033.         }
  1034.     }
  1035.  
  1036. @@ -449,7 +449,7 @@ int32_t Erase_Flash(void)
  1037.         retry++;
  1038.         if (unlikely(retry > 100)) {
  1039.             NVT_ERR("Check 0xAA (Read Status for Write Status Register) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
  1040. -           return -EPERM;
  1041. +           return -1;
  1042.         }
  1043.     }
  1044.  
  1045. @@ -458,7 +458,7 @@ int32_t Erase_Flash(void)
  1046.     else
  1047.         count = fw_entry->size / FLASH_SECTOR_SIZE;
  1048.  
  1049. -   for (i = 0; i < count; i++) {
  1050. +   for(i = 0; i < count; i++) {
  1051.         /* Write Enable */
  1052.         buf[0] = 0x00;
  1053.         buf[1] = 0x06;
  1054. @@ -484,7 +484,7 @@ int32_t Erase_Flash(void)
  1055.             retry++;
  1056.             if (unlikely(retry > 20)) {
  1057.                 NVT_ERR("Check 0xAA (Write Enable) error!! status=0x%02X\n", buf[1]);
  1058. -               return -EPERM;
  1059. +               return -1;
  1060.             }
  1061.         }
  1062.  
  1063. @@ -518,7 +518,7 @@ int32_t Erase_Flash(void)
  1064.             retry++;
  1065.             if (unlikely(retry > 20)) {
  1066.                 NVT_ERR("Check 0xAA (Sector Erase) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
  1067. -               return -EPERM;
  1068. +               return -1;
  1069.             }
  1070.         }
  1071.  
  1072. @@ -549,7 +549,7 @@ int32_t Erase_Flash(void)
  1073.             retry++;
  1074.             if (unlikely(retry > 100)) {
  1075.                 NVT_ERR("Check 0xAA (Read Status) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
  1076. -               return -EPERM;
  1077. +               return -1;
  1078.             }
  1079.         }
  1080.     }
  1081. @@ -619,7 +619,7 @@ int32_t Write_Flash(void)
  1082.             retry++;
  1083.             if (unlikely(retry > 20)) {
  1084.                 NVT_ERR("Check 0xAA (Write Enable) error!! status=0x%02X\n", buf[1]);
  1085. -               return -EPERM;
  1086. +               return -1;
  1087.             }
  1088.         }
  1089.  
  1090. @@ -636,11 +636,11 @@ int32_t Write_Flash(void)
  1091.             }
  1092.         }
  1093.         if (fw_entry->size - Flash_Address >= 256)
  1094. -           tmpvalue = (Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (255);
  1095. +           tmpvalue=(Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (255);
  1096.         else
  1097. -           tmpvalue = (Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (fw_entry->size - Flash_Address - 1);
  1098. +           tmpvalue=(Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (fw_entry->size - Flash_Address - 1);
  1099.  
  1100. -       for (k = 0; k < min(fw_entry->size - Flash_Address,(size_t)256); k++)
  1101. +       for (k = 0;k < min(fw_entry->size - Flash_Address,(size_t)256); k++)
  1102.             tmpvalue += fw_entry->data[Flash_Address + k];
  1103.  
  1104.         tmpvalue = 255 - tmpvalue + 1;
  1105. @@ -676,7 +676,7 @@ int32_t Write_Flash(void)
  1106.             retry++;
  1107.             if (unlikely(retry > 20)) {
  1108.                 NVT_ERR("Check 0xAA (Page Program) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
  1109. -               return -EPERM;
  1110. +               return -1;
  1111.             }
  1112.         }
  1113.         if (buf[1] == 0xEA) {
  1114. @@ -711,7 +711,7 @@ int32_t Write_Flash(void)
  1115.             retry++;
  1116.             if (unlikely(retry > 100)) {
  1117.                 NVT_ERR("Check 0xAA (Read Status) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
  1118. -               return -EPERM;
  1119. +               return -1;
  1120.             }
  1121.         }
  1122.         if (buf[1] == 0xEA) {
  1123. @@ -790,7 +790,7 @@ int32_t Verify_Flash(void)
  1124.                 retry++;
  1125.                 if (unlikely(retry > 5)) {
  1126.                     NVT_ERR("Check 0xAA (Fast Read Command) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
  1127. -                   return -EPERM;
  1128. +                   return -1;
  1129.                 }
  1130.             }
  1131.             /* Read Checksum (write addr high byte & middle byte) */
  1132. @@ -816,7 +816,7 @@ int32_t Verify_Flash(void)
  1133.             if (WR_Filechksum[i] != RD_Filechksum[i]) {
  1134.                 NVT_ERR("Verify Fail%d!!\n", i);
  1135.                 NVT_ERR("RD_Filechksum[%d]=0x%04X, WR_Filechksum[%d]=0x%04X\n", i, RD_Filechksum[i], i, WR_Filechksum[i]);
  1136. -               return -EPERM;
  1137. +               return -1;
  1138.             }
  1139.         }
  1140.     }
  1141. @@ -938,7 +938,7 @@ int32_t nvt_check_flash_end_flag(void)
  1142.     }
  1143.     if (buf[1] != 0xAA) {
  1144.         NVT_ERR("Check 0xAA (Read Command) error!! status=0x%02X\n", buf[1]);
  1145. -       return -EPERM;
  1146. +       return -1;
  1147.     }
  1148.  
  1149.     msleep(10);
  1150. diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c b/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c
  1151. index 1c3d7c87527c5..3c16f4bd18838 100644
  1152. --- a/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c
  1153. +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c
  1154. @@ -47,44 +47,44 @@
  1155.         printk(fmt, ##args);    \
  1156.  } while (0)
  1157.  
  1158. -static uint8_t *RecordResult_Short;
  1159. -static uint8_t *RecordResult_Short_Diff;
  1160. -static uint8_t *RecordResult_Short_Base;
  1161. -static uint8_t *RecordResult_Open;
  1162. -static uint8_t *RecordResult_FWMutual;
  1163. -static uint8_t *RecordResult_FW_CC;
  1164. -static uint8_t *RecordResult_FW_CC_I;
  1165. -static uint8_t *RecordResult_FW_CC_Q;
  1166. -static uint8_t *RecordResult_FW_DiffMax;
  1167. -static uint8_t *RecordResult_FW_DiffMin;
  1168. -
  1169. -static int32_t TestResult_Short;
  1170. -static int32_t TestResult_Short_Diff;
  1171. -static int32_t TestResult_Short_Base;
  1172. -static int32_t TestResult_Open;
  1173. -static int32_t TestResult_FW_Rawdata;
  1174. -static int32_t TestResult_FWMutual;
  1175. -static int32_t TestResult_FW_CC;
  1176. -static int32_t TestResult_FW_CC_I;
  1177. -static int32_t TestResult_FW_CC_Q;
  1178. -static int32_t TestResult_Noise;
  1179. -static int32_t TestResult_FW_DiffMax;
  1180. -static int32_t TestResult_FW_DiffMin;
  1181. -
  1182. -static int32_t *RawData_Short;
  1183. -static int32_t *RawData_Short_Diff;
  1184. -static int32_t *RawData_Short_Base;
  1185. -static int32_t *RawData_Open;
  1186. -static int32_t *RawData_Diff;
  1187. -static int32_t *RawData_Diff_Min;
  1188. -static int32_t *RawData_Diff_Max;
  1189. -static int32_t *RawData_FWMutual;
  1190. -static int32_t *RawData_FW_CC;
  1191. -static int32_t *RawData_FW_CC_I;
  1192. -static int32_t *RawData_FW_CC_Q;
  1193. -
  1194. -static struct proc_dir_entry *NVT_proc_selftest_entry;
  1195. -static int8_t nvt_mp_test_result_printed;
  1196. +static uint8_t *RecordResult_Short = NULL;
  1197. +static uint8_t *RecordResult_Short_Diff = NULL;
  1198. +static uint8_t *RecordResult_Short_Base = NULL;
  1199. +static uint8_t *RecordResult_Open = NULL;
  1200. +static uint8_t *RecordResult_FWMutual = NULL;
  1201. +static uint8_t *RecordResult_FW_CC = NULL;
  1202. +static uint8_t *RecordResult_FW_CC_I = NULL;
  1203. +static uint8_t *RecordResult_FW_CC_Q = NULL;
  1204. +static uint8_t *RecordResult_FW_DiffMax = NULL;
  1205. +static uint8_t *RecordResult_FW_DiffMin = NULL;
  1206. +
  1207. +static int32_t TestResult_Short = 0;
  1208. +static int32_t TestResult_Short_Diff = 0;
  1209. +static int32_t TestResult_Short_Base = 0;
  1210. +static int32_t TestResult_Open = 0;
  1211. +static int32_t TestResult_FW_Rawdata = 0;
  1212. +static int32_t TestResult_FWMutual = 0;
  1213. +static int32_t TestResult_FW_CC = 0;
  1214. +static int32_t TestResult_FW_CC_I = 0;
  1215. +static int32_t TestResult_FW_CC_Q = 0;
  1216. +static int32_t TestResult_Noise = 0;
  1217. +static int32_t TestResult_FW_DiffMax = 0;
  1218. +static int32_t TestResult_FW_DiffMin = 0;
  1219. +
  1220. +static int32_t *RawData_Short = NULL;
  1221. +static int32_t *RawData_Short_Diff = NULL;
  1222. +static int32_t *RawData_Short_Base = NULL;
  1223. +static int32_t *RawData_Open = NULL;
  1224. +static int32_t *RawData_Diff = NULL;
  1225. +static int32_t *RawData_Diff_Min = NULL;
  1226. +static int32_t *RawData_Diff_Max = NULL;
  1227. +static int32_t *RawData_FWMutual = NULL;
  1228. +static int32_t *RawData_FW_CC = NULL;
  1229. +static int32_t *RawData_FW_CC_I = NULL;
  1230. +static int32_t *RawData_FW_CC_Q = NULL;
  1231. +
  1232. +static struct proc_dir_entry *NVT_proc_selftest_entry = NULL;
  1233. +static int8_t nvt_mp_test_result_printed = 0;
  1234.  
  1235.  extern void nvt_change_mode(uint8_t mode);
  1236.  extern uint8_t nvt_get_fw_pipe(void);
  1237. @@ -242,7 +242,7 @@ static void nvt_print_lmt_array(int32_t *array, int32_t x_ch, int32_t y_ch)
  1238.  
  1239.     for (j = 0; j < y_ch; j++) {
  1240.         ret = 0;
  1241. -       for (i = 0; i < x_ch; i++) {
  1242. +       for(i = 0; i < x_ch; i++) {
  1243.             ret += snprintf(buf + ret, 8, "%5d, ", array[j * x_ch + i]);
  1244.         }
  1245.         buf[ret] = '\0';
  1246. @@ -372,7 +372,7 @@ static int32_t nvt_polling_hand_shake_status(void)
  1247.         CTP_I2C_READ(ts->client, I2C_FW_Address, buf, 6);
  1248.         NVT_ERR("Read back 5 bytes from offset EVENT_MAP_HOST_CMD: 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X\n", buf[1], buf[2], buf[3], buf[4], buf[5]);
  1249.  
  1250. -       return -EPERM;
  1251. +       return -1;
  1252.     } else {
  1253.         return 0;
  1254.     }
  1255. @@ -995,10 +995,10 @@ static int32_t RawDataTest_SinglePoint_Sub(int32_t rawdata[], uint8_t RecordResu
  1256.  
  1257.             RecordResult[iArrayIndex] = 0x00; /* default value for PASS */
  1258.  
  1259. -           if (rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
  1260. +           if(rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
  1261.                 RecordResult[iArrayIndex] |= 0x01;
  1262.  
  1263. -           if (rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
  1264. +           if(rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
  1265.                 RecordResult[iArrayIndex] |= 0x02;
  1266.         }
  1267.     }
  1268. @@ -1008,10 +1008,10 @@ static int32_t RawDataTest_SinglePoint_Sub(int32_t rawdata[], uint8_t RecordResu
  1269.  
  1270.         RecordResult[iArrayIndex] = 0x00; /* default value for PASS */
  1271.  
  1272. -       if (rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
  1273. +       if(rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
  1274.             RecordResult[iArrayIndex] |= 0x01;
  1275.  
  1276. -       if (rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
  1277. +       if(rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
  1278.             RecordResult[iArrayIndex] |= 0x02;
  1279.     }
  1280.  #endif /* #if TOUCH_KEY_NUM > 0 */
  1281. @@ -1036,7 +1036,7 @@ static int32_t RawDataTest_SinglePoint_Sub(int32_t rawdata[], uint8_t RecordResu
  1282.  #endif /* #if TOUCH_KEY_NUM > 0 */
  1283.  
  1284.     if (isPass == false) {
  1285. -       return -EPERM; /* FAIL */
  1286. +       return -1; /* FAIL */
  1287.     } else {
  1288.         return 0; /* PASS */
  1289.     }
  1290. @@ -1281,7 +1281,7 @@ static int32_t nvt_selftest_open(struct inode *inode, struct file *file)
  1291.     }
  1292.  
  1293.     /* Parsing criteria from dts */
  1294. -   if (of_property_read_bool(np, "novatek,mp-support-dt")) {
  1295. +   if(of_property_read_bool(np, "novatek,mp-support-dt")) {
  1296.         /*
  1297.          * Parsing Criteria by Novatek PID
  1298.          * The string rule is "novatek-mp-criteria-<nvt_pid>"
  1299. @@ -1898,11 +1898,11 @@ int32_t nvt_mp_proc_init(void)
  1300.     NVT_proc_selftest_entry = proc_create("nvt_selftest", 0444, NULL, &nvt_selftest_fops);
  1301.     if (NVT_proc_selftest_entry == NULL) {
  1302.         NVT_ERR("create /proc/nvt_selftest Failed!\n");
  1303. -       return -EPERM;
  1304. +       return -1;
  1305.     } else {
  1306. -       if (nvt_mp_buffer_init()) {
  1307. +       if(nvt_mp_buffer_init()) {
  1308.             NVT_ERR("Allocate mp memory failed\n");
  1309. -           return -EPERM;
  1310. +           return -1;
  1311.         }
  1312.         else {
  1313.             NVT_LOG("create /proc/nvt_selftest Succeeded!\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement