hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/input/touchscreen/gt9xx/gt9xx_update.c
....@@ -26,7 +26,7 @@
2626 * 3. add update file cal checksum.
2727 * By Andrew, 2012/12/12
2828 * V1.6:
29
- * 1. replace guitar_client with i2c_connect_client;
29
+ * 1. replace guitar_client with gtp_i2c_connect_client;
3030 * 2. support firmware header array update.
3131 * By Meta, 2013/03/11
3232 * V2.2:
....@@ -106,21 +106,21 @@
106106 u32 fw_burned_len;
107107 }st_update_msg;
108108
109
-st_update_msg update_msg;
110
-u16 show_len;
111
-u16 total_len;
112
-u8 got_file_flag = 0;
113
-u8 searching_file = 0;
109
+static st_update_msg update_msg;
110
+static u16 show_len;
111
+static u16 total_len;
112
+//static u8 got_file_flag = 0;
113
+static u8 searching_file = 0;
114114
115
-extern u8 config[GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH];
116
-extern void gtp_reset_guitar(struct i2c_client *client, s32 ms);
117
-extern s32 gtp_send_cfg(struct i2c_client *client);
118
-extern s32 gtp_read_version(struct i2c_client *, u16* );
119
-extern struct i2c_client * i2c_connect_client;
120
-extern void gtp_irq_enable(struct goodix_ts_data *ts);
121
-extern void gtp_irq_disable(struct goodix_ts_data *ts);
122
-extern s32 gtp_i2c_read_dbl_check(struct i2c_client *, u16, u8 *, int);
123
-static u8 gup_burn_fw_gwake_section(struct i2c_client *client, u8 *fw_section, u16 start_addr, u32 len, u8 bank_cmd );
115
+//extern u8 config[GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH];
116
+//extern void gtp_reset_guitar(struct i2c_client *client, s32 ms);
117
+//extern s32 gtp_send_cfg(struct i2c_client *client);
118
+//extern s32 gtp_read_version(struct i2c_client *, u16* );
119
+//extern struct i2c_client * gtp_i2c_connect_client;
120
+//extern void gtp_irq_enable(struct goodix_ts_data *ts);
121
+//extern void gtp_irq_disable(struct goodix_ts_data *ts);
122
+//extern s32 gtp_i2c_read_dbl_check(struct i2c_client *, u16, u8 *, int);
123
+//static u8 gup_burn_fw_gwake_section(struct i2c_client *client, u8 *fw_section, u16 start_addr, u32 len, u8 bank_cmd );
124124
125125 #define _CLOSE_FILE(p_file) if (p_file && !IS_ERR(p_file)) \
126126 { \
....@@ -132,7 +132,7 @@
132132 #endif
133133
134134 #if GTP_COMPATIBLE_MODE
135
-s32 gup_fw_download_proc(void *dir, u8 dwn_mode);
135
+s32 gtp_gup_fw_download_proc(void *dir, u8 dwn_mode);
136136 #endif
137137 /*******************************************************
138138 Function:
....@@ -146,7 +146,7 @@
146146 numbers of i2c_msgs to transfer:
147147 2: succeed, otherwise: failed
148148 *********************************************************/
149
-s32 gup_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
149
+static s32 gup_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
150150 {
151151 struct i2c_msg msgs[2];
152152 s32 ret=-1;
....@@ -192,7 +192,7 @@
192192 numbers of i2c_msgs to transfer:
193193 1: succeed, otherwise: failed
194194 *********************************************************/
195
-s32 gup_i2c_write(struct i2c_client *client,u8 *buf,s32 len)
195
+static s32 gup_i2c_write(struct i2c_client *client,u8 *buf,s32 len)
196196 {
197197 struct i2c_msg msg;
198198 s32 ret=-1;
....@@ -218,6 +218,7 @@
218218 return ret;
219219 }
220220
221
+#if 0
221222 static s32 gup_init_panel(struct goodix_ts_data *ts)
222223 {
223224 s32 ret = 0;
....@@ -329,6 +330,7 @@
329330 msleep(10);
330331 return 0;
331332 }
333
+#endif
332334
333335
334336 static u8 gup_get_ic_msg(struct i2c_client *client, u16 addr, u8* msg, s32 len)
....@@ -381,6 +383,7 @@
381383 return SUCCESS;
382384 }
383385
386
+#if 0
384387 static u8 gup_get_ic_fw_msg(struct i2c_client *client)
385388 {
386389 s32 ret = -1;
....@@ -462,7 +465,7 @@
462465 return SUCCESS;
463466 }
464467
465
-s32 gup_enter_update_mode(struct i2c_client *client)
468
+static s32 gup_enter_update_mode(struct i2c_client *client)
466469 {
467470 s32 ret = -1;
468471 s32 retry = 0;
....@@ -519,14 +522,14 @@
519522 return ret;
520523 }
521524
522
-void gup_leave_update_mode(struct goodix_ts_data *ts)
525
+static void gup_leave_update_mode(struct goodix_ts_data *ts)
523526 {
524527 gpio_direction_input(ts->irq_pin);
525528 //s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE);
526529 //s3c_gpio_cfgpin(pin, GTP_INT_CFG);
527530
528531 GTP_DEBUG("[leave_update_mode]reset chip.");
529
- gtp_reset_guitar(i2c_connect_client, 20);
532
+ gtp_reset_guitar(gtp_i2c_connect_client, 20);
530533 }
531534
532535 // Get the correct nvram data
....@@ -646,6 +649,7 @@
646649
647650 return FAIL;
648651 }
652
+#endif
649653
650654
651655
....@@ -869,6 +873,7 @@
869873 #endif
870874
871875
876
+#if 0
872877 static u8 gup_check_update_file(struct i2c_client *client, st_fw_head* fw_head, u8* path)
873878 {
874879 s32 ret = 0;
....@@ -924,7 +929,7 @@
924929 gup_search_file(AUTO_SEARCH_BIN | AUTO_SEARCH_CFG);
925930 if (got_file_flag & CFG_FILE_READY)
926931 {
927
- ret = gup_update_config(i2c_connect_client);
932
+ ret = gup_update_config(gtp_i2c_connect_client);
928933 if(ret <= 0)
929934 {
930935 GTP_ERROR("Update config failed.");
....@@ -2271,7 +2276,7 @@
22712276 }
22722277 return FAIL;
22732278 }
2274
-s32 gup_update_proc(void *dir)
2279
+static s32 gup_update_proc(void *dir)
22752280 {
22762281 s32 ret = 0;
22772282 s32 update_ret = FAIL;
....@@ -2281,7 +2286,7 @@
22812286
22822287 GTP_DEBUG("[update_proc]Begin update ......");
22832288
2284
- ts = i2c_get_clientdata(i2c_connect_client);
2289
+ ts = i2c_get_clientdata(gtp_i2c_connect_client);
22852290
22862291 #if GTP_AUTO_UPDATE
22872292 if (searching_file)
....@@ -2302,19 +2307,19 @@
23022307 #if GTP_COMPATIBLE_MODE
23032308 if (CHIP_TYPE_GT9F == ts->chip_type)
23042309 {
2305
- return gup_fw_download_proc(dir, GTP_FL_FW_BURN);
2310
+ return gtp_gup_fw_download_proc(dir, GTP_FL_FW_BURN);
23062311 }
23072312 #endif
23082313
23092314 update_msg.file = NULL;
2310
- ret = gup_check_update_file(i2c_connect_client, &fw_head, (u8*)dir); //20121211
2315
+ ret = gup_check_update_file(gtp_i2c_connect_client, &fw_head, (u8*)dir); //20121211
23112316 if(FAIL == ret)
23122317 {
23132318 GTP_ERROR("[update_proc]check update file fail.");
23142319 goto file_fail;
23152320 }
23162321
2317
- ret = gup_get_ic_fw_msg(i2c_connect_client);
2322
+ ret = gup_get_ic_fw_msg(gtp_i2c_connect_client);
23182323 if(FAIL == ret)
23192324 {
23202325 GTP_ERROR("[update_proc]get ic message fail.");
....@@ -2333,7 +2338,7 @@
23332338 #if GTP_ESD_PROTECT
23342339 gtp_esd_switch(ts->client, SWITCH_OFF);
23352340 #endif
2336
- ret = gup_enter_update_mode(i2c_connect_client);
2341
+ ret = gup_enter_update_mode(gtp_i2c_connect_client);
23372342 if(FAIL == ret)
23382343 {
23392344 GTP_ERROR("[update_proc]enter update mode fail.");
....@@ -2345,7 +2350,7 @@
23452350 show_len = 10;
23462351 total_len = 100;
23472352 update_msg.fw_burned_len = 0;
2348
- ret = gup_burn_dsp_isp(i2c_connect_client);
2353
+ ret = gup_burn_dsp_isp(gtp_i2c_connect_client);
23492354 if(FAIL == ret)
23502355 {
23512356 GTP_ERROR("[update_proc]burn dsp isp fail.");
....@@ -2353,7 +2358,7 @@
23532358 }
23542359
23552360 show_len = 20;
2356
- ret = gup_burn_fw_ss51(i2c_connect_client);
2361
+ ret = gup_burn_fw_ss51(gtp_i2c_connect_client);
23572362 if(FAIL == ret)
23582363 {
23592364 GTP_ERROR("[update_proc]burn ss51 firmware fail.");
....@@ -2361,7 +2366,7 @@
23612366 }
23622367
23632368 show_len = 30;
2364
- ret = gup_burn_fw_dsp(i2c_connect_client);
2369
+ ret = gup_burn_fw_dsp(gtp_i2c_connect_client);
23652370 if(FAIL == ret)
23662371 {
23672372 GTP_ERROR("[update_proc]burn dsp firmware fail.");
....@@ -2369,7 +2374,7 @@
23692374 }
23702375
23712376 show_len = 40;
2372
- ret = gup_burn_fw_boot(i2c_connect_client);
2377
+ ret = gup_burn_fw_boot(gtp_i2c_connect_client);
23732378 if(FAIL == ret)
23742379 {
23752380 GTP_ERROR("[update_proc]burn bootloader firmware fail.");
....@@ -2377,7 +2382,7 @@
23772382 }
23782383 show_len = 50;
23792384
2380
- ret = gup_burn_fw_boot_isp(i2c_connect_client);
2385
+ ret = gup_burn_fw_boot_isp(gtp_i2c_connect_client);
23812386 if (FAIL == ret)
23822387 {
23832388 GTP_ERROR("[update_proc]burn boot_isp firmware fail.");
....@@ -2385,7 +2390,7 @@
23852390 }
23862391
23872392 show_len = 60;
2388
- ret = gup_burn_fw_link(i2c_connect_client);
2393
+ ret = gup_burn_fw_link(gtp_i2c_connect_client);
23892394 if (FAIL == ret)
23902395 {
23912396 GTP_ERROR("[update_proc]burn link firmware fail.");
....@@ -2393,7 +2398,7 @@
23932398 }
23942399
23952400 show_len = 70;
2396
- ret = gup_burn_fw_gwake(i2c_connect_client);
2401
+ ret = gup_burn_fw_gwake(gtp_i2c_connect_client);
23972402 if (FAIL == ret)
23982403 {
23992404 GTP_ERROR("[update_proc]burn app_code firmware fail.");
....@@ -2401,7 +2406,7 @@
24012406 }
24022407 show_len = 80;
24032408
2404
- ret = gup_burn_fw_finish(i2c_connect_client);
2409
+ ret = gup_burn_fw_finish(gtp_i2c_connect_client);
24052410 if (FAIL == ret)
24062411 {
24072412 GTP_ERROR("[update_proc]burn finish fail.");
....@@ -2439,7 +2444,7 @@
24392444 else
24402445 {
24412446 GTP_DEBUG("[update_proc]send config.");
2442
- ret = gtp_send_cfg(i2c_connect_client);
2447
+ ret = gtp_send_cfg(gtp_i2c_connect_client);
24432448 if (ret < 0)
24442449 {
24452450 GTP_ERROR("[update_proc]send config fail.");
....@@ -2472,7 +2477,7 @@
24722477 gup_search_file(AUTO_SEARCH_CFG);
24732478 if (got_file_flag & CFG_FILE_READY)
24742479 {
2475
- ret = gup_update_config(i2c_connect_client);
2480
+ ret = gup_update_config(gtp_i2c_connect_client);
24762481 if(ret <= 0)
24772482 {
24782483 GTP_ERROR("Update config failed.");
....@@ -2495,6 +2500,7 @@
24952500 return FAIL;
24962501 }
24972502 }
2503
+#endif
24982504
24992505 #if GTP_AUTO_UPDATE
25002506 u8 gup_init_update_proc(struct goodix_ts_data *ts)
....@@ -2570,16 +2576,16 @@
25702576
25712577 #if GTP_COMPATIBLE_MODE
25722578
2573
-u8 i2c_opr_buf[GTP_ADDR_LENGTH + FL_PACK_SIZE] = {0};
2574
-u8 chk_cmp_buf[FL_PACK_SIZE] = {0};
2579
+static u8 i2c_opr_buf[GTP_ADDR_LENGTH + FL_PACK_SIZE] = {0};
2580
+static u8 chk_cmp_buf[FL_PACK_SIZE] = {0};
25752581
2576
-extern s32 gtp_fw_startup(struct i2c_client *client);
2582
+//extern s32 gtp_fw_startup(struct i2c_client *client);
25772583 static u8 gup_download_fw_dsp(struct i2c_client *client, u8 dwn_mode);
25782584 static s32 gup_burn_fw_proc(struct i2c_client *client, u16 start_addr, s32 start_index, s32 burn_len);
25792585 static s32 gup_check_and_repair(struct i2c_client *client, u16 start_addr, s32 start_index, s32 chk_len);
25802586
25812587
2582
-u8 gup_check_fs_mounted(char *path_name)
2588
+u8 gtp_gup_check_fs_mounted(char *path_name)
25832589 {
25842590 struct path root_path;
25852591 struct path path;
....@@ -2617,7 +2623,7 @@
26172623 #endif
26182624 }
26192625
2620
-s32 i2c_write_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
2626
+s32 gtp_i2c_write_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
26212627 {
26222628 s32 ret = 0;
26232629 s32 write_bytes = 0;
....@@ -2658,7 +2664,7 @@
26582664 return 1;
26592665 }
26602666
2661
-s32 i2c_read_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
2667
+s32 gtp_i2c_read_bytes(struct i2c_client *client, u16 addr, u8 *buf, s32 len)
26622668 {
26632669 s32 ret = 0;
26642670 s32 read_bytes = 0;
....@@ -2705,11 +2711,11 @@
27052711 static void gup_bit_write(s32 addr, s32 bit, s32 val)
27062712 {
27072713 u8 buf;
2708
- i2c_read_bytes(i2c_connect_client, addr, &buf, 1);
2714
+ gtp_i2c_read_bytes(gtp_i2c_connect_client, addr, &buf, 1);
27092715
27102716 buf = (buf & (~((u8)1 << bit))) | ((u8)val << bit);
27112717
2712
- i2c_write_bytes(i2c_connect_client, addr, &buf, 1);
2718
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, addr, &buf, 1);
27132719 }
27142720
27152721 static void gup_clk_count_init(s32 bCh, s32 bCNT)
....@@ -2722,13 +2728,13 @@
27222728 gup_bit_write(_fRW_MISCTL__MEA, 1, 1);
27232729 //_bRW_MISCTL__MEA_MODE = 0; //Pulse mode
27242730 buf = 0;
2725
- i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__MEA_MODE, &buf, 1);
2731
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__MEA_MODE, &buf, 1);
27262732 //_bRW_MISCTL__MEA_SRCSEL = 8 + bCh; //From GIO1
27272733 buf = 8 + bCh;
2728
- i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__MEA_SRCSEL, &buf, 1);
2734
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__MEA_SRCSEL, &buf, 1);
27292735 //_wRW_MISCTL__MEA_MAX_NUM = bCNT; //Set the Measure Counts = 1
27302736 buf = bCNT;
2731
- i2c_write_bytes(i2c_connect_client, _wRW_MISCTL__MEA_MAX_NUM, &buf, 1);
2737
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _wRW_MISCTL__MEA_MAX_NUM, &buf, 1);
27322738 //_fRW_MISCTL__MEA_CLR = 0; //Frequency measure not clear
27332739 gup_bit_write(_fRW_MISCTL__MEA, 1, 0);
27342740 //_fRW_MISCTL__MEA_EN = 1;
....@@ -2743,7 +2749,7 @@
27432749
27442750 while (ready == 0) //Wait for measurement complete
27452751 {
2746
- i2c_read_bytes(i2c_connect_client, _bRO_MISCTL__MEA_RDY, buf, 1);
2752
+ gtp_i2c_read_bytes(gtp_i2c_connect_client, _bRO_MISCTL__MEA_RDY, buf, 1);
27472753 ready = buf[0];
27482754 }
27492755
....@@ -2751,7 +2757,7 @@
27512757
27522758 //_fRW_MISCTL__MEA_EN = 0;
27532759 gup_bit_write(_fRW_MISCTL__MEA, 0, 0);
2754
- i2c_read_bytes(i2c_connect_client, _dRO_MISCTL__MEA_VAL, buf, 4);
2760
+ gtp_i2c_read_bytes(gtp_i2c_connect_client, _dRO_MISCTL__MEA_VAL, buf, 4);
27552761 GTP_DEBUG("Clk_count 0: %2X", buf[0]);
27562762 GTP_DEBUG("Clk_count 1: %2X", buf[1]);
27572763 GTP_DEBUG("Clk_count 2: %2X", buf[2]);
....@@ -2761,23 +2767,23 @@
27612767 GTP_INFO("Clk_count : %d", temp);
27622768 return temp;
27632769 }
2764
-u8 gup_clk_dac_setting(int dac)
2770
+static u8 gup_clk_dac_setting(int dac)
27652771 {
27662772 s8 buf1, buf2;
27672773
2768
- i2c_read_bytes(i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
2769
- i2c_read_bytes(i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
2774
+ gtp_i2c_read_bytes(gtp_i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
2775
+ gtp_i2c_read_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
27702776
27712777 buf1 = (buf1 & 0xFFCF) | ((dac & 0x03) << 4);
27722778 buf2 = (dac >> 2) & 0x3f;
27732779
2774
- i2c_write_bytes(i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
2775
- i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
2780
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _wRW_MISCTL__RG_DMY, &buf1, 1);
2781
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_OSC_CALIB, &buf2, 1);
27762782
27772783 return 0;
27782784 }
27792785
2780
-static u8 gup_clk_calibration_pin_select(s32 bCh)
2786
+static u8 gtp_gup_clk_calibration_pin_select(s32 bCh)
27812787 {
27822788 s32 i2c_addr;
27832789
....@@ -2822,6 +2828,9 @@
28222828 case 9:
28232829 i2c_addr = _fRW_MISCTL__GIO9;
28242830 break;
2831
+
2832
+ default:
2833
+ return -1;
28252834 }
28262835
28272836 gup_bit_write(i2c_addr, 1, 0);
....@@ -2829,12 +2838,12 @@
28292838 return 0;
28302839 }
28312840
2832
-void gup_output_pulse(int t)
2841
+static void gup_output_pulse(int t)
28332842 {
28342843 unsigned long flags;
28352844 struct goodix_ts_data *ts;
28362845
2837
- ts = i2c_get_clientdata(i2c_connect_client);
2846
+ ts = i2c_get_clientdata(gtp_i2c_connect_client);
28382847
28392848 GTP_GPIO_OUTPUT(ts->irq_pin, 0);
28402849 msleep(10);
....@@ -2861,13 +2870,13 @@
28612870 gup_bit_write(_rRW_MISCTL__ANA_RXADC_B0_, 5, 0);
28622871 //_bRW_MISCTL__RG_LDO_A18_PWD = 0; //DrvMISCTL_A18_PowerON
28632872 buf = 0;
2864
- i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_LDO_A18_PWD, &buf, 1);
2873
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_LDO_A18_PWD, &buf, 1);
28652874 //_bRW_MISCTL__RG_BG_PWD = 0; //DrvMISCTL_BG_PowerON
28662875 buf = 0;
2867
- i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_BG_PWD, &buf, 1);
2876
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_BG_PWD, &buf, 1);
28682877 //_bRW_MISCTL__RG_CLKGEN_PWD = 0; //DrvMISCTL_CLKGEN_PowerON
28692878 buf = 0;
2870
- i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__RG_CLKGEN_PWD, &buf, 1);
2879
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__RG_CLKGEN_PWD, &buf, 1);
28712880 //_fRW_MISCTL__RG_RXADC_PWD = 0; //DrvMISCTL_RX_ADC_PowerON
28722881 gup_bit_write(_rRW_MISCTL__ANA_RXADC_B0_, 0, 0);
28732882 //_fRW_MISCTL__RG_RXADC_REF_PWD = 0; //DrvMISCTL_RX_ADCREF_PowerON
....@@ -2875,26 +2884,26 @@
28752884 //gup_clk_dac_setting(60);
28762885 //_bRW_MISCTL__OSC_CK_SEL = 1;;
28772886 buf = 1;
2878
- i2c_write_bytes(i2c_connect_client, _bRW_MISCTL__OSC_CK_SEL, &buf, 1);
2887
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _bRW_MISCTL__OSC_CK_SEL, &buf, 1);
28792888 }
28802889
2881
-s32 gup_clk_calibration(void)
2890
+s32 gtp_gup_clk_calibration(void)
28822891 {
28832892 u8 buf;
28842893 //u8 trigger;
28852894 s32 i;
2886
- struct timeval start, end;
2895
+ //struct timeval start, end;
28872896 s32 count;
2888
- s32 count_ref;
2889
- s32 sec;
2890
- s32 usec;
2897
+ //s32 count_ref;
2898
+ //s32 sec;
2899
+ //s32 usec;
28912900 //unsigned long flags;
28922901 struct goodix_ts_data *ts;
28932902
2894
- ts = i2c_get_clientdata(i2c_connect_client);
2903
+ ts = i2c_get_clientdata(gtp_i2c_connect_client);
28952904
28962905 buf = 0x0C; // hold ss51 and dsp
2897
- i2c_write_bytes(i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
2906
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
28982907
28992908 //_fRW_MISCTL__CLK_BIAS = 0; //disable clock bias
29002909 gup_bit_write(_rRW_MISCTL_RG_DMY83, 7, 0);
....@@ -2906,12 +2915,12 @@
29062915 gup_bit_write(_rRW_MISCTL__GIO1CTL_B1_, 1, 0);
29072916
29082917 //buf = 0x00;
2909
- //i2c_write_bytes(i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
2918
+ //gtp_i2c_write_bytes(gtp_i2c_connect_client, _rRW_MISCTL__SWRST_B0_, &buf, 1);
29102919 //msleep(1000);
29112920
29122921 GTP_INFO("CLK calibration GO");
29132922 gup_sys_clk_init();
2914
- gup_clk_calibration_pin_select(1);//use GIO1 to do the calibration
2923
+ gtp_gup_clk_calibration_pin_select(1);//use GIO1 to do the calibration
29152924
29162925 GTP_GPIO_OUTPUT(ts->irq_pin, 0);
29172926
....@@ -2928,7 +2937,7 @@
29282937 gup_clk_dac_setting(i);
29292938 gup_clk_count_init(1, CLK_AVG_TIME);
29302939
2931
- #if 0
2940
+ #if 1
29322941 gup_output_pulse(PULSE_LENGTH);
29332942 count = gup_clk_count_get();
29342943
....@@ -2975,24 +2984,24 @@
29752984
29762985 //clk_dac = i;
29772986
2978
- gtp_reset_guitar(i2c_connect_client, 20);
2987
+ gtp_reset_guitar(gtp_i2c_connect_client, 20);
29792988
29802989 #if 0//for debug
29812990 //-- ouput clk to GPIO 4
29822991 buf = 0x00;
2983
- i2c_write_bytes(i2c_connect_client, 0x41FA, &buf, 1);
2992
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x41FA, &buf, 1);
29842993 buf = 0x00;
2985
- i2c_write_bytes(i2c_connect_client, 0x4104, &buf, 1);
2994
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4104, &buf, 1);
29862995 buf = 0x00;
2987
- i2c_write_bytes(i2c_connect_client, 0x4105, &buf, 1);
2996
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4105, &buf, 1);
29882997 buf = 0x00;
2989
- i2c_write_bytes(i2c_connect_client, 0x4106, &buf, 1);
2998
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4106, &buf, 1);
29902999 buf = 0x01;
2991
- i2c_write_bytes(i2c_connect_client, 0x4107, &buf, 1);
3000
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x4107, &buf, 1);
29923001 buf = 0x06;
2993
- i2c_write_bytes(i2c_connect_client, 0x41F8, &buf, 1);
3002
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x41F8, &buf, 1);
29943003 buf = 0x02;
2995
- i2c_write_bytes(i2c_connect_client, 0x41F9, &buf, 1);
3004
+ gtp_i2c_write_bytes(gtp_i2c_connect_client, 0x41F9, &buf, 1);
29963005 #endif
29973006
29983007 /*GTP_GPIO_AS_INT(ts->irq_pin);*/
....@@ -3002,7 +3011,7 @@
30023011
30033012
30043013
3005
-s32 gup_hold_ss51_dsp(struct i2c_client *client)
3014
+static s32 gup_hold_ss51_dsp(struct i2c_client *client)
30063015 {
30073016 s32 ret = -1;
30083017 s32 retry = 0;
....@@ -3083,7 +3092,7 @@
30833092 return SUCCESS;
30843093 }
30853094
3086
-s32 gup_enter_update_mode_fl(struct i2c_client *client)
3095
+static s32 gup_enter_update_mode_fl(struct i2c_client *client)
30873096 {
30883097 s32 ret = -1;
30893098 //s32 retry = 0;
....@@ -3215,7 +3224,7 @@
32153224
32163225 GTP_DEBUG("burn firmware: 0x%04X, %d bytes, start_index: 0x%04X", start_addr, burn_len, start_index);
32173226
3218
- ret = i2c_write_bytes(client, start_addr, (u8*)&gtp_default_FW_fl[FW_HEAD_LENGTH + start_index], burn_len);
3227
+ ret = gtp_i2c_write_bytes(client, start_addr, (u8*)&gtp_default_FW_fl[FW_HEAD_LENGTH + start_index], burn_len);
32193228 if (ret < 0)
32203229 {
32213230 GTP_ERROR("burn 0x%04X, %d bytes failed!", start_addr, burn_len);
....@@ -3248,7 +3257,7 @@
32483257 GTP_ERROR("Check failed, buffer overflow\n");
32493258 break;
32503259 }
3251
- ret = i2c_read_bytes(client, cmp_addr, chk_cmp_buf, cmp_len);
3260
+ ret = gtp_i2c_read_bytes(client, cmp_addr, chk_cmp_buf, cmp_len);
32523261 if (ret < 0)
32533262 {
32543263 chk_fail = 1;
....@@ -3259,7 +3268,7 @@
32593268 if (chk_cmp_buf[i] != gtp_default_FW_fl[FW_HEAD_LENGTH + start_index +i])
32603269 {
32613270 chk_fail = 1;
3262
- i2c_write_bytes(client, cmp_addr+i, &gtp_default_FW_fl[FW_HEAD_LENGTH + start_index + i], cmp_len-i);
3271
+ gtp_i2c_write_bytes(client, cmp_addr+i, &gtp_default_FW_fl[FW_HEAD_LENGTH + start_index + i], cmp_len-i);
32633272 GTP_ERROR("Check failed index: %d(%d != %d), redownload chuck", i, chk_cmp_buf[i],
32643273 gtp_default_FW_fl[FW_HEAD_LENGTH + start_index +i]);
32653274 break;
....@@ -3373,7 +3382,7 @@
33733382 s32 ret = 0;
33743383 s32 i = 0;
33753384 s32 timeout = 0;
3376
- struct goodix_ts_data *ts = i2c_get_clientdata(i2c_connect_client);
3385
+ struct goodix_ts_data *ts = i2c_get_clientdata(gtp_i2c_connect_client);
33773386
33783387 if (!memcmp(path, "update", 6))
33793388 {
....@@ -3512,14 +3521,14 @@
35123521 return ret;
35133522 }
35143523
3515
-s32 gup_fw_download_proc(void *dir, u8 dwn_mode)
3524
+s32 gtp_gup_fw_download_proc(void *dir, u8 dwn_mode)
35163525 {
35173526 s32 ret = 0;
35183527 u8 retry = 0;
35193528 st_fw_head fw_head;
35203529 struct goodix_ts_data *ts;
35213530
3522
- ts = i2c_get_clientdata(i2c_connect_client);
3531
+ ts = i2c_get_clientdata(gtp_i2c_connect_client);
35233532 if (NULL == dir)
35243533 {
35253534 if(GTP_FL_FW_BURN == dwn_mode) // GT9XXF firmware burn mode
....@@ -3543,7 +3552,7 @@
35433552 total_len = 100;
35443553 show_len = 0;
35453554
3546
- ret = gup_check_update_file_fl(i2c_connect_client, &fw_head, (char *)dir);
3555
+ ret = gup_check_update_file_fl(gtp_i2c_connect_client, &fw_head, (char *)dir);
35473556 show_len = 10;
35483557
35493558 if (FAIL == ret)
....@@ -3570,7 +3579,7 @@
35703579 #endif
35713580 }
35723581
3573
- ret = gup_enter_update_mode_fl(i2c_connect_client);
3582
+ ret = gup_enter_update_mode_fl(gtp_i2c_connect_client);
35743583 show_len = 20;
35753584 if (FAIL == ret)
35763585 {
....@@ -3580,7 +3589,7 @@
35803589
35813590 while (retry++ < 5)
35823591 {
3583
- ret = gup_download_fw_ss51(i2c_connect_client, dwn_mode);
3592
+ ret = gup_download_fw_ss51(gtp_i2c_connect_client, dwn_mode);
35843593 show_len = 60;
35853594 if (FAIL == ret)
35863595 {
....@@ -3588,7 +3597,7 @@
35883597 continue;
35893598 }
35903599
3591
- ret = gup_download_fw_dsp(i2c_connect_client, dwn_mode);
3600
+ ret = gup_download_fw_dsp(gtp_i2c_connect_client, dwn_mode);
35923601 show_len = 80;
35933602 if (FAIL == ret)
35943603 {