From 2f7c68cb55ecb7331f2381deb497c27155f32faf Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 03 Jan 2024 09:43:39 +0000
Subject: [PATCH] update kernel to 5.10.198

---
 kernel/drivers/input/touchscreen/gt9xx/gt9xx_update.c |  195 +++++++++++++++++++++++++-----------------------
 1 files changed, 102 insertions(+), 93 deletions(-)

diff --git a/kernel/drivers/input/touchscreen/gt9xx/gt9xx_update.c b/kernel/drivers/input/touchscreen/gt9xx/gt9xx_update.c
index 8affe60..5590f43 100644
--- a/kernel/drivers/input/touchscreen/gt9xx/gt9xx_update.c
+++ b/kernel/drivers/input/touchscreen/gt9xx/gt9xx_update.c
@@ -26,7 +26,7 @@
  *          3. add update file cal checksum.
  *                          By Andrew, 2012/12/12
  *      V1.6: 
- *          1. replace guitar_client with i2c_connect_client;
+ *          1. replace guitar_client with gtp_i2c_connect_client;
  *          2. support firmware header array update.
  *                          By Meta, 2013/03/11
  *      V2.2:
@@ -106,21 +106,21 @@
     u32 fw_burned_len;
 }st_update_msg;
 
-st_update_msg update_msg;
-u16 show_len;
-u16 total_len;
-u8 got_file_flag = 0;  
-u8 searching_file = 0;
+static st_update_msg update_msg;
+static u16 show_len;
+static u16 total_len;
+//static u8 got_file_flag = 0;  
+static u8 searching_file = 0;
 
-extern u8 config[GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH];
-extern void gtp_reset_guitar(struct i2c_client *client, s32 ms);
-extern s32  gtp_send_cfg(struct i2c_client *client);
-extern s32 gtp_read_version(struct i2c_client *, u16* );
-extern struct i2c_client * i2c_connect_client;
-extern void gtp_irq_enable(struct goodix_ts_data *ts);
-extern void gtp_irq_disable(struct goodix_ts_data *ts);
-extern s32 gtp_i2c_read_dbl_check(struct i2c_client *, u16, u8 *, int);
-static u8 gup_burn_fw_gwake_section(struct i2c_client *client, u8 *fw_section, u16 start_addr, u32 len, u8 bank_cmd );
+//extern u8 config[GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH];
+//extern void gtp_reset_guitar(struct i2c_client *client, s32 ms);
+//extern s32  gtp_send_cfg(struct i2c_client *client);
+//extern s32 gtp_read_version(struct i2c_client *, u16* );
+//extern struct i2c_client * gtp_i2c_connect_client;
+//extern void gtp_irq_enable(struct goodix_ts_data *ts);
+//extern void gtp_irq_disable(struct goodix_ts_data *ts);
+//extern s32 gtp_i2c_read_dbl_check(struct i2c_client *, u16, u8 *, int);
+//static u8 gup_burn_fw_gwake_section(struct i2c_client *client, u8 *fw_section, u16 start_addr, u32 len, u8 bank_cmd );
 
 #define _CLOSE_FILE(p_file) if (p_file && !IS_ERR(p_file)) \
                             { \
@@ -132,7 +132,7 @@
 #endif
 
 #if GTP_COMPATIBLE_MODE
-s32 gup_fw_download_proc(void *dir, u8 dwn_mode);
+s32 gtp_gup_fw_download_proc(void *dir, u8 dwn_mode);
 #endif
 /*******************************************************
 Function:
@@ -146,7 +146,7 @@
     numbers of i2c_msgs to transfer: 
       2: succeed, otherwise: failed
 *********************************************************/
-s32 gup_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
+static s32 gup_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
 {
     struct i2c_msg msgs[2];
     s32 ret=-1;
@@ -192,7 +192,7 @@
     numbers of i2c_msgs to transfer: 
         1: succeed, otherwise: failed
 *********************************************************/
-s32 gup_i2c_write(struct i2c_client *client,u8 *buf,s32 len)
+static s32 gup_i2c_write(struct i2c_client *client,u8 *buf,s32 len)
 {
     struct i2c_msg msg;
     s32 ret=-1;
@@ -218,6 +218,7 @@
     return ret;
 }
 
+#if 0
 static s32 gup_init_panel(struct goodix_ts_data *ts)
 {
     s32 ret = 0;
@@ -329,6 +330,7 @@
     msleep(10);
     return 0;
 }
+#endif
 
 
 static u8 gup_get_ic_msg(struct i2c_client *client, u16 addr, u8* msg, s32 len)
@@ -381,6 +383,7 @@
     return SUCCESS;
 }
 
+#if 0
 static u8 gup_get_ic_fw_msg(struct i2c_client *client)
 {
     s32 ret = -1;
@@ -462,7 +465,7 @@
     return SUCCESS;
 }
 
-s32 gup_enter_update_mode(struct i2c_client *client)
+static s32 gup_enter_update_mode(struct i2c_client *client)
 {
     s32 ret = -1;
     s32 retry = 0;
@@ -519,14 +522,14 @@
     return ret;
 }
 
-void gup_leave_update_mode(struct goodix_ts_data *ts)
+static void gup_leave_update_mode(struct goodix_ts_data *ts)
 {
     gpio_direction_input(ts->irq_pin);
     //s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE);
     //s3c_gpio_cfgpin(pin, GTP_INT_CFG);
     
     GTP_DEBUG("[leave_update_mode]reset chip.");
-    gtp_reset_guitar(i2c_connect_client, 20);
+    gtp_reset_guitar(gtp_i2c_connect_client, 20);
 }
 
 // Get the correct nvram data
@@ -646,6 +649,7 @@
 
     return FAIL;
 }
+#endif
 
 
 
@@ -869,6 +873,7 @@
 #endif
 
 
+#if 0
 static u8 gup_check_update_file(struct i2c_client *client, st_fw_head* fw_head, u8* path)
 {
     s32 ret = 0;
@@ -924,7 +929,7 @@
         gup_search_file(AUTO_SEARCH_BIN | AUTO_SEARCH_CFG);
         if (got_file_flag & CFG_FILE_READY)
         {
-            ret = gup_update_config(i2c_connect_client);
+            ret = gup_update_config(gtp_i2c_connect_client);
             if(ret <= 0)
             {
                 GTP_ERROR("Update config failed.");
@@ -2271,7 +2276,7 @@
     }
     return FAIL;
 }
-s32 gup_update_proc(void *dir)
+static s32 gup_update_proc(void *dir)
 {
     s32 ret = 0;
     s32 update_ret = FAIL;
@@ -2281,7 +2286,7 @@
     
     GTP_DEBUG("[update_proc]Begin update ......");
     
-    ts = i2c_get_clientdata(i2c_connect_client);
+    ts = i2c_get_clientdata(gtp_i2c_connect_client);
     
 #if GTP_AUTO_UPDATE
     if (searching_file)
@@ -2302,19 +2307,19 @@
 #if GTP_COMPATIBLE_MODE
     if (CHIP_TYPE_GT9F == ts->chip_type)
     {
-        return gup_fw_download_proc(dir, GTP_FL_FW_BURN);
+        return gtp_gup_fw_download_proc(dir, GTP_FL_FW_BURN);
     }
 #endif
 
     update_msg.file = NULL;
-    ret = gup_check_update_file(i2c_connect_client, &fw_head, (u8*)dir);     //20121211
+    ret = gup_check_update_file(gtp_i2c_connect_client, &fw_head, (u8*)dir);     //20121211
     if(FAIL == ret)
     {
         GTP_ERROR("[update_proc]check update file fail.");
         goto file_fail;
     }
     
-    ret = gup_get_ic_fw_msg(i2c_connect_client);
+    ret = gup_get_ic_fw_msg(gtp_i2c_connect_client);
     if(FAIL == ret)
     {
         GTP_ERROR("[update_proc]get ic message fail.");
@@ -2333,7 +2338,7 @@
 #if GTP_ESD_PROTECT
     gtp_esd_switch(ts->client, SWITCH_OFF);
 #endif
-    ret = gup_enter_update_mode(i2c_connect_client);
+    ret = gup_enter_update_mode(gtp_i2c_connect_client);
     if(FAIL == ret)
     {
          GTP_ERROR("[update_proc]enter update mode fail.");
@@ -2345,7 +2350,7 @@
         show_len = 10;
         total_len = 100;
         update_msg.fw_burned_len = 0;
-        ret = gup_burn_dsp_isp(i2c_connect_client);
+        ret = gup_burn_dsp_isp(gtp_i2c_connect_client);
         if(FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn dsp isp fail.");
@@ -2353,7 +2358,7 @@
         }
         
         show_len = 20;
-        ret = gup_burn_fw_ss51(i2c_connect_client);
+        ret = gup_burn_fw_ss51(gtp_i2c_connect_client);
         if(FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn ss51 firmware fail.");
@@ -2361,7 +2366,7 @@
         }
         
         show_len = 30;
-        ret = gup_burn_fw_dsp(i2c_connect_client);
+        ret = gup_burn_fw_dsp(gtp_i2c_connect_client);
         if(FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn dsp firmware fail.");
@@ -2369,7 +2374,7 @@
         }
         
         show_len = 40;
-        ret = gup_burn_fw_boot(i2c_connect_client);
+        ret = gup_burn_fw_boot(gtp_i2c_connect_client);
         if(FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn bootloader firmware fail.");
@@ -2377,7 +2382,7 @@
         }
         show_len = 50;
         
-        ret = gup_burn_fw_boot_isp(i2c_connect_client);
+        ret = gup_burn_fw_boot_isp(gtp_i2c_connect_client);
         if (FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn boot_isp firmware fail.");
@@ -2385,7 +2390,7 @@
         }
         
         show_len = 60;
-        ret = gup_burn_fw_link(i2c_connect_client);
+        ret = gup_burn_fw_link(gtp_i2c_connect_client);
         if (FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn link firmware fail.");
@@ -2393,7 +2398,7 @@
         }
         
         show_len = 70;
-        ret = gup_burn_fw_gwake(i2c_connect_client);
+        ret = gup_burn_fw_gwake(gtp_i2c_connect_client);
         if (FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn app_code firmware fail.");
@@ -2401,7 +2406,7 @@
         }       
         show_len = 80;
         
-        ret = gup_burn_fw_finish(i2c_connect_client);
+        ret = gup_burn_fw_finish(gtp_i2c_connect_client);
         if (FAIL == ret)
         {
             GTP_ERROR("[update_proc]burn finish fail.");
@@ -2439,7 +2444,7 @@
         else
         {
             GTP_DEBUG("[update_proc]send config.");
-            ret = gtp_send_cfg(i2c_connect_client);
+            ret = gtp_send_cfg(gtp_i2c_connect_client);
             if (ret < 0)
             {
                 GTP_ERROR("[update_proc]send config fail.");
@@ -2472,7 +2477,7 @@
         gup_search_file(AUTO_SEARCH_CFG);
         if (got_file_flag & CFG_FILE_READY)
         {
-            ret = gup_update_config(i2c_connect_client);
+            ret = gup_update_config(gtp_i2c_connect_client);
             if(ret <= 0)
             {
                 GTP_ERROR("Update config failed.");
@@ -2495,6 +2500,7 @@
         return FAIL;
     }
 }
+#endif
 
 #if GTP_AUTO_UPDATE
 u8 gup_init_update_proc(struct goodix_ts_data *ts)
@@ -2570,16 +2576,16 @@
 
 #if GTP_COMPATIBLE_MODE
 
-u8 i2c_opr_buf[GTP_ADDR_LENGTH + FL_PACK_SIZE] = {0};
-u8 chk_cmp_buf[FL_PACK_SIZE] = {0};
+static u8 i2c_opr_buf[GTP_ADDR_LENGTH + FL_PACK_SIZE] = {0};
+static u8 chk_cmp_buf[FL_PACK_SIZE] = {0};
 
-extern s32 gtp_fw_startup(struct i2c_client *client);
+//extern s32 gtp_fw_startup(struct i2c_client *client);
 static u8 gup_download_fw_dsp(struct i2c_client *client, u8 dwn_mode);
 static s32 gup_burn_fw_proc(struct i2c_client *client, u16 start_addr, s32 start_index, s32 burn_len);
 static s32 gup_check_and_repair(struct i2c_client *client, u16 start_addr, s32 start_index, s32 chk_len);
 
 
-u8 gup_check_fs_mounted(char *path_name)
+u8 gtp_gup_check_fs_mounted(char *path_name)
 {
     struct path root_path;
     struct path path;
@@ -2617,7 +2623,7 @@
 #endif
 }
 
-s32 i2c_write_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
+s32 gtp_i2c_write_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
 {
     s32 ret = 0;
     s32 write_bytes = 0;
@@ -2658,7 +2664,7 @@
     return 1;
 }
 
-s32 i2c_read_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
+s32 gtp_i2c_read_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
 {
     s32 ret = 0;
     s32 read_bytes = 0;
@@ -2705,11 +2711,11 @@
 static void gup_bit_write(s32 addr, s32 bit, s32 val)
 {
     u8 buf;
-    i2c_read_bytes(i2c_connect_client, addr, &buf, 1);
+    gtp_i2c_read_bytes(gtp_i2c_connect_client, addr, &buf, 1);
 
     buf = (buf & (~((u8)1 << bit))) | ((u8)val << bit);
 
-    i2c_write_bytes(i2c_connect_client, addr, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, addr, &buf, 1);
 }
 
 static void gup_clk_count_init(s32 bCh, s32 bCNT)
@@ -2722,13 +2728,13 @@
     gup_bit_write(_fRW_MISCTL__MEA, 1, 1);
     //_bRW_MISCTL__MEA_MODE = 0; //Pulse mode
     buf = 0;
-    i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__MEA_MODE, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__MEA_MODE, &buf, 1);
     //_bRW_MISCTL__MEA_SRCSEL = 8 + bCh; //From GIO1
     buf = 8 + bCh;
-    i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__MEA_SRCSEL, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__MEA_SRCSEL, &buf, 1);
     //_wRW_MISCTL__MEA_MAX_NUM = bCNT; //Set the Measure Counts = 1
     buf = bCNT;
-    i2c_write_bytes(i2c_connect_client, _wRW_MISCTL__MEA_MAX_NUM, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _wRW_MISCTL__MEA_MAX_NUM, &buf, 1);
     //_fRW_MISCTL__MEA_CLR = 0; //Frequency measure not clear
     gup_bit_write(_fRW_MISCTL__MEA, 1, 0);
     //_fRW_MISCTL__MEA_EN = 1;
@@ -2743,7 +2749,7 @@
 
     while (ready == 0) //Wait for measurement complete
     {
-        i2c_read_bytes(i2c_connect_client, _bRO_MISCTL__MEA_RDY, buf, 1);
+        gtp_i2c_read_bytes(gtp_i2c_connect_client, _bRO_MISCTL__MEA_RDY, buf, 1);
         ready = buf[0];
     }
 
@@ -2751,7 +2757,7 @@
 
     //_fRW_MISCTL__MEA_EN = 0;
     gup_bit_write(_fRW_MISCTL__MEA, 0, 0);
-    i2c_read_bytes(i2c_connect_client, _dRO_MISCTL__MEA_VAL, buf, 4);
+    gtp_i2c_read_bytes(gtp_i2c_connect_client, _dRO_MISCTL__MEA_VAL, buf, 4);
     GTP_DEBUG("Clk_count 0: %2X", buf[0]);
     GTP_DEBUG("Clk_count 1: %2X", buf[1]);
     GTP_DEBUG("Clk_count 2: %2X", buf[2]);
@@ -2761,23 +2767,23 @@
     GTP_INFO("Clk_count : %d", temp);
     return temp;
 }
-u8 gup_clk_dac_setting(int dac)
+static u8 gup_clk_dac_setting(int dac)
 {
     s8 buf1, buf2;
     
-    i2c_read_bytes(i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
-    i2c_read_bytes(i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
+    gtp_i2c_read_bytes(gtp_i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
+    gtp_i2c_read_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
 
     buf1 = (buf1 & 0xFFCF) | ((dac & 0x03) << 4);
     buf2 = (dac >> 2) & 0x3f;
 
-    i2c_write_bytes(i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
-    i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
     
     return 0;
 }
 
-static u8 gup_clk_calibration_pin_select(s32 bCh)
+static u8 gtp_gup_clk_calibration_pin_select(s32 bCh)
 {
     s32 i2c_addr;
 
@@ -2822,6 +2828,9 @@
         case 9:
             i2c_addr = _fRW_MISCTL__GIO9;
             break;
+
+        default:
+            return -1;
     }
 
     gup_bit_write(i2c_addr, 1, 0);
@@ -2829,12 +2838,12 @@
     return 0;
 }
 
-void gup_output_pulse(int t)
+static void gup_output_pulse(int t)
 {
 	unsigned long flags;
 	struct goodix_ts_data *ts;
 
-	ts = i2c_get_clientdata(i2c_connect_client);
+	ts = i2c_get_clientdata(gtp_i2c_connect_client);
 
 	GTP_GPIO_OUTPUT(ts->irq_pin, 0);
 	msleep(10);
@@ -2861,13 +2870,13 @@
     gup_bit_write(_rRW_MISCTL__ANA_RXADC_B0_, 5, 0);
     //_bRW_MISCTL__RG_LDO_A18_PWD = 0; //DrvMISCTL_A18_PowerON
     buf = 0;
-    i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_LDO_A18_PWD, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_LDO_A18_PWD, &buf, 1);
     //_bRW_MISCTL__RG_BG_PWD = 0; //DrvMISCTL_BG_PowerON
     buf = 0;
-    i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_BG_PWD, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_BG_PWD, &buf, 1);
     //_bRW_MISCTL__RG_CLKGEN_PWD = 0; //DrvMISCTL_CLKGEN_PowerON
     buf = 0;
-    i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_CLKGEN_PWD, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_CLKGEN_PWD, &buf, 1);
     //_fRW_MISCTL__RG_RXADC_PWD = 0; //DrvMISCTL_RX_ADC_PowerON
     gup_bit_write(_rRW_MISCTL__ANA_RXADC_B0_, 0, 0);
     //_fRW_MISCTL__RG_RXADC_REF_PWD = 0; //DrvMISCTL_RX_ADCREF_PowerON
@@ -2875,26 +2884,26 @@
     //gup_clk_dac_setting(60);
     //_bRW_MISCTL__OSC_CK_SEL = 1;;
     buf = 1;
-    i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__OSC_CK_SEL, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__OSC_CK_SEL, &buf, 1);
 }
 
-s32 gup_clk_calibration(void)
+s32 gtp_gup_clk_calibration(void)
 {
     u8 buf;
     //u8 trigger;
     s32 i;
-    struct timeval start, end;
+    //struct timeval start, end;
     s32 count;
-    s32 count_ref;
-    s32 sec;
-    s32 usec;
+    //s32 count_ref;
+    //s32 sec;
+    //s32 usec;
     //unsigned long flags;
     struct goodix_ts_data *ts;
 
-	ts = i2c_get_clientdata(i2c_connect_client);
+	ts = i2c_get_clientdata(gtp_i2c_connect_client);
 
     buf = 0x0C; // hold ss51 and dsp
-    i2c_write_bytes(i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
 
     //_fRW_MISCTL__CLK_BIAS = 0; //disable clock bias
     gup_bit_write(_rRW_MISCTL_RG_DMY83, 7, 0);
@@ -2906,12 +2915,12 @@
     gup_bit_write(_rRW_MISCTL__GIO1CTL_B1_, 1, 0);
 
     //buf = 0x00;
-    //i2c_write_bytes(i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
+    //gtp_i2c_write_bytes(gtp_i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
     //msleep(1000);
 
     GTP_INFO("CLK calibration GO");
     gup_sys_clk_init();
-    gup_clk_calibration_pin_select(1);//use GIO1 to do the calibration
+    gtp_gup_clk_calibration_pin_select(1);//use GIO1 to do the calibration
 
 	GTP_GPIO_OUTPUT(ts->irq_pin, 0);
  
@@ -2928,7 +2937,7 @@
         gup_clk_dac_setting(i);
         gup_clk_count_init(1, CLK_AVG_TIME);
 
-    #if 0
+    #if 1
         gup_output_pulse(PULSE_LENGTH);
         count = gup_clk_count_get();
   
@@ -2975,24 +2984,24 @@
 
     //clk_dac = i;
 
-    gtp_reset_guitar(i2c_connect_client, 20);
+    gtp_reset_guitar(gtp_i2c_connect_client, 20);
 
 #if 0//for debug
     //-- ouput clk to GPIO 4
     buf = 0x00;
-    i2c_write_bytes(i2c_connect_client, 0x41FA, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x41FA, &buf, 1);
     buf = 0x00;
-    i2c_write_bytes(i2c_connect_client, 0x4104, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4104, &buf, 1);
     buf = 0x00;
-    i2c_write_bytes(i2c_connect_client, 0x4105, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4105, &buf, 1);
     buf = 0x00;
-    i2c_write_bytes(i2c_connect_client, 0x4106, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4106, &buf, 1);
     buf = 0x01;
-    i2c_write_bytes(i2c_connect_client, 0x4107, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4107, &buf, 1);
     buf = 0x06;
-    i2c_write_bytes(i2c_connect_client, 0x41F8, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x41F8, &buf, 1);
     buf = 0x02;
-    i2c_write_bytes(i2c_connect_client, 0x41F9, &buf, 1);
+    gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x41F9, &buf, 1);
 #endif
 
 	/*GTP_GPIO_AS_INT(ts->irq_pin);*/
@@ -3002,7 +3011,7 @@
 
 
 
-s32 gup_hold_ss51_dsp(struct i2c_client *client)
+static s32 gup_hold_ss51_dsp(struct i2c_client *client)
 {
     s32 ret = -1;
     s32 retry = 0;
@@ -3083,7 +3092,7 @@
     return SUCCESS;
 }
 
-s32 gup_enter_update_mode_fl(struct i2c_client *client)
+static s32 gup_enter_update_mode_fl(struct i2c_client *client)
 {
     s32 ret = -1;
     //s32 retry = 0;
@@ -3215,7 +3224,7 @@
     
     GTP_DEBUG("burn firmware: 0x%04X, %d bytes, start_index: 0x%04X", start_addr, burn_len, start_index);
     
-    ret = i2c_write_bytes(client, start_addr, (u8*)&gtp_default_FW_fl[FW_HEAD_LENGTH + start_index], burn_len);
+    ret = gtp_i2c_write_bytes(client, start_addr, (u8*)&gtp_default_FW_fl[FW_HEAD_LENGTH + start_index], burn_len);
     if (ret < 0)
     {
         GTP_ERROR("burn 0x%04X, %d bytes failed!", start_addr, burn_len);
@@ -3248,7 +3257,7 @@
 			GTP_ERROR("Check failed, buffer overflow\n");
 			break;
 		}
-        ret = i2c_read_bytes(client, cmp_addr, chk_cmp_buf, cmp_len);
+        ret = gtp_i2c_read_bytes(client, cmp_addr, chk_cmp_buf, cmp_len);
         if (ret < 0)
         {
             chk_fail = 1;
@@ -3259,7 +3268,7 @@
             if (chk_cmp_buf[i] != gtp_default_FW_fl[FW_HEAD_LENGTH + start_index +i])
             {
                 chk_fail = 1;
-                i2c_write_bytes(client, cmp_addr+i, &gtp_default_FW_fl[FW_HEAD_LENGTH + start_index + i], cmp_len-i);
+                gtp_i2c_write_bytes(client, cmp_addr+i, &gtp_default_FW_fl[FW_HEAD_LENGTH + start_index + i], cmp_len-i);
                 GTP_ERROR("Check failed index: %d(%d != %d), redownload chuck", i, chk_cmp_buf[i], 
                         gtp_default_FW_fl[FW_HEAD_LENGTH + start_index +i]);
                 break;
@@ -3373,7 +3382,7 @@
     s32 ret = 0;
     s32 i = 0;
     s32 timeout = 0;
-    struct goodix_ts_data *ts = i2c_get_clientdata(i2c_connect_client);
+    struct goodix_ts_data *ts = i2c_get_clientdata(gtp_i2c_connect_client);
     
     if (!memcmp(path, "update", 6))
     {
@@ -3512,14 +3521,14 @@
     return ret;
 }
 
-s32 gup_fw_download_proc(void *dir, u8 dwn_mode)
+s32 gtp_gup_fw_download_proc(void *dir, u8 dwn_mode)
 {
     s32 ret = 0;
     u8  retry = 0;
     st_fw_head fw_head;
     struct goodix_ts_data *ts;
     
-    ts = i2c_get_clientdata(i2c_connect_client);
+    ts = i2c_get_clientdata(gtp_i2c_connect_client);
     if (NULL == dir)
     {
         if(GTP_FL_FW_BURN == dwn_mode)       // GT9XXF firmware burn mode
@@ -3543,7 +3552,7 @@
     total_len = 100;
     show_len = 0;
     
-    ret = gup_check_update_file_fl(i2c_connect_client, &fw_head, (char *)dir);
+    ret = gup_check_update_file_fl(gtp_i2c_connect_client, &fw_head, (char *)dir);
     show_len = 10;
     
     if (FAIL == ret)
@@ -3570,7 +3579,7 @@
 #endif
     }
     
-    ret = gup_enter_update_mode_fl(i2c_connect_client);
+    ret = gup_enter_update_mode_fl(gtp_i2c_connect_client);
     show_len = 20;
     if (FAIL == ret)
     {
@@ -3580,7 +3589,7 @@
 
     while (retry++ < 5)
     {
-        ret = gup_download_fw_ss51(i2c_connect_client, dwn_mode);
+        ret = gup_download_fw_ss51(gtp_i2c_connect_client, dwn_mode);
         show_len = 60;
         if (FAIL == ret)
         {
@@ -3588,7 +3597,7 @@
             continue;
         }
 
-        ret = gup_download_fw_dsp(i2c_connect_client, dwn_mode);
+        ret = gup_download_fw_dsp(gtp_i2c_connect_client, dwn_mode);
         show_len = 80;
         if (FAIL == ret)
         {

--
Gitblit v1.6.2