projects/linux·commit 77dc2db6

[PATCH] itmtouch: fix inverted flag to indicate touch location correctly, correct white space

77dc2db6 · Mark Assad <[email protected]> · 2006-10-05 12:25:05 +10:00

There is a bug in the current version of the itmtouch USB touchscreen
driver.  The if statment that checks if pressure is being applied to the
touch screen is now missing a ! (not), so events are no longer being
reported correctly.

The original source code for this line was as follows:

	#define UCP(x) ((unsigned char*)(x))
	#define UCOM(x,y,z) ((UCP((x)->transfer_buffer)[y]) & (z))

	...
	if (!UCOM(urb, 7, 0x20)) {

And was cleaned to:

	unsigned char *data = urb->transfer_buffer;
	....
	 if (data[7] & 0x20) {

(note the lack of '!')

This has been tested on an LG L1510BF and an LG1510SF touch screen.

Signed-off-by: Mark Assad <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
77dc2db6d1d2703ee4e83d4b3dbecf4e06a910e6
Parents
4b844718

Changes

1 files changed · +7 −3

FileStatusAddDelContent
drivers/usb/input/itmtouch.cmodified+7−3View file

drivers/usb/input/itmtouch.c

View file
diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c
index 61966d7..f3e3080 100644
--- a/drivers/usb/input/itmtouch.c
+++ b/drivers/usb/input/itmtouch.c
@@ -36,7 +36,11 @@
*
* 1.2.1 09/03/2005 (HCE) [email protected]
* Code cleanup and adjusting syntax to start matching kernel standards
- *
+ *
+ * 1.2.2 10/05/2006 (MJA) [email protected]
+ * Flag for detecting if the screen was being touch was incorrectly
+ * inverted, so no touch events were being detected.
+ *
*****************************************************************************/
#include <linux/kernel.h>
@@ -53,7 +57,7 @@
#define USB_PRODUCT_ID_TOUCHPANEL 0xf9e9
#define DRIVER_AUTHOR "Hans-Christian Egtvedt <[email protected]>"
-#define DRIVER_VERSION "v1.2.1"
+#define DRIVER_VERSION "v1.2.2"
#define DRIVER_DESC "USB ITM Inc Touch Panel Driver"
#define DRIVER_LICENSE "GPL"
@@ -108,7 +112,7 @@ static void itmtouch_irq(struct urb *urb, struct pt_regs *regs)
input_regs(dev, regs);
/* if pressure has been released, then don't report X/Y */
- if (data[7] & 0x20) {
+ if (!(data[7] & 0x20)) {
input_report_abs(dev, ABS_X, (data[0] & 0x1F) << 7 | (data[3] & 0x7F));
input_report_abs(dev, ABS_Y, (data[1] & 0x1F) << 7 | (data[4] & 0x7F));
}