From daniel.ritz-ml@swissonline.ch Wed Oct 11 14:41:36 2006 From: Daniel Ritz To: Greg KH , Dmitry Torokhov Subject: usbtouchscreen: fix data reading for ITM touchscreens Date: Wed, 11 Oct 2006 23:40:22 +0200 Cc: "linux-usb" Content-Disposition: inline Message-Id: <200610112340.23237.daniel.ritz-ml@swissonline.ch> [PATCH] usbtouchscreen: fix data reading for ITM touchscreens ITM devices seem to report only garbage when not touched. update usbtouchscreen to do data reading like itmtouch. also fix wrong mask on pressure bits. Signed-off-by: Daniel Ritz Signed-off-by: Greg Kroah-Hartman --- drivers/usb/input/usbtouchscreen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- gregkh-2.6.orig/drivers/usb/input/usbtouchscreen.c +++ gregkh-2.6/drivers/usb/input/usbtouchscreen.c @@ -256,10 +256,10 @@ static int itm_read_data(unsigned char * { *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); *y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); - *press = ((pkt[2] & 0x1F) << 7) | (pkt[5] & 0x7F); + *press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); *touch = ~pkt[7] & 0x20; - return 1; + return *touch; } #endif