lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 29 Nov 2011 16:12:58 +0800
From:	Feng Tang <feng.tang@...el.com>
To:	dtor@...l.ru, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org, kwlee@...kvision.com
Cc:	joel.clark@...el.com, Feng Tang <feng.tang@...el.com>
Subject: [PATCH 2/2] Input: tsc2007 - Add a z1_low_threshhold platform data parameter

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@...go.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@...el.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ