From patchwork Mon Apr 26 18:48:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hollis Blanchard X-Patchwork-Id: 95162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3QJVeBg009816 for ; Mon, 26 Apr 2010 19:31:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754960Ab0DZT3x (ORCPT ); Mon, 26 Apr 2010 15:29:53 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:37475 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754864Ab0DZT3w (ORCPT ); Mon, 26 Apr 2010 15:29:52 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 26 Apr 2010 19:31:41 +0000 (UTC) X-Greylist: delayed 2457 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Apr 2010 15:29:52 EDT Received: from svr-orw-exc-08.mgc.mentorg.com ([147.34.98.97]) by relay1.mentorg.com with esmtp id 1O6TMU-0004Jr-EX from Hollis_Blanchard@mentor.com ; Mon, 26 Apr 2010 11:48:54 -0700 Received: from na3-mail.mgc.mentorg.com ([147.34.99.66]) by SVR-ORW-EXC-08.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 26 Apr 2010 11:48:53 -0700 Received: from [172.30.11.149] ([172.30.11.149]) by na3-mail.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Apr 2010 11:48:31 -0700 Subject: hack for Lilliput 669GL-70NP/C/T 7" USB touchscreen From: Hollis Blanchard To: Daniel Ritz Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Organization: Mentor Graphics, Embedded Systems Division Date: Mon, 26 Apr 2010 11:48:21 -0700 Message-ID: <1272307701.19363.69.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) X-OriginalArrivalTime: 26 Apr 2010 18:48:31.0459 (UTC) FILETIME=[111BF330:01CAE571] Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 68ece58..e9597fa 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -252,6 +252,7 @@ static int e2i_read_data(struct usbtouch_usb *dev, unsigned #define EGALAX_PKT_TYPE_REPT 0x80 #define EGALAX_PKT_TYPE_DIAG 0x0A +#if 0 static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) { if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) @@ -279,6 +280,34 @@ static int egalax_get_pkt_len(unsigned char *buf, int len) return 0; } + +#else + +static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +{ + if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != 2) + return 0; + + dev->x = (pkt[5] << 8) | pkt[4]; + dev->y = (pkt[3] << 8) | pkt[2]; + dev->touch = pkt[1] & 0x01; + + return 1; +} + +static int egalax_get_pkt_len(unsigned char *buf, int len) +{ + switch (buf[0] & EGALAX_PKT_TYPE_MASK) { + case 2: + return 6; + default: + printk(KERN_WARNING "%s: unknown packet type 0x%x\n", __func__, buf[0]); + } + + return 0; +} +#endif + #endif