lkml.org 
[lkml]   [2011]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform data parameter
Date
This originates from a patch in Meego IVI kernel with the name
linux-2.6.37-connext-0027-tsc2007.patch
There is no author info excepte a line "From MeeGo <kernel@meego.com>"

When integrating tsc2007 on Intel IVI platform, there are a lot of noise
data whose z1 value is around 10 which is not a sane "z1". So add
a "z1_low_threshhold" to filter those nosie data, to make the device work
properly.

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
drivers/input/touchscreen/tsc2007.c | 4 +++-
include/linux/i2c/tsc2007.h | 1 +
2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 789f216..1bf3503 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -72,6 +72,7 @@ struct tsc2007 {
u16 model;
u16 x_plate_ohms;
u16 max_rt;
+ u16 z1_low_threshhold;
unsigned long poll_delay;
unsigned long poll_period;

@@ -130,7 +131,7 @@ 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 > tsc->z1_low_threshhold)) {
/* compute touch pressure resistance using equation #1 */
rt = tc->z2 - tc->z1;
rt *= tc->x;
@@ -313,6 +314,7 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
ts->model = pdata->model;
ts->x_plate_ohms = pdata->x_plate_ohms;
ts->max_rt = pdata->max_rt ? : MAX_12BIT;
+ ts->z1_low_threshhold = pdata->z1_low_threshhold ? : 1;
ts->poll_delay = pdata->poll_delay ? : 1;
ts->poll_period = pdata->poll_period ? : 1;
ts->get_pendown_state = pdata->get_pendown_state;
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h
index 506a9f7..638c6c7 100644
--- a/include/linux/i2c/tsc2007.h
+++ b/include/linux/i2c/tsc2007.h
@@ -7,6 +7,7 @@ struct tsc2007_platform_data {
u16 model; /* 2007. */
u16 x_plate_ohms; /* must be non-zero value */
u16 max_rt; /* max. resistance above which samples are ignored */
+ u16 z1_low_threshhold; /* threshhold to prevent some noise data */
unsigned long poll_delay; /* delay (in ms) after pen-down event
before polling starts */
unsigned long poll_period; /* time (in ms) between samples */
--
1.7.1


\
 
 \ /
  Last update: 2011-11-29 09:15    [W:0.065 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site