Hello developers

i propose a patch for touchkitusb.c.
On my platform (PXA270 ohci) the driver is only
working with the following patch.

It contains two parts
- initialize urb->transfer_flags/dma (as done in hid-core.c)
- simulate a pressure-value for tslib(input-raw)

If you judge this patch useful please implement it for furter releases

 --- kernel-2.6.15.orig/drivers/usb/input/touchkitusb.c  2005-12-19 
11:56:51.000000000 +0100
+++ kernel-2.6.15/drivers/usb/input/touchkitusb.c       2006-01-04 
12:23:51.000000000 +0100
@@ -42,6 +42,8 @@
 #define TOUCHKIT_YC_FUZZ               0x0
 #define TOUCHKIT_YC_FLAT               0x0
 #define TOUCHKIT_REPORT_DATA_SIZE      8
+#define PRESSURE_MIN                   0
+#define PRESSURE_MAX                   15

 #define TOUCHKIT_DOWN                  0x01
 #define TOUCHKIT_POINT_TOUCH           0x81
@@ -114,10 +116,16 @@
        }

        input_regs(touchkit->input, regs);
-       input_report_key(touchkit->input, BTN_TOUCH,
-                        TOUCHKIT_GET_TOUCHED(touchkit->data));
        input_report_abs(touchkit->input, ABS_X, x);
        input_report_abs(touchkit->input, ABS_Y, y);
+       if (TOUCHKIT_GET_TOUCHED(touchkit->data)) {
+           input_report_key(touchkit->input, BTN_TOUCH, 1);
+           input_report_abs(touchkit->input, ABS_PRESSURE, PRESSURE_MAX);
+       }
+       else {
+           input_report_key(touchkit->input, BTN_TOUCH, 0);
+           input_report_abs(touchkit->input, ABS_PRESSURE, 0);
+       }
        input_sync(touchkit->input);

 exit:
@@ -227,12 +235,16 @@
                                TOUCHKIT_XC_FUZZ, TOUCHKIT_XC_FLAT);
        input_set_abs_params(input_dev, ABS_Y, TOUCHKIT_MIN_YC, 
TOUCHKIT_MAX_YC,
                                TOUCHKIT_YC_FUZZ, TOUCHKIT_YC_FLAT);
+       input_set_abs_params(input_dev, ABS_PRESSURE, PRESSURE_MIN, 
PRESSURE_MAX, 0, 0);

        usb_fill_int_urb(touchkit->irq, touchkit->udev,
                         usb_rcvintpipe(touchkit->udev, 0x81),
                         touchkit->data, TOUCHKIT_REPORT_DATA_SIZE,
                         touchkit_irq, touchkit, endpoint->bInterval);

+       touchkit->irq->transfer_dma = touchkit->data_dma;
+       touchkit->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
        input_register_device(touchkit->input);

        usb_set_intfdata(intf, touchkit);

--------------------------------------------------------------
Jürgen Schindele            NENTEC Netzwerktechnologie GmbH
Entwicklung                 Greschbachstrasse 12
                            76229 Karlsruhe/Germany
eMail:[EMAIL PROTECTED]   Phone: +49(0)721 94249-<51>
Web:   www.nentec.de        Fax:   +49(0)721 94249-10
--------------------------------------------------------------



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to