hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/input/touchscreen/gsl_point_id.c
....@@ -68,7 +68,7 @@
6868 int x[10];
6969 int y[10];
7070 int id[10];
71
- int finger_num;
71
+ int finger_num;
7272 };
7373
7474 typedef struct
....@@ -140,7 +140,7 @@
140140
141141 typedef union
142142 {
143
- struct
143
+ struct
144144 {
145145 short y;
146146 short x;
....@@ -179,8 +179,8 @@
179179 unsigned init_repeat:1;
180180 unsigned near_reset_able:1;
181181
182
- unsigned emb_dead:1;
183
- unsigned emb_point_mask:1;
182
+ unsigned emb_dead:1;
183
+ unsigned emb_point_mask:1;
184184 unsigned interpolation:1;
185185 unsigned sum2_able:1;
186186 unsigned reduce_pin:1;
....@@ -285,7 +285,7 @@
285285 #define GesturePtNum 15
286286 typedef union
287287 {
288
-
288
+
289289 struct
290290 {
291291 unsigned y:16;
....@@ -295,13 +295,13 @@
295295 unsigned int data_int;
296296 }POINT_TYPE_DEFINE;
297297
298
-typedef struct
298
+typedef struct
299299 {
300300 int top;
301301 POINT_TYPE_DEFINE point_buff[MAXSTACK];
302302 }TouchFinger;
303303
304
-static struct
304
+static struct
305305 {
306306 int num[10];
307307 int flag;
....@@ -312,7 +312,7 @@
312312 static int qushi_y[10];
313313 static int vector_change_x[MAXSTACK];
314314 static int vector_change_y[MAXSTACK];
315
-static int rate_weight[MAXSTACK];
315
+static int rate_weight[MAXSTACK];
316316 static POINT_TYPE_DEFINE top,bottom,left,right;
317317 static int Letter_width;
318318 static int Letter_height;
....@@ -338,7 +338,7 @@
338338 }other;
339339 unsigned int all;
340340 }GESTURE_POINT_TYPE;
341
-typedef struct
341
+typedef struct
342342 {
343343 int coe;
344344 int out;
....@@ -383,7 +383,7 @@
383383 0xe2ee3d30,0xc5d4564a,0xa7b76c61,0x8c9a8579,0x717e9f93,0x5863bbad,0x434cdbc9,0x3c3dffec,}},
384384 {0x10,'8',{
385385 0xdaff030c,0x8eb40000,0x41670c06,0x001c3116,0x431e5448,0x8f69635d,0xd1b58a6f,0xcedfd0af,
386
- 0x88acf5e6,0x3c62fffd,0x0718cdf1,0x341493aa,0x7a556d7d,0xc19e4f60,0xf9e51c3c,0xb5dc0005,}},
386
+ 0x88acf5e6,0x3c62fffd,0x0718cdf1,0x341493aa,0x7a556d7d,0xc19e4f60,0xf9e51c3c,0xb5dc0005,}},
387387 {0x10,'8',{
388388 0x627d231e,0x2f49382c,0x03175a48,0x21098172,0x563c958c,0x856eb0a2,0x8f99dac4,0x5b76eee5,
389389 0x243ffdf5,0x090ddbf4,0x2918acc2,0x4d3a8497,0x78636172,0xa38e4050,0xd0ba1f2e,0xffe7000f,}},
....@@ -416,7 +416,7 @@
416416 0x233b3a25,0x08137053,0x0301aa8d,0x220edcc6,0x573af7ee,0x9174fffc,0xcaaef6ff,0xffe5dbeb,}},
417417 {0x10,'G',{
418418 0xaaca0000,0x698a0000,0x2a491106,0x000f4226,0x23067061,0x64437674,0xa3836874,0xdac04759,
419
- 0xfaec0b2a,0xfefb401f,0xffff8160,0xf5fdc0a1,0xc9e9eedf,0x89a9fff9,0x4869faff,0x0928e3f3,}},
419
+ 0xfaec0b2a,0xfefb401f,0xffff8160,0xf5fdc0a1,0xc9e9eedf,0x89a9fff9,0x4869faff,0x0928e3f3,}},
420420 {0x10,'G',{
421421 0xeaff1421,0xb9d20308,0x88a00000,0x57700f05,0x2b3f2618,0x09174d37,0x00037f66,0x0d05af97,
422422 0x2a1adac7,0x5940ede5,0x8b72f2f3,0xbca4e9ee,0xe4d2cbde,0xfbf09cb3,0xf5f8ceb5,0xe9f1ffe6,}},
....@@ -452,7 +452,7 @@
452452 0xab93cfe0,0xd5c1a7bd,0xf4e67690,0xfbff3d5a,0xcfec1b26,0x96b31818,0x5e7a251d,0x28433b2f,}},
453453 {0x10,'O',{
454454 0x381e5e68,0x6e535156,0xa388504f,0xd8be5e56,0xf9ed876d,0xf9fcbaa1,0xd8ece5d2,0xa5c0f9f2,
455
- 0x708bfffd,0x3b55fbfe,0x1423d7ed,0x0006a4bf,0x09027089,0x26154157,0x50391e2e,0x7e670010,}},
455
+ 0x708bfffd,0x3b55fbfe,0x1423d7ed,0x0006a4bf,0x09027089,0x26154157,0x50391e2e,0x7e670010,}},
456456 {0x10,'O',{
457457 0x8670020b,0xb8a01307,0xe3ce3423,0xf8f0664c,0xfffc9b81,0xf1faceb5,0xcee4f4e5,0x9ab4fffb,
458458 0x657fffff,0x364ceaf8,0x1623c0d7,0x00098ea7,0x06015973,0x24122e41,0x4d380c1c,0x82670104,}},
....@@ -522,7 +522,7 @@
522522 0xd6b47f94,0xf9f23960,0xd5f80012,0x91af270a,0x7e83734c,0x7e7dc19a,0xb490fae5,0xffdbe9fe,}},
523523 {0x10,0x100d,{
524524 0x768e0c00,0x465e2619,0x192f4635,0x0107745a,0x32178a85,0x674d858a,0x9b81747d,0xccb45c69,
525
- 0xf7e33b4d,0xebfd0d21,0xb6d00004,0x939e270d,0x888d5d42,0x83859378,0x7c80c9ae,0x6c75ffe4,}},
525
+ 0xf7e33b4d,0xebfd0d21,0xb6d00004,0x939e270d,0x888d5d42,0x83859378,0x7c80c9ae,0x6c75ffe4,}},
526526 {0x10,0x100e,{
527527 0xb3bd1000,0x9ea82d1e,0x87924a3b,0x6f7b6658,0x56628375,0x3e4a9e91,0x2934bcad,0x1720ddcd,
528528 0x010bfced,0x2513ffff,0x4937fdff,0x6d5bf9fa,0x9280f4f7,0xb6a4f0f1,0xdac8eeef,0xffececed,}},
....@@ -619,11 +619,11 @@
619619 y = point_now[j].other.y;
620620 if(x>x_min && x<x_max && y>y_min && y<y_max)
621621 {
622
- point_now[i].other.x =
623
- (point_now[i].other.x +
622
+ point_now[i].other.x =
623
+ (point_now[i].other.x +
624624 point_now[j].other.x + 1) / 2;
625
- point_now[i].other.y =
626
- (point_now[i].other.y +
625
+ point_now[i].other.y =
626
+ (point_now[i].other.y +
627627 point_now[j].other.y + 1) / 2;
628628 point_now[j].all = 0;
629629 i--;
....@@ -719,7 +719,7 @@
719719 typedef struct
720720 {
721721 unsigned int range;
722
- unsigned int group;
722
+ unsigned int group;
723723 }MULTI_TYPE;
724724 #ifdef LINE_MULTI_SIZE
725725 #define LINE_SIZE LINE_MULTI_SIZE
....@@ -774,7 +774,7 @@
774774 break;
775775 if (point_now[i].other.key != 0)
776776 continue;
777
- if (point_now[i].other.x >= edge_size &&
777
+ if (point_now[i].other.x >= edge_size &&
778778 point_now[i].other.x <= drv_num_nokey * 64 - edge_size)
779779 {
780780 if(kx == 3)
....@@ -788,9 +788,9 @@
788788 {
789789 for(j=0;j<LINE_SIZE+1;j++)
790790 {
791
- if (!(j >= LINE_SIZE ||
792
- px[j + 1] == NULL ||
793
- multi_x[j].range == 0 ||
791
+ if (!(j >= LINE_SIZE ||
792
+ px[j + 1] == NULL ||
793
+ multi_x[j].range == 0 ||
794794 point_now[i].other.x < multi_x[j].range))
795795 continue;
796796 point_now[i].other.x = CCO(point_now[i].other.x, px[j], kx);
....@@ -798,7 +798,7 @@
798798 }
799799 }
800800 }
801
- if (point_now[i].other.y >= edge_size &&
801
+ if (point_now[i].other.y >= edge_size &&
802802 point_now[i].other.y <= sen_num_nokey * 64 - edge_size)
803803 {
804804 if(ky == 3)
....@@ -812,9 +812,9 @@
812812 {
813813 for(j=0;j<LINE_SIZE+1;j++)
814814 {
815
- if (!(j >= LINE_SIZE ||
816
- py[j + 1] == NULL ||
817
- multi_y[j].range == 0 ||
815
+ if (!(j >= LINE_SIZE ||
816
+ py[j + 1] == NULL ||
817
+ multi_y[j].range == 0 ||
818818 point_now[i].other.y < multi_y[j].range))
819819 continue;
820820 point_now[i].other.y = CCO(point_now[i].other.y, py[j], ky);
....@@ -1010,8 +1010,8 @@
10101010 {
10111011 if(DistanceMin(&distance))
10121012 {
1013
- if (pp[1][0].all != 0 &&
1014
- pp[1][0].other.key !=
1013
+ if (pp[1][0].all != 0 &&
1014
+ pp[1][0].other.key !=
10151015 point_now[distance.j].other.key)
10161016 {
10171017 DistanceIgnore(&distance);
....@@ -1030,11 +1030,11 @@
10301030 }
10311031 else
10321032 {
1033
- for(j=0;j<point_num && j<POINT_MAX;j++)
1033
+ for (j=0;j<point_num && j<POINT_MAX;j++)
10341034 {
1035
- if(DistanceMin(&distance) == 0)
1035
+ if (DistanceMin(&distance) == 0)
10361036 break;
1037
- if(distance.min >= (id_static_coe +
1037
+ if (distance.min >= (id_static_coe +
10381038 id_speed[distance.i] * id_speed_coe) /**average/(soft_average+1)*/)
10391039 {
10401040 //point_now[distance.j].id = 0xf;//new id
....@@ -1147,15 +1147,15 @@
11471147 point_delay[i].other.able = 1;
11481148 continue;
11491149 }
1150
- if (pp[0][i].all != 0 &&
1151
- point_delay[i].other.init == 0 &&
1150
+ if (pp[0][i].all != 0 &&
1151
+ point_delay[i].other.init == 0 &&
11521152 point_delay[i].other.able == 0)
11531153 {
11541154 if(point_num == 0)
11551155 continue;
1156
- point_delay[i].other.delay = (report_delay >> 3 *
1156
+ point_delay[i].other.delay = (report_delay >> 3 *
11571157 ((point_num>10 ? 10 : point_num) - 1)) & 0x7;
1158
- point_delay[i].other.report = (report_ahead >> 3 *
1158
+ point_delay[i].other.report = (report_ahead >> 3 *
11591159 ((point_num>10 ? 10 : point_num) - 1)) & 0x7;
11601160 if (point_delay[i].other.report > point_delay[i].other.delay)
11611161 point_delay[i].other.report = point_delay[i].other.delay;
....@@ -1168,9 +1168,9 @@
11681168 if (point_delay[i].other.able == 0 && point_delay[i].other.init != 0)
11691169 {
11701170 for (j = 0; j <= (int)point_delay[i].other.delay; j++)
1171
- if (pp[j][i].all == 0 ||
1172
- pp[j][i].other.fill != 0 ||
1173
- pp[j][i].other.able != 0)
1171
+ if (pp[j][i].all == 0 ||
1172
+ pp[j][i].other.fill != 0 ||
1173
+ pp[j][i].other.able != 0)
11741174 break;
11751175 if (j <= (int)point_delay[i].other.delay)
11761176 continue;
....@@ -1185,7 +1185,7 @@
11851185 continue;
11861186 if (point_delay[i].other.report)
11871187 {
1188
- if (PointDistance(&pp[point_delay[i].other.report][i],
1188
+ if (PointDistance(&pp[point_delay[i].other.report][i],
11891189 &pp[point_delay[i].other.report - 1][i]) < 3 * 3)
11901190 point_delay[i].other.report--;
11911191 }
....@@ -1203,9 +1203,9 @@
12031203 return;
12041204 for(j=0;j<8;j++)
12051205 {
1206
- x += (int)pr[j][i].other.x * (int)pr_c[j] +
1206
+ x += (int)pr[j][i].other.x * (int)pr_c[j] +
12071207 (int)ps[j][i].other.x * (int)ps_c[j];
1208
- y += (int)pr[j][i].other.y * (int)pr_c[j] +
1208
+ y += (int)pr[j][i].other.y * (int)pr_c[j] +
12091209 (int)ps[j][i].other.y * (int)ps_c[j];
12101210 }
12111211 x = (x + denominator/2) / denominator;
....@@ -1224,8 +1224,8 @@
12241224
12251225 static unsigned int FilterSpeed(int i)
12261226 {
1227
- return (Sqrt(PointDistance(&ps[0][i],&ps[1][i])) +
1228
- Sqrt(PointDistance(&ps[1][i],&ps[2][i])))/2;
1227
+ return (Sqrt(PointDistance(&ps[0][i], &ps[1][i])) +
1228
+ Sqrt(PointDistance(&ps[1][i], &ps[2][i])))/2;
12291229 }
12301230
12311231 static int MedianSpeedOver(int id,int deep)
....@@ -1335,13 +1335,13 @@
13351335 continue;
13361336 }
13371337 speed_now = FilterSpeed(i);
1338
- if(filter_deep[i] > 0 &&
1338
+ if (filter_deep[i] > 0 &&
13391339 speed_now > filter_speed[filter_deep[i]+1 - 2])
13401340 filter_deep[i] --;
1341
- else if(filter_deep[i] < 3 &&
1341
+ else if(filter_deep[i] < 3 &&
13421342 speed_now < filter_speed[filter_deep[i]+1 + 2])
13431343 filter_deep[i] ++;
1344
-
1344
+
13451345 FilterOne(i,ps_coe[filter_deep[i]],
13461346 pr_coe[filter_deep[i]],0-filter_able);
13471347 }
....@@ -1358,7 +1358,7 @@
13581358 int i;
13591359 for(i=0;i<8;i++)
13601360 {
1361
- if((unsigned int)*drv >= (key_range[i].up_down >> 16)
1361
+ if ((unsigned int)*drv >= (key_range[i].up_down >> 16)
13621362 && (unsigned int)*drv <= (key_range[i].up_down & 0xffff)
13631363 && (unsigned int)*sen >= (key_range[i].left_right >> 16)
13641364 && (unsigned int)*sen <= (key_range[i].left_right & 0xffff))
....@@ -1442,7 +1442,7 @@
14421442 if (point_num > point_num_max && global_flag.other.over_report_mask != 0)
14431443 {
14441444 point_num = 0;
1445
- cinfo->finger_num = 0;
1445
+ cinfo->finger_num = 0;
14461446 return;
14471447 }
14481448 for(i=0;i<POINT_MAX;i++)
....@@ -1511,9 +1511,9 @@
15111511 point_now[num].all = data[i];
15121512 cinfo->x[num] = (data[i] >> 16) & 0xfff;
15131513 cinfo->y[num] = data[i] & 0xfff;
1514
- cinfo->id[num] = data[i] >> 28;
1514
+ cinfo->id[num] = data[i] >> 28;
15151515 pressure_now[num] = pressure_report[i];
1516
- num ++;
1516
+ num++;
15171517 }
15181518 point_num = num;
15191519 cinfo->finger_num = num;
....@@ -1560,22 +1560,22 @@
15601560 for(i=0;i<4;i++)
15611561 {
15621562 if(stretch->up[i].range)
1563
- stretch->up[i].range =
1564
- stretch->up[i].range *
1563
+ stretch->up[i].range =
1564
+ stretch->up[i].range *
15651565 drv_num_nokey * 64 / screen_x_max;
15661566 if(stretch->down[i].range)
1567
- stretch->down[i].range =
1568
- (screen_x_max -
1569
- stretch->down[i].range) *
1567
+ stretch->down[i].range =
1568
+ (screen_x_max -
1569
+ stretch->down[i].range) *
15701570 drv_num_nokey * 64 / screen_x_max;
15711571 if(stretch->left[i].range)
1572
- stretch->left[i].range =
1573
- stretch->left[i].range *
1572
+ stretch->left[i].range =
1573
+ stretch->left[i].range *
15741574 sen_num_nokey * 64 / screen_y_max;
15751575 if(stretch->right[i].range)
1576
- stretch->right[i].range =
1577
- (screen_y_max -
1578
- stretch->right[i].range) *
1576
+ stretch->right[i].range =
1577
+ (screen_y_max -
1578
+ stretch->right[i].range) *
15791579 sen_num_nokey * 64 / screen_y_max;
15801580 }
15811581 break;
....@@ -1596,7 +1596,7 @@
15961596 break;
15971597 if(data[1] < stretch->left[i].range)
15981598 {
1599
- data[0] += (stretch->left[i].range - data[1]) *
1599
+ data[0] += (stretch->left[i].range - data[1]) *
16001600 stretch->left[i].coe/128;
16011601 data[1] = stretch->left[i].range;
16021602 }
....@@ -1615,7 +1615,7 @@
16151615 break;
16161616 if(data[1] < stretch->right[i].range)
16171617 {
1618
- data[0] += (stretch->right[i].range - data[1]) *
1618
+ data[0] += (stretch->right[i].range - data[1]) *
16191619 stretch->right[i].coe/128;
16201620 data[1] = stretch->right[i].range;
16211621 }
....@@ -1634,7 +1634,7 @@
16341634 break;
16351635 if(data[1] < stretch->up[i].range)
16361636 {
1637
- data[0] += (stretch->up[i].range - data[1]) *
1637
+ data[0] += (stretch->up[i].range - data[1]) *
16381638 stretch->up[i].coe/128;
16391639 data[1] = stretch->up[i].range;
16401640 }
....@@ -1653,7 +1653,7 @@
16531653 break;
16541654 if(data[1] < stretch->down[i].range)
16551655 {
1656
- data[0] += (stretch->down[i].range - data[1]) *
1656
+ data[0] += (stretch->down[i].range - data[1]) *
16571657 stretch->down[i].coe/128;
16581658 data[1] = stretch->down[i].range;
16591659 }
....@@ -1672,7 +1672,7 @@
16721672 static void PointStretch(void)
16731673 {
16741674 static int save_dr[POINT_MAX],save_dn[POINT_MAX];
1675
- typedef struct
1675
+ typedef struct
16761676 {
16771677 int dis;
16781678 int coe;
....@@ -1726,16 +1726,16 @@
17261726 }
17271727 else if(temp > point_edge.dis)
17281728 {
1729
- temp = (point_edge.dis * edge_first_coe / 0x80 - temp) *
1729
+ temp = (point_edge.dis * edge_first_coe / 0x80 - temp) *
17301730 0x1000 / point_edge.dis;
17311731 if(temp < point_edge.rate)
17321732 point_edge.rate = temp;
17331733 }
1734
- ps[0][i].other.x = point_edge.coor.other.x +
1735
- (ps[0][i].other.x - point_edge.coor.other.x) *
1734
+ ps[0][i].other.x = point_edge.coor.other.x +
1735
+ (ps[0][i].other.x - point_edge.coor.other.x) *
17361736 (0x1000 - point_edge.rate) / 0x1000;
1737
- ps[0][i].other.y = point_edge.coor.other.y +
1738
- (ps[0][i].other.y - point_edge.coor.other.y) *
1737
+ ps[0][i].other.y = point_edge.coor.other.y +
1738
+ (ps[0][i].other.y - point_edge.coor.other.y) *
17391739 (0x1000 - point_edge.rate) / 0x1000;
17401740 }
17411741 }
....@@ -1787,11 +1787,11 @@
17871787 }
17881788 else
17891789 {
1790
- ps[0][i].other.x = (int)ps[1][i].other.x +
1791
- ((int)pp[0][i].other.x -
1790
+ ps[0][i].other.x = (int)ps[1][i].other.x +
1791
+ ((int)pp[0][i].other.x -
17921792 (int)ps[1][i].other.x) * dr / dn;
1793
- ps[0][i].other.y = (int)ps[1][i].other.y +
1794
- ((int)pp[0][i].other.y -
1793
+ ps[0][i].other.y = (int)ps[1][i].other.y +
1794
+ ((int)pp[0][i].other.y -
17951795 (int)ps[1][i].other.y) * dr / dn;
17961796 }
17971797 if(dc[0] > 0)
....@@ -1799,11 +1799,11 @@
17991799 if(ps[0][i].all == ps[1][i].all && temp != ps[0][i].all)
18001800 {
18011801 ps[0][i].all = temp;
1802
- point_decimal[i].other.x +=
1803
- (short)ps[0][i].other.x -
1802
+ point_decimal[i].other.x +=
1803
+ (short)ps[0][i].other.x -
18041804 (short)ps[1][i].other.x;
1805
- point_decimal[i].other.y +=
1806
- (short)ps[0][i].other.y -
1805
+ point_decimal[i].other.y +=
1806
+ (short)ps[0][i].other.y -
18071807 (short)ps[1][i].other.y;
18081808 ps[0][i].other.x = ps[1][i].other.x;
18091809 ps[0][i].other.y = ps[1][i].other.y;
....@@ -1835,7 +1835,7 @@
18351835 }
18361836 }
18371837 }
1838
-
1838
+
18391839 }
18401840 else if(len >= 2)
18411841 {
....@@ -1851,7 +1851,7 @@
18511851 }
18521852 else
18531853 {
1854
- ds[0] = ds[1] + (128 - shake_all[0].coe) *
1854
+ ds[0] = ds[1] + (128 - shake_all[0].coe) *
18551855 (ds[1]-ds[2])/(shake_all[0].coe - shake_all[1].coe);
18561856 dc[0] = 128;
18571857 }
....@@ -1877,11 +1877,11 @@
18771877 {
18781878 dr = save_dr[i];
18791879 save_dn[i] = dn;
1880
- ps[0][i].other.x = (int)ps[1][i].other.x +
1881
- (((int)pp[0][i].other.x -
1880
+ ps[0][i].other.x = (int)ps[1][i].other.x +
1881
+ (((int)pp[0][i].other.x -
18821882 (int)ps[1][i].other.x) * dr) / 128;
1883
- ps[0][i].other.y = (int)ps[1][i].other.y +
1884
- (((int)pp[0][i].other.y -
1883
+ ps[0][i].other.y = (int)ps[1][i].other.y +
1884
+ (((int)pp[0][i].other.y -
18851885 (int)ps[1][i].other.y) * dr) / 128;
18861886 continue;
18871887 }
....@@ -1900,11 +1900,11 @@
19001900 save_dn[i] = dn;
19011901 // ps[0][i].x = (int)ps[1][i].x + ((int)pp[0][i].x - (int)ps[1][i].x) * dr / dn / 128;
19021902 // ps[0][i].y = (int)ps[1][i].y + ((int)pp[0][i].y - (int)ps[1][i].y) * dr / dn / 128;
1903
- ps[0][i].other.x = (int)ps[1][i].other.x +
1904
- (((int)pp[0][i].other.x -
1903
+ ps[0][i].other.x = (int)ps[1][i].other.x +
1904
+ (((int)pp[0][i].other.x -
19051905 (int)ps[1][i].other.x) * dr + 64) / 128;
1906
- ps[0][i].other.y = (int)ps[1][i].other.y +
1907
- (((int)pp[0][i].other.y -
1906
+ ps[0][i].other.y = (int)ps[1][i].other.y +
1907
+ (((int)pp[0][i].other.y -
19081908 (int)ps[1][i].other.y) * dr + 64) / 128;
19091909 break;
19101910 }
....@@ -1919,31 +1919,31 @@
19191919
19201920 static void ResetMask(void)
19211921 {
1922
- if(reset_mask_send)
1922
+ if (reset_mask_send)
19231923 {
19241924 reset_mask_send = 0;
19251925 }
19261926 if (global_state.other.mask)
19271927 return;
1928
- if(reset_mask_dis ==0 || reset_mask_type == 0)
1928
+ if (reset_mask_dis ==0 || reset_mask_type == 0)
19291929 return;
1930
- if(reset_mask_max == 0xfffffff1)
1930
+ if (reset_mask_max == 0xfffffff1)
19311931 {
1932
- if(point_num == 0)
1932
+ if (point_num == 0)
19331933 reset_mask_max = 0xf0000000 + 1;
19341934 return;
19351935 }
1936
- if(reset_mask_max > 0xf0000000)
1936
+ if (reset_mask_max > 0xf0000000)
19371937 {
19381938 reset_mask_max --;
1939
- if(reset_mask_max == 0xf0000000)
1939
+ if (reset_mask_max == 0xf0000000)
19401940 {
19411941 reset_mask_send = reset_mask_type;
19421942 global_state.other.mask = 1;
19431943 }
19441944 return;
19451945 }
1946
- if(point_num > 1 || pp[0][0].all == 0)
1946
+ if (point_num > 1 || pp[0][0].all == 0)
19471947 {
19481948 reset_mask_count = 0;
19491949 reset_mask_max = 0;
....@@ -1951,11 +1951,11 @@
19511951 return;
19521952 }
19531953 reset_mask_count ++;
1954
- if(reset_mask_max == 0)
1954
+ if (reset_mask_max == 0)
19551955 reset_mask_max = pp[0][0].all;
1956
- else
1957
- if(PointDistance((gsl_POINT_TYPE*)(&reset_mask_max),pp[0]) >
1958
- (((unsigned int)reset_mask_dis) & 0xffffff) &&
1956
+ else
1957
+ if (PointDistance((gsl_POINT_TYPE*)(&reset_mask_max),pp[0]) >
1958
+ (((unsigned int)reset_mask_dis) & 0xffffff) &&
19591959 reset_mask_count > (((unsigned int)reset_mask_dis) >> 24))
19601960 reset_mask_max = 0xfffffff1;
19611961 }
....@@ -2045,16 +2045,16 @@
20452045 static int DiagonalDistance(gsl_POINT_TYPE *p,int type)
20462046 {
20472047 int divisor,square;
2048
- divisor = ((int)sen_num_nokey * (int)sen_num_nokey +
2048
+ divisor = ((int)sen_num_nokey * (int)sen_num_nokey +
20492049 (int)drv_num_nokey * (int)drv_num_nokey)/16;
20502050 if(divisor == 0)
20512051 divisor = 1;
20522052 if(type == 0)
2053
- square = ((int)sen_num_nokey*(int)(p->other.x) -
2053
+ square = ((int)sen_num_nokey*(int)(p->other.x) -
20542054 (int)drv_num_nokey*(int)(p->other.y)) / 4;
20552055 else
2056
- square = ((int)sen_num_nokey*(int)(p->other.x) +
2057
- (int)drv_num_nokey*(int)(p->other.y) -
2056
+ square = ((int)sen_num_nokey*(int)(p->other.x) +
2057
+ (int)drv_num_nokey*(int)(p->other.y) -
20582058 (int)sen_num_nokey*(int)drv_num_nokey * 64) / 4;
20592059 return square * square / divisor;
20602060 }
....@@ -2117,14 +2117,14 @@
21172117 }
21182118 else if((point_corner & (0x3<<i*2)) == 0)
21192119 {
2120
- if ((ps[0][i].other.x <= diagonal_start &&
2120
+ if ((ps[0][i].other.x <= diagonal_start &&
21212121 ps[0][i].other.y <= diagonal_start) ||
2122
- (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start &&
2122
+ (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start &&
21232123 ps[0][i].other.y >= sen_num_nokey * 64 - diagonal_start))
21242124 point_corner |= 0x2<<i*2;
2125
- else if ((ps[0][i].other.x <= diagonal_start &&
2126
- ps[0][i].other.y >= sen_num_nokey * 64 - diagonal_start) ||
2127
- (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start &&
2125
+ else if ((ps[0][i].other.x <= diagonal_start &&
2126
+ ps[0][i].other.y >= sen_num_nokey * 64 - diagonal_start) ||
2127
+ (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start &&
21282128 ps[0][i].other.y <= diagonal_start))
21292129 point_corner |= 0x3<<i*2;
21302130 else
....@@ -2172,7 +2172,7 @@
21722172 pa[j][i] = pa[0][i];
21732173 continue;
21742174 }
2175
- j = (pressure_report[i]+1)/2 + pa[0][i] +
2175
+ j = (pressure_report[i]+1)/2 + pa[0][i] +
21762176 pa[1][i] + (pa[2][i]+1)/2 - pressure_report[i];
21772177 if(j >= 2)
21782178 j -= 2;
....@@ -2268,14 +2268,14 @@
22682268 double_click = '*';
22692269 // printk("sileadinc DoubleClick succeed double_click=%c\n",double_click);
22702270 }
2271
-}
2271
+}
22722272
22732273 static void gsl_id_reg_init(int flag)
22742274 {
22752275 int i,j;
22762276 for(j=0;j<POINT_DEEP;j++)
22772277 for(i=0;i<POINT_MAX;i++)
2278
- point_array[j][i].all = 0;
2278
+ point_array[j][i].all = 0;
22792279 for(j=0;j<PRESSURE_DEEP;j++)
22802280 for(i=0;i<POINT_MAX;i++)
22812281 pressure_array[j][i] = 0;
....@@ -2295,7 +2295,7 @@
22952295 reset_mask_max = 0;
22962296 reset_mask_count = 0;
22972297 point_near = 0;
2298
- point_corner = 0;
2298
+ point_corner = 0;
22992299 global_state.all = 0;
23002300 double_click = 0;
23012301 inte_count = 0;
....@@ -2490,7 +2490,7 @@
24902490 near_set[1] = conf[0x19]&0xffff;
24912491 diagonal = conf[0x1a];
24922492 //-------------------------
2493
-
2493
+
24942494 id_first_coe = conf[0x20];
24952495 id_speed_coe = conf[0x21];
24962496 id_static_coe = conf[0x22];
....@@ -2527,22 +2527,22 @@
25272527 edge_first = conf[0x48];
25282528 edge_first_coe = conf[0x49];
25292529 //goto_test
2530
-
2530
+
25312531 key_map_able = conf[0x60];
25322532 for(i=0;i<8*3;i++)
25332533 key_range_array[i] = conf[0x61+i];
2534
-
2534
+
25352535 coordinate_correct_able = conf[0x100];
25362536 for(i=0;i<4;i++)
25372537 {
2538
- multi_x_array[i] = conf[0x101+i];
2538
+ multi_x_array[i] = conf[0x101+i];
25392539 multi_y_array[i] = conf[0x105+i];
25402540 }
25412541 for(i=0;i<64;i++)
25422542 {
25432543 coordinate_correct_coe_x[i] = (conf[0x109+i/4]>>(i%4*8)) & 0xff;
25442544 coordinate_correct_coe_y[i] = (conf[0x109+64/4+i/4]>>(i%4*8)) & 0xff;
2545
- }
2545
+ }
25462546 for(i=0;i<4;i++)
25472547 {
25482548 for(j=0;j<64;j++)
....@@ -2609,8 +2609,8 @@
26092609 {
26102610 int i = 0;
26112611 int num_save;
2612
- if(((point_num & 0x100)!=0) ||
2613
- ((point_num & 0x200) != 0 &&
2612
+ if(((point_num & 0x100)!=0) ||
2613
+ ((point_num & 0x200) != 0 &&
26142614 global_state.other.reset == 1))
26152615 {
26162616 gsl_id_reg_init(0);
....@@ -2631,7 +2631,7 @@
26312631 global_state.other.ex = 1;
26322632 else
26332633 global_state.other.ex = 0;
2634
- inte_count ++;
2634
+ inte_count ++;
26352635 csensor_count = ((unsigned int)point_num)>>16;
26362636 num_save = point_num & 0xff;
26372637 if(num_save > POINT_MAX)
....@@ -2650,15 +2650,15 @@
26502650 point_num = cinfo->finger_num;
26512651 for(i=0;i<POINT_MAX;i++)
26522652 {
2653
- point_now[i].all = (cinfo->id[i]<<28) |
2653
+ point_now[i].all = (cinfo->id[i]<<28) |
26542654 (cinfo->x[i]<<16) | cinfo->y[i];
26552655 }
2656
-
2656
+
26572657 GetFlag();
26582658 if(DataCheck() == 0)
26592659 {
26602660 point_num = 0;
2661
- cinfo->finger_num = 0;
2661
+ cinfo->finger_num = 0;
26622662 return;
26632663 }
26642664 PressureSave();
....@@ -2682,7 +2682,7 @@
26822682 PointFilter();
26832683 GetPointNum(pr[0]);
26842684 #ifdef GESTURE_LICH
2685
- GestureMain(&(pr[0][0].all),point_num);
2685
+ GestureMain(&(pr[0][0].all),point_num);
26862686 #endif
26872687 PointDelay();
26882688 PointPressure();
....@@ -2749,14 +2749,14 @@
27492749 static int GestureDistance(GESTURE_POINT_TYPE* d1,GESTURE_POINT_TYPE* d2,int sqrt_able)
27502750 {
27512751 if(sqrt_able)
2752
- return GestureSqrt((d1->other.x - d2->other.x) *
2753
- (d1->other.x - d2->other.x) +
2754
- (d1->other.y - d2->other.y) *
2752
+ return GestureSqrt((d1->other.x - d2->other.x) *
2753
+ (d1->other.x - d2->other.x) +
2754
+ (d1->other.y - d2->other.y) *
27552755 (d1->other.y - d2->other.y));
27562756 else
2757
- return (d1->other.x - d2->other.x) *
2758
- (d1->other.x - d2->other.x) +
2759
- (d1->other.y - d2->other.y) *
2757
+ return (d1->other.x - d2->other.x) *
2758
+ (d1->other.x - d2->other.x) +
2759
+ (d1->other.y - d2->other.y) *
27602760 (d1->other.y - d2->other.y);
27612761 }
27622762
....@@ -2807,9 +2807,9 @@
28072807 return FALSE;
28082808 for(i=0;i<gesture_num;i++)
28092809 {
2810
- gesture_buf[i].other.x = (gesture_buf[i].other.x - x_min) *
2810
+ gesture_buf[i].other.x = (gesture_buf[i].other.x - x_min) *
28112811 GESTURE_SIZE_REFE / (x_max - x_min);
2812
- gesture_buf[i].other.y = (gesture_buf[i].other.y - y_min) *
2812
+ gesture_buf[i].other.y = (gesture_buf[i].other.y - y_min) *
28132813 GESTURE_SIZE_REFE / (y_max - y_min);
28142814 }
28152815 return TRUE;
....@@ -2833,7 +2833,7 @@
28332833 int len_his = 0;
28342834 int len_total = GestureLength();
28352835 gesture_standard[0].all = gesture_buf[0].all&0x0fffffff;
2836
- gesture_standard[GESTURE_SIZE_NUM - 1].all =
2836
+ gesture_standard[GESTURE_SIZE_NUM - 1].all =
28372837 gesture_buf[gesture_num -1].all&0x0fffffff;
28382838 for(i=1,n=0;i<GESTURE_SIZE_NUM-1;i++)
28392839 {
....@@ -2920,7 +2920,7 @@
29202920 {
29212921 int i;
29222922 for(i=0;i<gesture_num && i<GESTURE_BUF_SIZE;i++)
2923
- gesture_buf[i].all = ((gesture_buf[i].all & 0xfff) << 16) +
2923
+ gesture_buf[i].all = ((gesture_buf[i].all & 0xfff) << 16) +
29242924 ((gesture_buf[i].all>>16) & 0xffff);
29252925 }
29262926