[Android General] gabil1n:
i think my error of the touch is for the touchpad driver inside boot.img i need do this http://xdaforums.com/showpost.php?p=51313136&postcount=386 i dont know how to but i think is the solution for touchproblems and backbutton

Touchpanel config for GT818B driver (may work with others)

With stock kernel installed

1. Search and dump file "/proc/gt818_config" (driver config)

2. Search and dump file "/sys/board_properties/virtualkeys.mtk-tpd" (buttons/touch keys coordinates)

File content explanation:

Code:

0x01:139:108:1006:40:40:0x01:172:216:1006:40:40:0x01:158:324:1006:40:40:0x01:217:432:1006:40:40

0x01:139: - key1 code

108:1006:40:40: - key1 coordinates:width:height

0x01:172: - key2 code

216:1006:40:40: - key2 coordinates:width:height

0x01:158: - key3 code

324:1006:40:40: - key3 coordinates:width:height

0x01:217: - key4 code

432:1006:40:40 - key4 coordinates:width:height

3. Search and dump file "/sys/module/tpd_settings/parameters/tpd_calmat" (calibration matrix settings)

Custom kernel driver (GT818B) config file

4. Edit file "/mediatek/custom/[your project]/kernel/touchpanel/GT818B/tp_custom_GT818B.h"

5. Change line:

"#define TPD_CALIBRATION_MATRIX {1082,0,0,0,1920,0,0,0};" with values from previous step 3 where "1082=LCM width*2+2" and "1920=LCM Heigth*2".

6. Change line:

"#define TPD_VIRTUAL_KEY_MAX (4)" to number of keys of your phone.

7. Change line:

"#define TPD_KEY_COUNT 4" to number of keys of your phone.

8. Change line:

"#define TPD_KEYS {KEY_MENU, KEY_HOMEPAGE, KEY_BACK, KEY_SEARCH}" to your keys.

9. Change line:

"#define TPD_KEYS_DIM {{108,1006,40,40},{216,1006,40,40},{324,1006,40,40 },{432,1006,40,40}}" with values from previous step 2.

10. Change lines:

"#define TPD_X_RES (540)" to your LCM width

"#define TPD_Y_RES (960)" to your LCM heigth.

11. Edit file "gt818_config" and replace all spaces with commas "," except last space if exist just like this:

Code:

==== GT818 config init value====

0x12,0x10,0x0E,0x0C,0x0A,0x08,0x06,0x04,

0x02,0x00,0x03,0x33,0x13,0x33,0x23,0x33,

0x33,0x33,0x43,0x33,0x53,0x33,0x63,0x33,

0x73,0x33,0x83,0x33,0x93,0x33,0xA3,0x33,

0xB3,0x33,0xC3,0x33,0xD3,0x33,0xE3,0x33,

0xF3,0x33,0x17,0x13,0xB0,0xB0,0xB0,0x2A,

0x2A,0x2A,0x10,0x0F,0x0A,0x50,0x40,0x4D,

0x03,0x00,0x05,0x1C,0x02,0xC0,0x03,0x00,

0x00,0x5C,0x56,0x60,0x59,0x00,0x00,0x26,

0x14,0x25,0x08,0x00,0x00,0x00,0x00,0x00,

0x18,0x14,0xC3,0x03,0x00,0x00,0x00,0x00,

0x00,0x00,0x1D,0x45,0x6B,0x93,0x0D,0x50,

0x40,0x35,0x25,0x00,0x00,0x00,0x00,0x00,

0x00,0x01

11.a. Replace hexadecimal code after line "static u8 cfg_data_version_d[] =" with code in section "==== GT818 config init value====" from step 11.

11.b. Replace hexadecimal code after line "static u8 cfg_data_with_charger_version_d[] =" with code in section "==== GT818 charger init config====" from step 11.

12. If you experience mirror effect on Y Axis (tap on top and click happens down or vice-versa) change line:

"#define TPD_WARP_Y(y) ( y )" to "#define TPD_WARP_Y(y) ( TPD_Y_RES - 1 - y )"

12.a. If you experience mirror effect on X Axis (tap on left and click happens right or vice-versa) change line:

"#define TPD_WARP_X(x) ( x )" to "#define TPD_WARP_X(x) ( TPD_X_RES - 1 - x )"

Custom kernel Touchpanel driver config

13. Edit file "/mediatek/custom/common/kernel/touchpanel/src/tp_setting.c"

14. Change lines:

"int TPD_RES_X = 540;" to your LCM width

"int TPD_RES_Y = 960;" to your LCM heigth.

15. Change lines:

"int tpd_mode_min = 480;" where 480 is you LCM heigth/2

"int tpd_mode_max = 960;" where 960 is your LCM height

16. Change line:

"int tpd_mode_keypad_tolerance = 540*540/1600;" where 540 is your LCM width

17. Test and pray to work.

The above configuration is for my phone and it works.