Hi Greg
now i splittet the patch into two part

1. part : Simulate a pressure for tslib(input-raw)
2. part: Fix the urb->transfer_flags/dma (as done in hid-core.c)

--------------------------------------------------------------
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
--------------------------------------------------------------
From: Juergen Schindele <[EMAIL PROTECTED]>

This patch simulates a pressure to the input sub-system
when touchscreen is touched. With this Patch the input-raw
plugin from tslib can be used without modification.

Signed-off-by: Juergen Schindele <[EMAIL PROTECTED]>
---

--- 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 @@ static void touchkit_irq(struct urb *urb
 	}

 	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 @@ static int touchkit_probe(struct usb_int
 				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);
From: Juergen Schindele <[EMAIL PROTECTED]>

This patch corrects the URB initialisation for transfers
like this is done in other drivers too.
Without this patch no data was transmitted on a PXA270 OHCI
platform. May apply to others too.

Signed-off-by: Juergen Schindele <[EMAIL PROTECTED]>
---

--- 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
@@ -242,6 +242,9 @@ static int touchkit_probe(
 			 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);

Reply via email to