Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- arter97@arter97-dgist:~/beryllium$ git diff --diff-filter=M cm/lineage-16.0..@ drivers/input/touchscreen/focaltech_touch drivers/input/touchscreen/nt36xxx | cat
- diff --git a/drivers/input/touchscreen/focaltech_touch/Kconfig b/drivers/input/touchscreen/focaltech_touch/Kconfig
- index 00deec747a3eb..e1ec3b91202e3 100644
- --- a/drivers/input/touchscreen/focaltech_touch/Kconfig
- +++ b/drivers/input/touchscreen/focaltech_touch/Kconfig
- @@ -1,18 +1,16 @@
- #
- # Focaltech Touchscreen driver configuration
- #
- -menuconfig TOUCHSCREEN_FTS
- - bool "Focaltech Touchscreen"
- - depends on I2C
- - default n
- - help
- - Say Y here if you have Focaltech touch panel.
- - If unsure, say N.
- +
- +config TOUCHSCREEN_FTS
- + bool "Focaltech Touchscreen"
- + depends on I2C
- + default n
- + help
- + Say Y here if you have Focaltech touch panel.
- + If unsure, say N.
- config TOUCHSCREEN_FTS_DIRECTORY
- - string "Focaltech ts directory name"
- - default "focaltech_touch"
- - depends on TOUCHSCREEN_FTS
- - help
- - Specify the path for the driver directory.
- - Path should be relative to driver/input/touchscreen/.
- + string "Focaltech ts directory name"
- + default "focaltech_touch"
- + depends on TOUCHSCREEN_FTS
- diff --git a/drivers/input/touchscreen/focaltech_touch/Makefile b/drivers/input/touchscreen/focaltech_touch/Makefile
- index b15e34efbaab2..66acd75cfa300 100644
- --- a/drivers/input/touchscreen/focaltech_touch/Makefile
- +++ b/drivers/input/touchscreen/focaltech_touch/Makefile
- @@ -10,7 +10,8 @@ obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_ex_mode.o
- obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_flash.o
- obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_gesture.o
- obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_esdcheck.o
- -obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_i2c.o
- -obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_point_report_check.o
- -obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_flash/
- +obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_i2c.o
- +obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_point_report_check.o
- +obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_flash/
- +obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_test/
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_common.h b/drivers/input/touchscreen/focaltech_touch/focaltech_common.h
- index 25b00928dc907..77d0d877164d6 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_common.h
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_common.h
- @@ -3,7 +3,6 @@
- * FocalTech fts TouchScreen driver.
- *
- * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_config.h b/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
- index d397030f56831..9c21545fafcbb 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -128,6 +127,12 @@
- */
- #define FTS_ESDCHECK_EN 0
- +/*
- + * Production test enable
- + * 1: enable, 0:disable(default)
- + */
- +#define FTS_TEST_EN 1
- +
- /*
- * Glove mode enable
- * 1: enable, 0:disable(default)
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
- index f610f4622a30b..91a2884beb7b6 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -41,7 +40,6 @@
- #include <linux/earlysuspend.h>
- #define FTS_SUSPEND_LEVEL 1 /* Early-suspend level */
- #endif
- -#include <linux/hwinfo.h>
- /*****************************************************************************
- * Private constant and macro definitions using #define
- @@ -561,7 +559,7 @@ static int fts_pinctrl_select_release(struct fts_ts_data *ts)
- #if (FTS_DEBUG_EN && (FTS_DEBUG_LEVEL == 2))
- char g_sz_debug[1024] = { 0 };
- -static void fts_show_touch_buffer(u8 *buf, int point_num)
- +static void fts_show_touch_buffer(u8 * buf, int point_num)
- {
- int len = point_num * FTS_ONE_TCH_LEN;
- int count = 0;
- @@ -1369,7 +1367,7 @@ static const struct attribute_group fts_attr_group = {
- };
- #define TP_INFO_MAX_LENGTH 50
- -static ssize_t fts_lockdown_info_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
- +static ssize_t fts_lockdown_info_read(struct file *file, char __user * buf, size_t count, loff_t * pos)
- {
- int cnt = 0, ret = 0;
- char tmp[TP_INFO_MAX_LENGTH];
- @@ -1396,7 +1394,7 @@ static const struct file_operations fts_lockdown_info_ops = {
- .read = fts_lockdown_info_read,
- };
- -static ssize_t fts_fw_version_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
- +static ssize_t fts_fw_version_read(struct file *file, char __user * buf, size_t count, loff_t * pos)
- {
- int cnt = 0, ret = 0;
- char tmp[TP_INFO_MAX_LENGTH];
- @@ -1432,7 +1430,7 @@ static int tpdbg_open(struct inode *inode, struct file *file)
- return 0;
- }
- -static ssize_t tpdbg_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
- +static ssize_t tpdbg_read(struct file *file, char __user * buf, size_t size, loff_t * ppos)
- {
- const char *str = "cmd support as below:\n \
- @@ -1456,7 +1454,7 @@ static ssize_t tpdbg_read(struct file *file, char __user *buf, size_t size, loff
- return len;
- }
- -static ssize_t tpdbg_write(struct file *file, const char __user *buf, size_t size, loff_t *ppos)
- +static ssize_t tpdbg_write(struct file *file, const char __user * buf, size_t size, loff_t * ppos)
- {
- struct fts_ts_data *ts_data = file->private_data;
- char *cmd = kzalloc(size + 1, GFP_KERNEL);
- @@ -1760,6 +1758,14 @@ static int fts_ts_probe(struct i2c_client *client, const struct i2c_device_id *i
- }
- #endif
- +#if FTS_TEST_EN
- + ret = fts_test_init(client);
- + if (ret) {
- + FTS_ERROR("init production test fail");
- + goto err_debugfs_create;
- + }
- +#endif
- +
- #if FTS_ESDCHECK_EN
- ret = fts_esdcheck_init(ts_data);
- if (ret) {
- @@ -1806,8 +1812,6 @@ static int fts_ts_probe(struct i2c_client *client, const struct i2c_device_id *i
- ts_data->early_suspend.resume = fts_ts_late_resume;
- register_early_suspend(&ts_data->early_suspend);
- #endif
- - update_hardware_info(TYPE_TOUCH, 3);
- - update_hardware_info(TYPE_TP_MAKER, ts_data->lockdown_info[0] - 0x30);
- FTS_FUNC_EXIT();
- return 0;
- @@ -1881,6 +1885,10 @@ static int fts_ts_remove(struct i2c_client *client)
- fts_fwupg_exit(ts_data);
- #endif
- +#if FTS_TEST_EN
- + fts_test_exit(client);
- +#endif
- +
- #if FTS_ESDCHECK_EN
- fts_esdcheck_exit(ts_data);
- #endif
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
- index 0ee6f1c48ebc7..4648dc1f0fe4c 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -204,7 +203,7 @@ extern struct fts_ts_data *fts_data;
- /* i2c communication*/
- int fts_i2c_write_reg(struct i2c_client *client, u8 regaddr, u8 regvalue);
- -int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 *regvalue);
- +int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 * regvalue);
- int fts_i2c_read(struct i2c_client *client, char *writebuf, int writelen, char *readbuf, int readlen);
- int fts_i2c_write(struct i2c_client *client, char *writebuf, int writelen);
- void fts_i2c_hid2std(struct i2c_client *client);
- @@ -244,6 +243,12 @@ int fts_esdcheck_suspend(void);
- int fts_esdcheck_resume(void);
- #endif
- +/* Production test */
- +#if FTS_TEST_EN
- +int fts_test_init(struct i2c_client *client);
- +int fts_test_exit(struct i2c_client *client);
- +#endif
- +
- /* Point Report Check*/
- #if FTS_POINT_REPORT_CHECK_EN
- int fts_point_report_check_init(struct fts_ts_data *ts_data);
- @@ -267,8 +272,8 @@ int fts_ex_mode_recovery(struct i2c_client *client);
- void fts_irq_disable(void);
- void fts_irq_enable(void);
- -int fts_flash_read(struct i2c_client *client, u32 addr, u8 *buf, u32 len);
- -int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len);
- +int fts_flash_read(struct i2c_client *client, u32 addr, u8 * buf, u32 len);
- +int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len);
- void fts_gesture_enable(bool enable);
- #endif /* __LINUX_FOCALTECH_CORE_H__ */
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c b/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c
- index cee3a91e19fc6..31e6b33b531d9 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_esdcheck.c
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c
- index 0991b41bfe14f..75f8170c04912 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_fun.c
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -87,7 +86,7 @@ static struct rwreg_operation_t {
- * Output: no
- * Return: data len
- ***********************************************************************/
- -static ssize_t fts_debug_write(struct file *filp, const char __user *buff, size_t count, loff_t *ppos)
- +static ssize_t fts_debug_write(struct file *filp, const char __user * buff, size_t count, loff_t * ppos)
- {
- u8 writebuf[PROC_WRITE_BUF_SIZE] = { 0 };
- int buflen = count;
- @@ -181,7 +180,7 @@ static ssize_t fts_debug_write(struct file *filp, const char __user *buff, size_
- * Output: page point to data
- * Return: read char number
- ***********************************************************************/
- -static ssize_t fts_debug_read(struct file *filp, char __user *buff, size_t count, loff_t *ppos)
- +static ssize_t fts_debug_read(struct file *filp, char __user * buff, size_t count, loff_t * ppos)
- {
- int ret = 0;
- int num_read_chars = 0;
- @@ -256,7 +255,7 @@ static const struct file_operations fts_proc_fops = {
- * Output: no
- * Return: data len
- ***********************************************************************/
- -static int fts_debug_write(struct file *filp, const char __user *buff, unsigned long len, void *data)
- +static int fts_debug_write(struct file *filp, const char __user * buff, unsigned long len, void *data)
- {
- int ret = 0;
- u8 writebuf[PROC_WRITE_BUF_SIZE] = { 0 };
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c
- index b987679e9a8af..4c89cca22a22a 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_ex_mode.c
- @@ -3,7 +3,6 @@
- * FocalTech ftxxxx TouchScreen driver.
- *
- * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c
- index fa254c5425102..e6eb2c0dcdcf9 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c
- @@ -3,7 +3,6 @@
- * FocalTech fts TouchScreen driver.
- *
- * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -74,7 +73,7 @@ struct fts_upgrade *fwupgrade;
- /*****************************************************************************
- * Static function prototypes
- *****************************************************************************/
- -static u16 fts_pram_ecc_calc_host(u8 *pbuf, u16 length)
- +static u16 fts_pram_ecc_calc_host(u8 * pbuf, u16 length)
- {
- u16 ecc = 0;
- u16 i = 0;
- @@ -182,7 +181,7 @@ static int fts_pram_ecc_cal(struct i2c_client *client, u32 saddr, u32 len)
- *
- * return pramboot ecc of host if success, otherwise return error code
- ***********************************************************************/
- -static int fts_pram_write_buf(struct i2c_client *client, u8 *buf, u32 len)
- +static int fts_pram_write_buf(struct i2c_client *client, u8 * buf, u32 len)
- {
- int ret = 0;
- u32 i = 0;
- @@ -447,7 +446,7 @@ int fts_pram_write_init(struct i2c_client *client)
- * Output:
- * Return: return true if fw is valid, otherwise return false
- ***********************************************************************/
- -bool fts_fwupg_check_fw_valid(struct i2c_client *client)
- +bool fts_fwupg_check_fw_valid(struct i2c_client * client)
- {
- int ret = 0;
- @@ -535,7 +534,7 @@ int fts_fwupg_get_boot_state(struct i2c_client *client, enum FW_STATUS *fw_sts)
- * Output:
- * Return: return true if state is match, otherwise return false
- ***********************************************************************/
- -bool fts_fwupg_check_state(struct i2c_client *client, enum FW_STATUS rstate)
- +bool fts_fwupg_check_state(struct i2c_client * client, enum FW_STATUS rstate)
- {
- int ret = 0;
- int i = 0;
- @@ -853,7 +852,7 @@ int fts_fwupg_ecc_cal(struct i2c_client *client, u32 saddr, u32 len)
- * Output:
- * Return: return data ecc of host if success, otherwise return error code
- ***********************************************************************/
- -int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len, u32 delay)
- +int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len, u32 delay)
- {
- int ret = 0;
- u32 i = 0;
- @@ -940,7 +939,7 @@ int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len,
- *
- * Warning: can't call this function directly, need call in boot environment
- ***********************************************************************/
- -int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len)
- +int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len)
- {
- int ret = 0;
- u32 i = 0;
- @@ -1001,7 +1000,7 @@ int fts_flash_read_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len)
- * Output: buf - data read from flash
- * Return: return 0 if success, otherwise return error code
- ***********************************************************************/
- -int fts_flash_read(struct i2c_client *client, u32 addr, u8 *buf, u32 len)
- +int fts_flash_read(struct i2c_client *client, u32 addr, u8 * buf, u32 len)
- {
- int ret = 0;
- @@ -1040,7 +1039,7 @@ int fts_flash_read(struct i2c_client *client, u32 addr, u8 *buf, u32 len)
- * Output:
- * Return: return file len if succuss, otherwise return error code
- ***********************************************************************/
- -int fts_read_file(char *file_name, u8 **file_buf)
- +int fts_read_file(char *file_name, u8 ** file_buf)
- {
- int ret = 0;
- char file_path[FILE_NAME_LENGTH] = { 0 };
- @@ -1155,7 +1154,7 @@ int fts_upgrade_bin(struct i2c_client *client, char *fw_name, bool force)
- }
- #if FTS_AUTO_LIC_UPGRADE_EN
- -static int fts_lic_get_vid_in_tp(struct i2c_client *client, u16 *vid)
- +static int fts_lic_get_vid_in_tp(struct i2c_client *client, u16 * vid)
- {
- int ret = 0;
- u8 val[2] = { 0 };
- @@ -1177,7 +1176,7 @@ static int fts_lic_get_vid_in_tp(struct i2c_client *client, u16 *vid)
- return 0;
- }
- -static int fts_lic_get_vid_in_host(u16 *vid)
- +static int fts_lic_get_vid_in_host(u16 * vid)
- {
- u8 val[2] = { 0 };
- u8 *licbuf = NULL;
- @@ -1204,7 +1203,7 @@ static int fts_lic_get_vid_in_host(u16 *vid)
- return 0;
- }
- -static int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 *ver)
- +static int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 * ver)
- {
- int ret = 0;
- @@ -1222,7 +1221,7 @@ static int fts_lic_get_ver_in_tp(struct i2c_client *client, u8 *ver)
- return 0;
- }
- -static int fts_lic_get_ver_in_host(u8 *ver)
- +static int fts_lic_get_ver_in_host(u8 * ver)
- {
- int ret = 0;
- struct fts_upgrade *upg = fwupgrade;
- @@ -1341,7 +1340,7 @@ int fts_lic_upgrade(struct i2c_client *client, struct fts_upgrade *upg)
- }
- #endif /* FTS_AUTO_LIC_UPGRADE_EN */
- -static int fts_param_get_ver_in_tp(struct i2c_client *client, u8 *ver)
- +static int fts_param_get_ver_in_tp(struct i2c_client *client, u8 * ver)
- {
- int ret = 0;
- @@ -1364,7 +1363,7 @@ static int fts_param_get_ver_in_tp(struct i2c_client *client, u8 *ver)
- return 0;
- }
- -static int fts_param_get_ver_in_host(u8 *ver)
- +static int fts_param_get_ver_in_host(u8 * ver)
- {
- struct fts_upgrade *upg = fwupgrade;
- @@ -1447,7 +1446,7 @@ static bool fts_param_need_upgrade(struct i2c_client *client)
- *
- * return 0 if success, otherwise return error code
- ***********************************************************************/
- -static int fts_fwupg_get_ver_in_tp(struct i2c_client *client, u8 *ver)
- +static int fts_fwupg_get_ver_in_tp(struct i2c_client *client, u8 * ver)
- {
- int ret = 0;
- @@ -1470,7 +1469,7 @@ static int fts_fwupg_get_ver_in_tp(struct i2c_client *client, u8 *ver)
- *
- * return 0 if success, otherwise return error code
- ***********************************************************************/
- -static int fts_fwupg_get_ver_in_host(u8 *ver)
- +static int fts_fwupg_get_ver_in_host(u8 * ver)
- {
- struct fts_upgrade *upg = fwupgrade;
- @@ -1642,7 +1641,7 @@ void fts_fwupg_auto_upgrade(struct fts_ts_data *ts_data)
- *
- * return 0 if success, otherwise return error code
- */
- -int fts_fwupg_get_vendorid(struct fts_ts_data *ts_data, u16 *vid)
- +int fts_fwupg_get_vendorid(struct fts_ts_data *ts_data, u16 * vid)
- {
- int ret = 0;
- bool fwvalid = false;
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h
- index d4d983c02cbef..5dd460ee735ca 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.h
- @@ -1,6 +1,5 @@
- /************************************************************************
- * Copyright (C) 2010-2017, Focaltech Systems (R)��All Rights Reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * File Name: focaltech_flash.h
- *
- @@ -163,6 +162,6 @@ int fts_fwupg_reset_to_romboot(struct i2c_client *client);
- int fts_fwupg_enter_into_boot(struct i2c_client *client);
- int fts_fwupg_erase(struct i2c_client *client, u32 delay);
- int fts_fwupg_ecc_cal(struct i2c_client *client, u32 saddr, u32 len);
- -int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 *buf, u32 len, u32 delay);
- +int fts_flash_write_buf(struct i2c_client *client, u32 saddr, u8 * buf, u32 len, u32 delay);
- int fts_fwupg_upgrade(struct i2c_client *client, struct fts_upgrade *upg);
- #endif
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile b/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile
- index 9a27096ad991a..21e5dba22ab21 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash/Makefile
- @@ -5,14 +5,4 @@
- # Each configuration option enables a list of files.
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft5x46.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft5822.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft6336gu.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8006.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8606.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8607.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8716.o
- -obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8719.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8736.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_idc.o
- -#obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_test.o
- +obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft8719.o
- \ No newline at end of file
- 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
- index 27182d415c69b..72ba847620f42 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash/focaltech_upgrade_ft8719.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash/focaltech_upgrade_ft8719.c
- @@ -51,7 +51,7 @@ u8 pb_file_ft8719[] = {
- * fts_ft8719_upgrade_mode -
- * Return: return 0 if success, otherwise return error code
- ***********************************************************************/
- -static int fts_ft8719_upgrade_mode(struct i2c_client *client, enum FW_FLASH_MODE mode, u8 *buf, u32 len)
- +static int fts_ft8719_upgrade_mode(struct i2c_client *client, enum FW_FLASH_MODE mode, u8 * buf, u32 len)
- {
- int ret = 0;
- u32 start_addr = 0;
- @@ -129,7 +129,7 @@ static int fts_ft8719_upgrade_mode(struct i2c_client *client, enum FW_FLASH_MODE
- * Output:
- * Return: return 0 if success, otherwise return error code
- ***********************************************************************/
- -static int fts_ft8719_upgrade(struct i2c_client *client, u8 *buf, u32 len)
- +static int fts_ft8719_upgrade(struct i2c_client *client, u8 * buf, u32 len)
- {
- int ret = 0;
- u8 *tmpbuf = NULL;
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c b/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
- index 60d28b9bfabc8..e464e278c47df 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -334,7 +333,7 @@ static void fts_gesture_report(struct input_dev *input_dev, int gesture_id)
- * Output:
- * Return: fail <0
- ***********************************************************************/
- -static int fts_gesture_read_buffer(struct i2c_client *client, u8 *buf, int read_bytes)
- +static int fts_gesture_read_buffer(struct i2c_client *client, u8 * buf, int read_bytes)
- {
- int remain_bytes;
- int ret;
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c b/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c
- index 7614965fd05a0..1ae4afbeb488c 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_i2c.c
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -181,7 +180,7 @@ int fts_i2c_write_reg(struct i2c_client *client, u8 regaddr, u8 regvalue)
- * Output: get reg value
- * Return: fail <0
- ***********************************************************************/
- -int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 *regvalue)
- +int fts_i2c_read_reg(struct i2c_client *client, u8 regaddr, u8 * regvalue)
- {
- return fts_i2c_read(client, ®addr, 1, regvalue, 1);
- }
- diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c b/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c
- index c757fc7b89f45..121f4ae9dcf35 100644
- --- a/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c
- +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_point_report_check.c
- @@ -3,7 +3,6 @@
- * FocalTech TouchScreen driver.
- *
- * Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
- - * Copyright (C) 2018 XiaoMi, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx.c b/drivers/input/touchscreen/nt36xxx/nt36xxx.c
- index 9f3538957f043..985fab4211990 100644
- --- a/drivers/input/touchscreen/nt36xxx/nt36xxx.c
- +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx.c
- @@ -29,7 +29,6 @@
- #include <linux/of_irq.h>
- #include <linux/slab.h>
- #include <linux/regulator/consumer.h>
- -#include <linux/hwinfo.h>
- #ifdef CONFIG_DRM
- #include <drm/drm_notifier.h>
- @@ -46,7 +45,7 @@
- #if NVT_TOUCH_ESD_PROTECT
- static struct delayed_work nvt_esd_check_work;
- static struct workqueue_struct *nvt_esd_check_wq;
- -static unsigned long irq_timer;
- +static unsigned long irq_timer = 0;
- uint8_t esd_check = false;
- uint8_t esd_retry = 0;
- uint8_t esd_retry_max = 5;
- @@ -94,6 +93,8 @@ static void nvt_ts_late_resume(struct early_suspend *h);
- #define INPUT_EVENT_PALM_ON 13
- #define INPUT_EVENT_END 13
- +#define PROC_SYMLINK_PATH "touchpanel"
- +
- #if TOUCH_KEY_NUM > 0
- const uint16_t touch_key_array[TOUCH_KEY_NUM] = {
- KEY_BACK,
- @@ -120,7 +121,7 @@ const uint16_t gesture_key_array[] = {
- };
- #endif
- -static uint8_t bTouchIsAwake;
- +static uint8_t bTouchIsAwake = 0;
- /*******************************************************
- Description:
- @@ -206,11 +207,11 @@ int32_t CTP_I2C_WRITE(struct i2c_client *client, uint16_t address, uint8_t *buf,
- *******************************************************/
- void nvt_sw_reset_idle(void)
- {
- - uint8_t buf[4] = {0};
- + uint8_t buf[4]={0};
- /*---write i2c cmds to reset idle---*/
- - buf[0] = 0x00;
- - buf[1] = 0xA5;
- + buf[0]=0x00;
- + buf[1]=0xA5;
- CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
- msleep(15);
- @@ -277,7 +278,7 @@ int32_t nvt_clear_fw_status(void)
- if (i >= retry) {
- NVT_ERR("failed, i=%d, buf[1]=0x%02X\n", i, buf[1]);
- - return -EPERM;
- + return -1;
- } else {
- return 0;
- }
- @@ -349,7 +350,7 @@ int32_t nvt_check_fw_reset_state(RST_COMPLETE_STATE check_reset_state)
- }
- retry++;
- - if (unlikely(retry > 100)) {
- + if(unlikely(retry > 100)) {
- 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]);
- ret = -1;
- break;
- @@ -432,7 +433,7 @@ int32_t nvt_get_fw_info(void)
- ts->abs_y_max = TOUCH_DEFAULT_MAX_HEIGHT;
- ts->max_button_num = TOUCH_KEY_NUM;
- - if (retry_count < 3) {
- + if(retry_count < 3) {
- retry_count++;
- NVT_ERR("retry_count=%d\n", retry_count);
- goto info_retry;
- @@ -593,7 +594,7 @@ static const struct file_operations nvt_flash_fops = {
- *******************************************************/
- static int32_t nvt_flash_proc_init(void)
- {
- - NVT_proc_entry = proc_create(DEVICE_NAME, 0444, NULL, &nvt_flash_fops);
- + NVT_proc_entry = proc_create(DEVICE_NAME, 0444, NULL,&nvt_flash_fops);
- if (NVT_proc_entry == NULL) {
- NVT_ERR("Failed!\n");
- return -ENOMEM;
- @@ -860,7 +861,6 @@ static const char *nvt_get_config(struct nvt_ts_data *ts)
- NVT_LOG("Choose config %d: %s", i,
- ts->config_array[i].nvt_cfg_name);
- ts->current_index = i;
- -
- return ts->config_array[i].nvt_cfg_name;
- }
- @@ -1026,7 +1026,7 @@ static uint8_t nvt_fw_recovery(uint8_t *point_data)
- uint8_t detected = true;
- /* check pattern */
- - for (i = 1 ; i < 7 ; i++) {
- + for (i=1 ; i<7 ; i++) {
- if (point_data[i] != 0x77) {
- detected = false;
- break;
- @@ -1066,11 +1066,9 @@ static void nvt_switch_mode_work(struct work_struct *work)
- struct nvt_mode_switch *ms = container_of(work, struct nvt_mode_switch, switch_mode_work);
- struct nvt_ts_data *data = ms->nvt_data;
- unsigned char value = ms->mode;
- - char ch[64] = {0x0,};
- if (value >= INPUT_EVENT_WAKUP_MODE_OFF && value <= INPUT_EVENT_WAKUP_MODE_ON) {
- data->gesture_enabled = value - INPUT_EVENT_WAKUP_MODE_OFF;
- - snprintf(ch, sizeof(ch), "%s", data->gesture_enabled ? "enabled" : "disabled");
- } else {
- NVT_ERR("Does not support touch mode %d\n", value);
- }
- @@ -1149,6 +1147,13 @@ static void nvt_ts_work_func(struct work_struct *work)
- NVT_ERR("CTP_I2C_READ failed.(%d)\n", ret);
- goto XFER_ERROR;
- }
- +/*
- + //--- dump I2C buf ---
- + for (i = 0; i < 10; i++) {
- + 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]);
- + }
- + printk("\n");
- +*/
- #if NVT_TOUCH_ESD_PROTECT
- if (nvt_fw_recovery(point_data)) {
- @@ -1309,13 +1314,13 @@ void nvt_stop_crc_reboot(void)
- for (retry = 5; retry > 0; retry--) {
- /*---write i2c cmds to reset idle : 1st---*/
- - buf[0] = 0x00;
- - buf[1] = 0xA5;
- + buf[0]=0x00;
- + buf[1]=0xA5;
- CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
- /*---write i2c cmds to reset idle : 2rd---*/
- - buf[0] = 0x00;
- - buf[1] = 0xA5;
- + buf[0]=0x00;
- + buf[1]=0xA5;
- CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
- msleep(1);
- @@ -1583,17 +1588,68 @@ static ssize_t nvt_panel_display_show(struct device *dev,
- return snprintf(buf, PAGE_SIZE, "%c\n", ts->lockdown_info[1]);
- }
- +static ssize_t nvt_panel_wake_gesture_show(struct device *dev,
- + struct device_attribute *attr, char *buf)
- +{
- + const char c = ts->gesture_enabled ? '1' : '0';
- + return sprintf(buf, "%c\n", c);
- +}
- +
- +static ssize_t nvt_panel_wake_gesture_store(struct device *dev,
- + struct device_attribute *attr, const char *buf, size_t count)
- +{
- + int i;
- +
- + if (sscanf(buf, "%u", &i) == 1 && i < 2) {
- + ts->gesture_enabled = i;
- + return count;
- + } else {
- + dev_dbg(dev, "enable_dt2w write error\n");
- + return -EINVAL;
- + }
- +}
- +
- static DEVICE_ATTR(panel_vendor, (S_IRUGO), nvt_panel_vendor_show, NULL);
- static DEVICE_ATTR(panel_color, (S_IRUGO), nvt_panel_color_show, NULL);
- static DEVICE_ATTR(panel_display, (S_IRUGO), nvt_panel_display_show, NULL);
- +static DEVICE_ATTR(wake_gesture, S_IWUSR | S_IRUSR,
- + nvt_panel_wake_gesture_show, nvt_panel_wake_gesture_store);
- static struct attribute *nvt_attr_group[] = {
- &dev_attr_panel_vendor.attr,
- &dev_attr_panel_color.attr,
- &dev_attr_panel_display.attr,
- + &dev_attr_wake_gesture.attr,
- NULL,
- };
- +static ssize_t novatek_input_symlink(struct nvt_ts_data *ts) {
- + char *driver_path;
- + int ret = 0;
- + if (ts->input_proc) {
- + proc_remove(ts->input_proc);
- + ts->input_proc = NULL;
- + }
- + driver_path = kzalloc(PATH_MAX, GFP_KERNEL);
- + if (!driver_path) {
- + pr_err("%s: failed to allocate memory\n", __func__);
- + return -ENOMEM;
- + }
- +
- + sprintf(driver_path, "/sys%s",
- + kobject_get_path(&ts->client->dev.kobj, GFP_KERNEL));
- +
- + pr_err("%s: driver_path=%s\n", __func__, driver_path);
- +
- + ts->input_proc = proc_symlink(PROC_SYMLINK_PATH, NULL, driver_path);
- +
- + if (!ts->input_proc) {
- + ret = -ENOMEM;
- + }
- + kfree(driver_path);
- + return ret;
- +}
- +
- /*******************************************************
- Description:
- Novatek touchscreen driver probe function.
- @@ -1617,6 +1673,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
- }
- ts->client = client;
- + ts->input_proc = NULL;
- i2c_set_clientdata(client, ts);
- /*---parse dts---*/
- @@ -1765,7 +1822,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
- NVT_LOG("request irq %d succeed\n", client->irq);
- }
- }
- - update_hardware_info(TYPE_TOUCH, 5);
- +
- ret = nvt_get_lockdown_info(ts->lockdown_info);
- @@ -1775,10 +1832,10 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
- NVT_ERR("Lockdown:0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x\n",
- ts->lockdown_info[0], ts->lockdown_info[1], ts->lockdown_info[2], ts->lockdown_info[3],
- ts->lockdown_info[4], ts->lockdown_info[5], ts->lockdown_info[6], ts->lockdown_info[7]);
- - update_hardware_info(TYPE_TP_MAKER, ts->lockdown_info[0] - 0x30);
- }
- ts->fw_name = nvt_get_config(ts);
- +
- device_init_wakeup(&client->dev, 1);
- ts->dev_pm_suspend = false;
- init_completion(&ts->dev_pm_suspend_completion);
- @@ -1830,7 +1887,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
- #if defined(CONFIG_DRM)
- ts->notifier.notifier_call = drm_notifier_callback;
- ret = drm_register_client(&ts->notifier);
- - if (ret) {
- + if(ret) {
- NVT_ERR("register drm_notifier failed. ret=%d\n", ret);
- goto err_register_drm_notif_failed;
- }
- @@ -1839,7 +1896,7 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
- ts->early_suspend.suspend = nvt_ts_early_suspend;
- ts->early_suspend.resume = nvt_ts_late_resume;
- ret = register_early_suspend(&ts->early_suspend);
- - if (ret) {
- + if(ret) {
- NVT_ERR("register early suspend failed. ret=%d\n", ret);
- goto err_register_early_suspend_failed;
- }
- @@ -1851,6 +1908,11 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i
- NVT_ERR("Cannot create sysfs structure!\n");
- }
- + ret = novatek_input_symlink(ts);
- + if (ret < 0) {
- + NVT_ERR("Failed to symlink input device!\n");
- + }
- +
- ts->event_wq = alloc_workqueue("nvt-event-queue",
- WQ_UNBOUND | WQ_HIGHPRI | WQ_CPU_INTENSIVE, 1);
- if (!ts->event_wq) {
- @@ -2185,6 +2247,13 @@ static void nvt_ts_late_resume(struct early_suspend *h)
- }
- #endif
- +#if 0
- +static const struct dev_pm_ops nvt_ts_dev_pm_ops = {
- + .suspend = nvt_ts_suspend,
- + .resume = nvt_ts_resume,
- +};
- +#endif
- +
- static const struct i2c_device_id nvt_ts_id[] = {
- { NVT_I2C_NAME, 0 },
- { }
- diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx.h b/drivers/input/touchscreen/nt36xxx/nt36xxx.h
- index ddda66983f970..482c1ca1b809c 100644
- --- a/drivers/input/touchscreen/nt36xxx/nt36xxx.h
- +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx.h
- @@ -88,6 +88,7 @@ extern const uint16_t gesture_key_array[];
- #define NVT_TOUCH_ESD_CHECK_PERIOD 1500 /* ms */
- #define NVT_LOCKDOWN_SIZE 8
- +
- struct nvt_config_info {
- u8 tp_vendor;
- u8 tp_color;
- @@ -157,6 +158,8 @@ struct nvt_ts_data {
- struct work_struct resume_work;
- struct workqueue_struct *event_wq;
- struct completion dev_pm_suspend_completion;
- +
- + struct proc_dir_entry *input_proc;
- };
- struct nvt_mode_switch {
- diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c b/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c
- index eaa9a173f67e7..52515c7c1ef04 100644
- --- a/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c
- +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx_ext_proc.c
- @@ -57,17 +57,17 @@ static struct proc_dir_entry *NVT_proc_xiaomi_config_info_entry;
- static struct proc_dir_entry *NVT_proc_xiaomi_lockdown_info_entry;
- /* Xiaomi Config Info. */
- -static uint8_t nvt_xiaomi_conf_info_fw_ver;
- -static uint8_t nvt_xiaomi_conf_info_fae_id;
- -static uint64_t nvt_xiaomi_conf_info_reservation;
- +static uint8_t nvt_xiaomi_conf_info_fw_ver = 0;
- +static uint8_t nvt_xiaomi_conf_info_fae_id = 0;
- +static uint64_t nvt_xiaomi_conf_info_reservation = 0;
- /* Xiaomi Lockdown Info */
- -static uint8_t tp_maker_cg_lamination;
- -static uint8_t display_maker;
- -static uint8_t cg_ink_color;
- -static uint8_t hw_version;
- -static uint16_t project_id;
- -static uint8_t cg_maker;
- -static uint8_t reservation_byte;
- +static uint8_t tp_maker_cg_lamination = 0;
- +static uint8_t display_maker = 0;
- +static uint8_t cg_ink_color = 0;
- +static uint8_t hw_version = 0;
- +static uint16_t project_id = 0;
- +static uint8_t cg_maker = 0;
- +static uint8_t reservation_byte = 0;
- /*******************************************************
- Description:
- @@ -108,7 +108,7 @@ void nvt_change_mode(uint8_t mode)
- *******************************************************/
- uint8_t nvt_get_fw_pipe(void)
- {
- - uint8_t buf[8] = {0};
- + uint8_t buf[8]= {0};
- /*---set xdata index to EVENT BUF ADDR---*/
- buf[0] = 0xFF;
- @@ -909,7 +909,7 @@ int32_t nvt_get_lockdown_info(char *lockdata)
- *******************************************************/
- int32_t nvt_extra_proc_init(void)
- {
- - NVT_proc_fw_version_entry = proc_create(NVT_FW_VERSION, 0444, NULL, &nvt_fw_version_fops);
- + NVT_proc_fw_version_entry = proc_create(NVT_FW_VERSION, 0444, NULL,&nvt_fw_version_fops);
- if (NVT_proc_fw_version_entry == NULL) {
- NVT_ERR("create proc/nvt_fw_version Failed!\n");
- return -ENOMEM;
- @@ -917,7 +917,7 @@ int32_t nvt_extra_proc_init(void)
- NVT_LOG("create proc/nvt_fw_version Succeeded!\n");
- }
- - NVT_proc_baseline_entry = proc_create(NVT_BASELINE, 0444, NULL, &nvt_baseline_fops);
- + NVT_proc_baseline_entry = proc_create(NVT_BASELINE, 0444, NULL,&nvt_baseline_fops);
- if (NVT_proc_baseline_entry == NULL) {
- NVT_ERR("create proc/nvt_baseline Failed!\n");
- return -ENOMEM;
- @@ -925,7 +925,7 @@ int32_t nvt_extra_proc_init(void)
- NVT_LOG("create proc/nvt_baseline Succeeded!\n");
- }
- - NVT_proc_raw_entry = proc_create(NVT_RAW, 0444, NULL, &nvt_raw_fops);
- + NVT_proc_raw_entry = proc_create(NVT_RAW, 0444, NULL,&nvt_raw_fops);
- if (NVT_proc_raw_entry == NULL) {
- NVT_ERR("create proc/nvt_raw Failed!\n");
- return -ENOMEM;
- @@ -933,7 +933,7 @@ int32_t nvt_extra_proc_init(void)
- NVT_LOG("create proc/nvt_raw Succeeded!\n");
- }
- - NVT_proc_diff_entry = proc_create(NVT_DIFF, 0444, NULL, &nvt_diff_fops);
- + NVT_proc_diff_entry = proc_create(NVT_DIFF, 0444, NULL,&nvt_diff_fops);
- if (NVT_proc_diff_entry == NULL) {
- NVT_ERR("create proc/nvt_diff Failed!\n");
- return -ENOMEM;
- diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c b/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c
- index 811f28ac8bae6..649ca711d0da1 100644
- --- a/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c
- +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx_fw_update.c
- @@ -46,7 +46,7 @@ int32_t update_firmware_request(char *filename)
- int32_t ret = 0;
- if (NULL == filename) {
- - return -EPERM;
- + return -1;
- }
- NVT_LOG("filename is %s\n", filename);
- @@ -85,7 +85,7 @@ void update_firmware_release(void)
- if (fw_entry) {
- release_firmware(fw_entry);
- }
- - fw_entry = NULL;
- + fw_entry=NULL;
- }
- /*******************************************************
- @@ -178,7 +178,7 @@ int32_t Resume_PD(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Resume Command) error!! status=0x%02X\n", buf[1]);
- - return -EPERM;
- + return -1;
- }
- }
- msleep(10);
- @@ -256,7 +256,7 @@ int32_t Check_CheckSum(void)
- retry++;
- if (unlikely(retry > 5)) {
- NVT_ERR("Check 0xAA (Fast Read Command) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
- - return -EPERM;
- + return -1;
- }
- }
- /* Read Checksum (write addr high byte & middle byte) */
- @@ -336,7 +336,7 @@ int32_t Init_BootLoader(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Inittial Flash Block) error!! status=0x%02X\n", buf[1]);
- - return -EPERM;
- + return -1;
- }
- }
- @@ -388,7 +388,7 @@ int32_t Erase_Flash(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Write Enable for Write Status Register) error!! status=0x%02X\n", buf[1]);
- - return -EPERM;
- + return -1;
- }
- }
- @@ -418,7 +418,7 @@ int32_t Erase_Flash(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Write Status Register) error!! status=0x%02X\n", buf[1]);
- - return -EPERM;
- + return -1;
- }
- }
- @@ -449,7 +449,7 @@ int32_t Erase_Flash(void)
- retry++;
- if (unlikely(retry > 100)) {
- 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);
- - return -EPERM;
- + return -1;
- }
- }
- @@ -458,7 +458,7 @@ int32_t Erase_Flash(void)
- else
- count = fw_entry->size / FLASH_SECTOR_SIZE;
- - for (i = 0; i < count; i++) {
- + for(i = 0; i < count; i++) {
- /* Write Enable */
- buf[0] = 0x00;
- buf[1] = 0x06;
- @@ -484,7 +484,7 @@ int32_t Erase_Flash(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Write Enable) error!! status=0x%02X\n", buf[1]);
- - return -EPERM;
- + return -1;
- }
- }
- @@ -518,7 +518,7 @@ int32_t Erase_Flash(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Sector Erase) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
- - return -EPERM;
- + return -1;
- }
- }
- @@ -549,7 +549,7 @@ int32_t Erase_Flash(void)
- retry++;
- if (unlikely(retry > 100)) {
- NVT_ERR("Check 0xAA (Read Status) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
- - return -EPERM;
- + return -1;
- }
- }
- }
- @@ -619,7 +619,7 @@ int32_t Write_Flash(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Write Enable) error!! status=0x%02X\n", buf[1]);
- - return -EPERM;
- + return -1;
- }
- }
- @@ -636,11 +636,11 @@ int32_t Write_Flash(void)
- }
- }
- if (fw_entry->size - Flash_Address >= 256)
- - tmpvalue = (Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (255);
- + tmpvalue=(Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (255);
- else
- - tmpvalue = (Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (fw_entry->size - Flash_Address - 1);
- + tmpvalue=(Flash_Address >> 16) + ((Flash_Address >> 8) & 0xFF) + (Flash_Address & 0xFF) + 0x00 + (fw_entry->size - Flash_Address - 1);
- - for (k = 0; k < min(fw_entry->size - Flash_Address,(size_t)256); k++)
- + for (k = 0;k < min(fw_entry->size - Flash_Address,(size_t)256); k++)
- tmpvalue += fw_entry->data[Flash_Address + k];
- tmpvalue = 255 - tmpvalue + 1;
- @@ -676,7 +676,7 @@ int32_t Write_Flash(void)
- retry++;
- if (unlikely(retry > 20)) {
- NVT_ERR("Check 0xAA (Page Program) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
- - return -EPERM;
- + return -1;
- }
- }
- if (buf[1] == 0xEA) {
- @@ -711,7 +711,7 @@ int32_t Write_Flash(void)
- retry++;
- if (unlikely(retry > 100)) {
- NVT_ERR("Check 0xAA (Read Status) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
- - return -EPERM;
- + return -1;
- }
- }
- if (buf[1] == 0xEA) {
- @@ -790,7 +790,7 @@ int32_t Verify_Flash(void)
- retry++;
- if (unlikely(retry > 5)) {
- NVT_ERR("Check 0xAA (Fast Read Command) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
- - return -EPERM;
- + return -1;
- }
- }
- /* Read Checksum (write addr high byte & middle byte) */
- @@ -816,7 +816,7 @@ int32_t Verify_Flash(void)
- if (WR_Filechksum[i] != RD_Filechksum[i]) {
- NVT_ERR("Verify Fail%d!!\n", i);
- NVT_ERR("RD_Filechksum[%d]=0x%04X, WR_Filechksum[%d]=0x%04X\n", i, RD_Filechksum[i], i, WR_Filechksum[i]);
- - return -EPERM;
- + return -1;
- }
- }
- }
- @@ -938,7 +938,7 @@ int32_t nvt_check_flash_end_flag(void)
- }
- if (buf[1] != 0xAA) {
- NVT_ERR("Check 0xAA (Read Command) error!! status=0x%02X\n", buf[1]);
- - return -EPERM;
- + return -1;
- }
- msleep(10);
- diff --git a/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c b/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c
- index 1c3d7c87527c5..3c16f4bd18838 100644
- --- a/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c
- +++ b/drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c
- @@ -47,44 +47,44 @@
- printk(fmt, ##args); \
- } while (0)
- -static uint8_t *RecordResult_Short;
- -static uint8_t *RecordResult_Short_Diff;
- -static uint8_t *RecordResult_Short_Base;
- -static uint8_t *RecordResult_Open;
- -static uint8_t *RecordResult_FWMutual;
- -static uint8_t *RecordResult_FW_CC;
- -static uint8_t *RecordResult_FW_CC_I;
- -static uint8_t *RecordResult_FW_CC_Q;
- -static uint8_t *RecordResult_FW_DiffMax;
- -static uint8_t *RecordResult_FW_DiffMin;
- -
- -static int32_t TestResult_Short;
- -static int32_t TestResult_Short_Diff;
- -static int32_t TestResult_Short_Base;
- -static int32_t TestResult_Open;
- -static int32_t TestResult_FW_Rawdata;
- -static int32_t TestResult_FWMutual;
- -static int32_t TestResult_FW_CC;
- -static int32_t TestResult_FW_CC_I;
- -static int32_t TestResult_FW_CC_Q;
- -static int32_t TestResult_Noise;
- -static int32_t TestResult_FW_DiffMax;
- -static int32_t TestResult_FW_DiffMin;
- -
- -static int32_t *RawData_Short;
- -static int32_t *RawData_Short_Diff;
- -static int32_t *RawData_Short_Base;
- -static int32_t *RawData_Open;
- -static int32_t *RawData_Diff;
- -static int32_t *RawData_Diff_Min;
- -static int32_t *RawData_Diff_Max;
- -static int32_t *RawData_FWMutual;
- -static int32_t *RawData_FW_CC;
- -static int32_t *RawData_FW_CC_I;
- -static int32_t *RawData_FW_CC_Q;
- -
- -static struct proc_dir_entry *NVT_proc_selftest_entry;
- -static int8_t nvt_mp_test_result_printed;
- +static uint8_t *RecordResult_Short = NULL;
- +static uint8_t *RecordResult_Short_Diff = NULL;
- +static uint8_t *RecordResult_Short_Base = NULL;
- +static uint8_t *RecordResult_Open = NULL;
- +static uint8_t *RecordResult_FWMutual = NULL;
- +static uint8_t *RecordResult_FW_CC = NULL;
- +static uint8_t *RecordResult_FW_CC_I = NULL;
- +static uint8_t *RecordResult_FW_CC_Q = NULL;
- +static uint8_t *RecordResult_FW_DiffMax = NULL;
- +static uint8_t *RecordResult_FW_DiffMin = NULL;
- +
- +static int32_t TestResult_Short = 0;
- +static int32_t TestResult_Short_Diff = 0;
- +static int32_t TestResult_Short_Base = 0;
- +static int32_t TestResult_Open = 0;
- +static int32_t TestResult_FW_Rawdata = 0;
- +static int32_t TestResult_FWMutual = 0;
- +static int32_t TestResult_FW_CC = 0;
- +static int32_t TestResult_FW_CC_I = 0;
- +static int32_t TestResult_FW_CC_Q = 0;
- +static int32_t TestResult_Noise = 0;
- +static int32_t TestResult_FW_DiffMax = 0;
- +static int32_t TestResult_FW_DiffMin = 0;
- +
- +static int32_t *RawData_Short = NULL;
- +static int32_t *RawData_Short_Diff = NULL;
- +static int32_t *RawData_Short_Base = NULL;
- +static int32_t *RawData_Open = NULL;
- +static int32_t *RawData_Diff = NULL;
- +static int32_t *RawData_Diff_Min = NULL;
- +static int32_t *RawData_Diff_Max = NULL;
- +static int32_t *RawData_FWMutual = NULL;
- +static int32_t *RawData_FW_CC = NULL;
- +static int32_t *RawData_FW_CC_I = NULL;
- +static int32_t *RawData_FW_CC_Q = NULL;
- +
- +static struct proc_dir_entry *NVT_proc_selftest_entry = NULL;
- +static int8_t nvt_mp_test_result_printed = 0;
- extern void nvt_change_mode(uint8_t mode);
- extern uint8_t nvt_get_fw_pipe(void);
- @@ -242,7 +242,7 @@ static void nvt_print_lmt_array(int32_t *array, int32_t x_ch, int32_t y_ch)
- for (j = 0; j < y_ch; j++) {
- ret = 0;
- - for (i = 0; i < x_ch; i++) {
- + for(i = 0; i < x_ch; i++) {
- ret += snprintf(buf + ret, 8, "%5d, ", array[j * x_ch + i]);
- }
- buf[ret] = '\0';
- @@ -372,7 +372,7 @@ static int32_t nvt_polling_hand_shake_status(void)
- CTP_I2C_READ(ts->client, I2C_FW_Address, buf, 6);
- 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]);
- - return -EPERM;
- + return -1;
- } else {
- return 0;
- }
- @@ -995,10 +995,10 @@ static int32_t RawDataTest_SinglePoint_Sub(int32_t rawdata[], uint8_t RecordResu
- RecordResult[iArrayIndex] = 0x00; /* default value for PASS */
- - if (rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
- + if(rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
- RecordResult[iArrayIndex] |= 0x01;
- - if (rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
- + if(rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
- RecordResult[iArrayIndex] |= 0x02;
- }
- }
- @@ -1008,10 +1008,10 @@ static int32_t RawDataTest_SinglePoint_Sub(int32_t rawdata[], uint8_t RecordResu
- RecordResult[iArrayIndex] = 0x00; /* default value for PASS */
- - if (rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
- + if(rawdata[iArrayIndex] > Rawdata_Limit_Postive[iArrayIndex])
- RecordResult[iArrayIndex] |= 0x01;
- - if (rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
- + if(rawdata[iArrayIndex] < Rawdata_Limit_Negative[iArrayIndex])
- RecordResult[iArrayIndex] |= 0x02;
- }
- #endif /* #if TOUCH_KEY_NUM > 0 */
- @@ -1036,7 +1036,7 @@ static int32_t RawDataTest_SinglePoint_Sub(int32_t rawdata[], uint8_t RecordResu
- #endif /* #if TOUCH_KEY_NUM > 0 */
- if (isPass == false) {
- - return -EPERM; /* FAIL */
- + return -1; /* FAIL */
- } else {
- return 0; /* PASS */
- }
- @@ -1281,7 +1281,7 @@ static int32_t nvt_selftest_open(struct inode *inode, struct file *file)
- }
- /* Parsing criteria from dts */
- - if (of_property_read_bool(np, "novatek,mp-support-dt")) {
- + if(of_property_read_bool(np, "novatek,mp-support-dt")) {
- /*
- * Parsing Criteria by Novatek PID
- * The string rule is "novatek-mp-criteria-<nvt_pid>"
- @@ -1898,11 +1898,11 @@ int32_t nvt_mp_proc_init(void)
- NVT_proc_selftest_entry = proc_create("nvt_selftest", 0444, NULL, &nvt_selftest_fops);
- if (NVT_proc_selftest_entry == NULL) {
- NVT_ERR("create /proc/nvt_selftest Failed!\n");
- - return -EPERM;
- + return -1;
- } else {
- - if (nvt_mp_buffer_init()) {
- + if(nvt_mp_buffer_init()) {
- NVT_ERR("Allocate mp memory failed\n");
- - return -EPERM;
- + return -1;
- }
- else {
- NVT_LOG("create /proc/nvt_selftest Succeeded!\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement