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-07-21 00:12:03 +0200
commitfb8f7dcb076c73022c345a7e7c1d22f183b55255 (patch)
treea5afad0d67288804d9de5ac271bd0f1325d88a9e
parent81c7e952105b27b25708e5734ff55cc96da6aef0 (diff)
downloadkernel_goldelico_gta04-fb8f7dcb076c73022c345a7e7c1d22f183b55255.zip
kernel_goldelico_gta04-fb8f7dcb076c73022c345a7e7c1d22f183b55255.tar.gz
kernel_goldelico_gta04-fb8f7dcb076c73022c345a7e7c1d22f183b55255.tar.bz2
tsc2007 fixes.
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 0b67ba4..4ae2fb6 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;