Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262945AbUKXXmm (ORCPT ); Wed, 24 Nov 2004 18:42:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262901AbUKXXhV (ORCPT ); Wed, 24 Nov 2004 18:37:21 -0500 Received: from 80-218-63-145.dclient.hispeed.ch ([80.218.63.145]:8454 "EHLO ritz.dnsalias.org") by vger.kernel.org with ESMTP id S262945AbUKXX1E (ORCPT ); Wed, 24 Nov 2004 18:27:04 -0500 From: Daniel Ritz Reply-To: daniel.ritz@gmx.ch To: Greg KH Subject: [PATCH 2.6] touchkitusb: module_param to swap axes Date: Wed, 24 Nov 2004 22:28:53 +0100 User-Agent: KMail/1.5.4 Cc: linux-kernel MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200411242228.53446.daniel.ritz@gmx.ch> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1626 Lines: 53 add a module parameter to swap the axes. many displays need this... --- 1.2/drivers/usb/input/touchkitusb.c 2004-09-18 10:07:25 +02:00 +++ edited/drivers/usb/input/touchkitusb.c 2004-11-24 18:57:59 +01:00 @@ -59,6 +59,10 @@ #define DRIVER_AUTHOR "Daniel Ritz " #define DRIVER_DESC "eGalax TouchKit USB HID Touchscreen Driver" +static int swap_xy; +module_param(swap_xy, bool, 0); +MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); + struct touchkit_usb { unsigned char *data; dma_addr_t data_dma; @@ -80,6 +84,7 @@ { struct touchkit_usb *touchkit = urb->context; int retval; + int x, y; switch (urb->status) { case 0: @@ -103,13 +108,19 @@ goto exit; } + if (swap_xy) { + y = TOUCHKIT_GET_X(touchkit->data); + x = TOUCHKIT_GET_Y(touchkit->data); + } else { + x = TOUCHKIT_GET_X(touchkit->data); + y = TOUCHKIT_GET_Y(touchkit->data); + } + input_regs(&touchkit->input, regs); input_report_key(&touchkit->input, BTN_TOUCH, TOUCHKIT_GET_TOUCHED(touchkit->data)); - input_report_abs(&touchkit->input, ABS_X, - TOUCHKIT_GET_X(touchkit->data)); - input_report_abs(&touchkit->input, ABS_Y, - TOUCHKIT_GET_Y(touchkit->data)); + input_report_abs(&touchkit->input, ABS_X, x); + input_report_abs(&touchkit->input, ABS_Y, y); input_sync(&touchkit->input); exit: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/