aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-02-15 12:44:02 +1100
committerDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2013-03-09 14:51:27 +0100
commit81c26dbb0a88be3471f31db9aa8f25b639f32eea (patch)
tree2749e0915c7d23535e71821d6f62836cb82b292a
parent284c83c0f1339c110a7b3a966823cf4d5f780941 (diff)
downloadkernel_goldelico_gta04-neil-rebase-3.7.zip
kernel_goldelico_gta04-neil-rebase-3.7.tar.gz
kernel_goldelico_gta04-neil-rebase-3.7.tar.bz2
tsc2007 fixes.neil-rebase-3.7
pressures is being reported inverted - fix that Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/input/touchscreen/tsc2007.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 1473d23..c37c31e 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -130,13 +130,17 @@ static u32 tsc2007_calculate_pressure(struct tsc2007 *tsc, struct ts_event *tc)
if (tc->x == MAX_12BIT)
tc->x = 0;
- if (likely(tc->x && tc->z1)) {
+ if (likely(tc->x && tc->z1 && tc->z2 > tc->z1)) {
/* compute touch pressure resistance using equation #1 */
rt = tc->z2 - tc->z1;
rt *= tc->x;
+#if 0
rt *= tsc->x_plate_ohms;
rt /= tc->z1;
rt = (rt + 2047) >> 12;
+#else
+ rt = (tc->z1 << (32-12)) / rt * 2048 / tsc->x_plate_ohms;
+#endif
}
return rt;