Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,814,105 Members 44,784 Now Online
XDA Developers Android and Mobile Development Forum

Kernel patch for 3-10 point multi-touch

Tip us?
 
tchebb
Old
(Last edited by tchebb; 19th December 2010 at 06:14 AM.)
#1  
Senior Member - OP
Thanks Meter 214
Posts: 187
Join Date: Jul 2010
Location: Waltham, MA

 
DONATE TO ME
Default Kernel patch for 3-10 point multi-touch

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.
The Following 8 Users Say Thank You to tchebb For This Useful Post: [ Click to Expand ]
 
seanzer
Old
(Last edited by seanzer; 19th December 2010 at 08:52 AM.)
#2  
Senior Member
Thanks Meter 18
Posts: 371
Join Date: Jun 2010
Location: Columbus

 
DONATE TO ME
I have been digging for this forever! THANKS!!!
 
xShin
Old
#3  
Senior Member
Thanks Meter 26
Posts: 351
Join Date: Oct 2010
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!
HTC One M8 S-OFF running InsertCoin

HTC One M7 (Stock) - Retired
HTC Droid DNA S-OFF'd using revone - Retired
HTC Rezound S-OFF - Retired
HTC Droid Incredible - Retired
 
mikeymop
Old
#4  
Senior Member
Thanks Meter 40
Posts: 531
Join Date: Aug 2010
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
Nexus 4 | Stock rooted w/ random kernel

HTC Incredible | UnEVOked S-OFF | 2.15.0.5.06 Radio | cm7.2 | Incredikernel
 
igknighted
Old
#5  
Member
Thanks Meter 4
Posts: 79
Join Date: Oct 2010
Location: Boston
Quote:
Originally Posted by mikeymop View Post
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?
HTC Incredible - CyanogenMod 6.1 (nightly 175) - Gingerbread Theme - InvisibleK #17 - 09.01 Radio
 
tchebb
Old
#6  
Senior Member - OP
Thanks Meter 214
Posts: 187
Join Date: Jul 2010
Location: Waltham, MA

 
DONATE TO ME
Quote:
Originally Posted by xShin View Post
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.
 
megarek
Old
#8  
Senior Member
Thanks Meter 20
Posts: 205
Join Date: Jan 2007
This is cool, but do any programs utilize more than two touch points?
 
chad0989
Old
#9  
Senior Member
Thanks Meter 9,453
Posts: 1,883
Join Date: Oct 2010

 
DONATE TO ME
Quote:
Originally Posted by megarek View Post
This is cool, but do any programs utilize more than two touch points?
Exactly this.
 
djh816
Old
#10  
djh816's Avatar
Recognized Developer
Thanks Meter 174
Posts: 492
Join Date: Jul 2009

 
DONATE TO ME
Quote:
Originally Posted by invisiblek View Post
cool, thanks!
does this mean you're going to include in your kern now??
Please press thanks if I helped you!

Androids:
HTC One M8 (VZW) - CM11 Nightlies
Samsung Galaxy Tab Pro 8.4 - CM11 Nightlies

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Add Some Power to First Generation Snapdragon CPUs

Some older devices still remain very popular. Phones like theHTC Desire, Sony Ericsson … more

Android M Mentions Spotted in Android Code Review

While we are still waiting for Android L to be officially released, the first mentions of … more

Create a Simple Custom Launcher from Scratch

When you are starting your journey intoany sort of development, it’s never easy at the … more