FORUMS

The OnePlus 2 & The Year of Smartphone Compromises

We are very close to entering the last third of 2015, and we have now seen many of … more

OnePlus 2 Teardown, Major Android Vulnerability – XDA TV

The OnePlus 2 has been officially released. That and much more news is … more

What Do You Think About Fingerprint Scanners?

More and more phones are featuring fingerprint scanners, and with many promising … more

What’s Next for Samsung and Its Flagships?

If we were to say that the Galaxy S6 was a leap of faith made by Samsung, we … more

Kernel patch for 3-10 point multi-touch

189 posts
Thanks Meter: 232
 
By tchebb, Recognized Developer on 19th December 2010, 05:04 AM
Post Reply Subscribe to Thread Email Thread
I've had this patch for a while now, but I decided to finally post it here in the hope it might help someone. I kept hearing about how much better the Incredible's touchscreen is compared to the Nexus One's, so I wondered why it could only handle a maximum of 2 touches. It seems that the Incredible uses the Atmel mXT224 as its touch controller. The summary from Atmel clearly states "True 12-bit multiple touch with independent XY tracking for up to 10 concurrent touches in real time with touch size reporting." It turns out, it's actually quite a simple kernel mod to enable all 10 touches (although I've noticed the tracking quality start to degrade above 5). I've been running this on my Incredible for a month or so, and I've noticed no ill effects from it.

All you need to do is edit arch/arm/mach-msm/board-incrediblec.c, and replace
Code:
struct atmel_i2c_platform_data incrediblec_atmel_ts_data[] = {
	{
		.version = 0x016,
		.abs_x_min = 1,
		.abs_x_max = 1023,
		.abs_y_min = 2,
		.abs_y_max = 966,
		.abs_pressure_min = 0,
		.abs_pressure_max = 255,
		.abs_width_min = 0,
		.abs_width_max = 20,
		.gpio_irq = INCREDIBLEC_GPIO_TP_INT_N,
		.power = incrediblec_atmel_ts_power,
		.config_T6 = {0, 0, 0, 0, 0, 0},
		.config_T7 = {50, 15, 25},
		.config_T8 = {10, 0, 20, 10, 0, 0, 5, 15},
		.config_T9 = {139, 0, 0, 18, 12, 0, 16, 38, 3, 7, 0, 5, 2, 15, 2, 10, 25, 5, 0, 0, 0, 0, 0, 0, 0, 0, 159, 47, 149, 81, 40},
		.config_T15 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T19 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T20 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T22 = {15, 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, 0, 7, 18, 25, 30, 0},
		.config_T23 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T24 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T25 = {3, 0, 200, 50, 64, 31, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T27 = {0, 0, 0, 0, 0, 0, 0},
		.config_T28 = {0, 0, 2, 4, 8, 60},
		.object_crc = {0xDB, 0xBF, 0x60},
		.cable_config = {35, 30, 8, 16},
		.GCAF_level = {20, 24, 28, 40, 63},
		.filter_level = {15, 60, 963, 1008},
	},
	{
		.version = 0x015,
		.abs_x_min = 13,
		.abs_x_max = 1009,
		.abs_y_min = 15,
		.abs_y_max = 960,
		.abs_pressure_min = 0,
		.abs_pressure_max = 255,
		.abs_width_min = 0,
		.abs_width_max = 20,
		.gpio_irq = INCREDIBLEC_GPIO_TP_INT_N,
		.power = incrediblec_atmel_ts_power,
		.config_T6 = {0, 0, 0, 0, 0, 0},
		.config_T7 = {50, 15, 25},
		.config_T8 = {12, 0, 20, 20, 0, 0, 20, 0},
		.config_T9 = {139, 0, 0, 18, 12, 0, 32, 40, 2, 7, 0, 5, 2, 0, 2, 10, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, 47, 149, 81},
		.config_T15 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T19 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T20 = {7, 0, 0, 0, 0, 0, 0, 30, 20, 4, 15, 5},
		.config_T22 = {7, 0, 0, 25, 0, -25, 255, 4, 50, 0, 1, 10, 15, 20, 25, 30, 4},
		.config_T23 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T24 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T25 = {3, 0, 200, 50, 64, 31, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T27 = {0, 0, 0, 0, 0, 0, 0},
		.config_T28 = {0, 0, 2, 4, 8, 60},
		.object_crc = {0x19, 0x87, 0x7E},
	},
	{
		.version = 0x014,
		.abs_x_min = 13,
		.abs_x_max = 1009,
		.abs_y_min = 15,
		.abs_y_max = 960,
		.abs_pressure_min = 0,
		.abs_pressure_max = 255,
		.abs_width_min = 0,
		.abs_width_max = 20,
		.gpio_irq = INCREDIBLEC_GPIO_TP_INT_N,
		.power = incrediblec_atmel_ts_power,
		.config_T6 = {0, 0, 0, 0, 0, 0},
		.config_T7 = {50, 15, 25},
		.config_T8 = {12, 0, 20, 20, 0, 0, 10, 15},
		.config_T9 = {3, 0, 0, 18, 12, 0, 48, 45, 2, 7, 0, 0, 0, 0, 2, 10, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 47, 143, 81},
		.config_T15 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T19 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T20 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T22 = {5, 0, 0, 25, 0, -25, 255, 4, 50, 0, 1, 10, 15, 20, 25, 30, 4},
		.config_T23 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T24 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T25 = {3, 0, 200, 50, 64, 31, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T27 = {0, 0, 0, 0, 0, 0, 0},
		.config_T28 = {0, 0, 2, 4, 8, 60},
	}
};
with
Code:
struct atmel_i2c_platform_data incrediblec_atmel_ts_data[] = {
	{
		.version = 0x016,
		.abs_x_min = 1,
		.abs_x_max = 1023,
		.abs_y_min = 2,
		.abs_y_max = 966,
		.abs_pressure_min = 0,
		.abs_pressure_max = 255,
		.abs_width_min = 0,
		.abs_width_max = 20,
		.gpio_irq = INCREDIBLEC_GPIO_TP_INT_N,
		.power = incrediblec_atmel_ts_power,
		.config_T6 = {0, 0, 0, 0, 0, 0},
		.config_T7 = {50, 15, 25},
		.config_T8 = {10, 0, 20, 10, 0, 0, 5, 15},
		.config_T9 = {139, 0, 0, 18, 12, 0, 16, 38, 3, 7, 0, 5, 2, 15, 10, 10, 25, 5, 0, 0, 0, 0, 0, 0, 0, 0, 159, 47, 149, 81, 40},
		.config_T15 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T19 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T20 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T22 = {15, 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, 0, 7, 18, 25, 30, 0},
		.config_T23 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T24 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T25 = {3, 0, 200, 50, 64, 31, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T27 = {0, 0, 0, 0, 0, 0, 0},
		.config_T28 = {0, 0, 2, 4, 8, 60},
		.object_crc = {0xDB, 0xBF, 0x60},
		.cable_config = {35, 30, 8, 16},
		.GCAF_level = {20, 24, 28, 40, 63},
		.filter_level = {15, 60, 963, 1008},
	},
	{
		.version = 0x015,
		.abs_x_min = 13,
		.abs_x_max = 1009,
		.abs_y_min = 15,
		.abs_y_max = 960,
		.abs_pressure_min = 0,
		.abs_pressure_max = 255,
		.abs_width_min = 0,
		.abs_width_max = 20,
		.gpio_irq = INCREDIBLEC_GPIO_TP_INT_N,
		.power = incrediblec_atmel_ts_power,
		.config_T6 = {0, 0, 0, 0, 0, 0},
		.config_T7 = {50, 15, 25},
		.config_T8 = {12, 0, 20, 20, 0, 0, 20, 0},
		.config_T9 = {139, 0, 0, 18, 12, 0, 32, 40, 2, 7, 0, 5, 2, 0, 10, 10, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, 47, 149, 81},
		.config_T15 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T19 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T20 = {7, 0, 0, 0, 0, 0, 0, 30, 20, 4, 15, 5},
		.config_T22 = {7, 0, 0, 25, 0, -25, 255, 4, 50, 0, 1, 10, 15, 20, 25, 30, 4},
		.config_T23 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T24 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T25 = {3, 0, 200, 50, 64, 31, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T27 = {0, 0, 0, 0, 0, 0, 0},
		.config_T28 = {0, 0, 2, 4, 8, 60},
		.object_crc = {0x19, 0x87, 0x7E},
	},
	{
		.version = 0x014,
		.abs_x_min = 13,
		.abs_x_max = 1009,
		.abs_y_min = 15,
		.abs_y_max = 960,
		.abs_pressure_min = 0,
		.abs_pressure_max = 255,
		.abs_width_min = 0,
		.abs_width_max = 20,
		.gpio_irq = INCREDIBLEC_GPIO_TP_INT_N,
		.power = incrediblec_atmel_ts_power,
		.config_T6 = {0, 0, 0, 0, 0, 0},
		.config_T7 = {50, 15, 25},
		.config_T8 = {12, 0, 20, 20, 0, 0, 10, 15},
		.config_T9 = {3, 0, 0, 18, 12, 0, 48, 45, 2, 7, 0, 0, 0, 0, 10, 10, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 47, 143, 81},
		.config_T15 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T19 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T20 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T22 = {5, 0, 0, 25, 0, -25, 255, 4, 50, 0, 1, 10, 15, 20, 25, 30, 4},
		.config_T23 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T24 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T25 = {3, 0, 200, 50, 64, 31, 0, 0, 0, 0, 0, 0, 0, 0},
		.config_T27 = {0, 0, 0, 0, 0, 0, 0},
		.config_T28 = {0, 0, 2, 4, 8, 60},
	}
};
For those who didn't spot the change, it's in config_t9 (highlighted in bold). You can, of course, change the 10 to anything you want (I've only tested with between 2 and 10, though) and that will be set as the maximum number of touches.

I hope this helps someone.
Last edited by tchebb; 19th December 2010 at 06:14 AM.
The Following 8 Users Say Thank You to tchebb For This Useful Post: [ View ]
 
 
19th December 2010, 06:09 AM |#2  
Senior Member
Flag Columbus
Thanks Meter: 18
 
Donate to Me
More
I have been digging for this forever! THANKS!!!
Last edited by seanzer; 19th December 2010 at 08:52 AM.
19th December 2010, 06:44 AM |#3  
Senior Member
Thanks Meter: 31
 
More
This actually seems quite useful and I wasn't even aware this was possible! Two quick questions if you don't mind - first of all, did you mean that enabling above 5 touch points would cause tracking to degrade, or just using it (having 5 or more fingers on the screen would cause tracking to degrade)? Also, howdy I go about editing this file in the first place? Thanks!
19th December 2010, 06:47 AM |#4  
Senior Member
Thanks Meter: 43
 
More
I'm not savvy enough to change it without a .zip flash. However, it'll be nice to see this incorporated into some custom kernels soon
19th December 2010, 07:09 AM |#5  
Member
Boston
Thanks Meter: 4
 
More
Quote:
Originally Posted by mikeymop

I'm not savvy enough to change it without a .zip flash. However, it'll be nice to see this incorporated into some custom kernels soon

These are changes applied to the kernel source, so not a file on your phone that is to be edited. Someone would need to make the changes to the source code files and then recompile the kernel (which you could then flash)... perhaps invisiblek can add it to his next kernel release?
19th December 2010, 07:13 AM |#6  
OP Recognized Developer
Flag Waltham, MA
Thanks Meter: 232
 
Donate to Me
More
Quote:
Originally Posted by xShin

This actually seems quite useful and I wasn't even aware this was possible! Two quick questions if you don't mind - first of all, did you mean that enabling above 5 touch points would cause tracking to degrade, or just using it (having 5 or more fingers on the screen would cause tracking to degrade)? Also, howdy I go about editing this file in the first place? Thanks!

I haven't done extensive testing, but the tracking at up to 5 points seems to be about the same quality no matter how many you have enabled. As for editing the file, you need to recompile the kernel and flash an update.zip with the new one. I'll patch the stock HTC Sense kernel and post a pre-compiled update.zip tomorrow. If you use a different kernel, you can either download and patch the source yourself, or send a request to the kernel author that this patch be included by default.
19th December 2010, 12:11 PM |#8  
Senior Member
Thanks Meter: 20
 
More
This is cool, but do any programs utilize more than two touch points?
19th December 2010, 02:02 PM |#9  
Senior Member
Thanks Meter: 9,456
 
Donate to Me
More
Quote:
Originally Posted by megarek

This is cool, but do any programs utilize more than two touch points?

Exactly this.
19th December 2010, 02:24 PM |#10  
djh816's Avatar
Recognized Developer
Thanks Meter: 235
 
Donate to Me
More
Quote:
Originally Posted by invisiblek

cool, thanks!

does this mean you're going to include in your kern now??
19th December 2010, 03:13 PM |#11  
Senior Member
Flag Washington, DC
Thanks Meter: 2
 
More
None right now, but with the advent of Honeycomb we may see apps start accepting 3+ finger input.

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes