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

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 <massad@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Mark Assad and committed by Linus Torvalds 77dc2db6 4b844718

+7 -3
+7 -3
drivers/usb/input/itmtouch.c
··· 36 36 * 37 37 * 1.2.1 09/03/2005 (HCE) hc@mivu.no 38 38 * Code cleanup and adjusting syntax to start matching kernel standards 39 - * 39 + * 40 + * 1.2.2 10/05/2006 (MJA) massad@gmail.com 41 + * Flag for detecting if the screen was being touch was incorrectly 42 + * inverted, so no touch events were being detected. 43 + * 40 44 *****************************************************************************/ 41 45 42 46 #include <linux/kernel.h> ··· 57 53 #define USB_PRODUCT_ID_TOUCHPANEL 0xf9e9 58 54 59 55 #define DRIVER_AUTHOR "Hans-Christian Egtvedt <hc@mivu.no>" 60 - #define DRIVER_VERSION "v1.2.1" 56 + #define DRIVER_VERSION "v1.2.2" 61 57 #define DRIVER_DESC "USB ITM Inc Touch Panel Driver" 62 58 #define DRIVER_LICENSE "GPL" 63 59 ··· 112 108 input_regs(dev, regs); 113 109 114 110 /* if pressure has been released, then don't report X/Y */ 115 - if (data[7] & 0x20) { 111 + if (!(data[7] & 0x20)) { 116 112 input_report_abs(dev, ABS_X, (data[0] & 0x1F) << 7 | (data[3] & 0x7F)); 117 113 input_report_abs(dev, ABS_Y, (data[1] & 0x1F) << 7 | (data[4] & 0x7F)); 118 114 }