ChangeSet 1.2223.2.19, 2004/11/29 16:10:39-08:00, [EMAIL PROTECTED] [PATCH] USB touchkitusb: module_param to swap axes
add a module parameter to swap the axes. many displays need this... Signed-off-by: Daniel Ritz <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> drivers/usb/input/touchkitusb.c | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c --- a/drivers/usb/input/touchkitusb.c 2004-11-30 15:42:49 -08:00 +++ b/drivers/usb/input/touchkitusb.c 2004-11-30 15:42:49 -08:00 @@ -59,6 +59,10 @@ #define DRIVER_AUTHOR "Daniel Ritz <[EMAIL PROTECTED]>" #define DRIVER_DESC "eGalax TouchKit USB HID Touchscreen Driver" +static int swap_xy; +module_param(swap_xy, bool, 0644); +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: ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel