--- drivers/hid/usbhid/hid-core.c.orig	2007-11-07 10:21:28.133893599 +0000
+++ drivers/hid/usbhid/hid-core.c	2007-11-07 11:11:43.345019302 +0000
@@ -179,6 +179,69 @@
 }
 
 /*
+ * Filter BTC 9019 URF Mouse Report.
+ */
+#define BTC_VENDOR	(0x046e)
+#define BTC_PRODUCT	(0x5250)
+#define BTC_TYPE	(0)
+#define BTC_KEY		(1)
+#define BTC_X		(2)
+#define BTC_Y		(3)
+#define BTC_WHEEL	(4)
+static void hid_filter_btc9019urf_report(struct hid_device *hid, u8 *data, int size)
+{
+	static unsigned long nextwheel = 0, nextmouse = 0;
+
+	/* Detect BTC 9019 URF */
+	if(! ( hid->vendor == BTC_VENDOR && hid->product == BTC_PRODUCT ) ) {
+		return; /* Not detected */
+	}
+	/* Detect BTC 9019 URF Mouse Report */
+	if(! ( data[BTC_TYPE] == 4 && size == 5 ) ) {
+		return; /* Not detected */
+	}
+	/*
+	 * Filter dead zone +/- 1
+	 */
+	if(data[BTC_X] >= 128)
+		data[BTC_X] += 1;
+	else if(data[BTC_X] > 0)
+		data[BTC_X] -= 1;
+
+	if(data[BTC_Y] >= 128)
+		data[BTC_Y] += 1;
+	else if(data[BTC_Y] > 0)
+		data[BTC_Y] -= 1;
+	/*
+	 * Rate limit scroll button reports
+	 */
+	if(data[BTC_WHEEL]) {
+		if(jiffies < nextwheel) {
+			data[BTC_WHEEL] = 0;
+		} else {
+			int factor = 6;
+			if(data[BTC_Y]) {
+				if(data[BTC_Y] >= 128) {
+					factor = factor << (257 - data[BTC_Y]);
+					data[BTC_WHEEL] = +1;
+				}
+				else if(data[BTC_Y] > 0) {
+					factor = factor << (1   + data[BTC_Y]);
+					data[BTC_WHEEL] = -1;
+				}
+			}
+			nextwheel= jiffies + (HZ / factor);
+		}
+		nextmouse= jiffies + (HZ >> 2);
+	}
+	/*
+	 * Kill mouse move whilst scrolling
+	 */
+	if(jiffies < nextmouse)
+		data[BTC_X] = data[BTC_Y] = 0;
+}
+
+/*
  * Input interrupt completion handler.
  */
 
@@ -191,6 +254,9 @@
 	switch (urb->status) {
 		case 0:			/* success */
 			usbhid->retry_delay = 0;
+			hid_filter_btc9019urf_report(urb->context,
+					urb->transfer_buffer,
+					urb->actual_length);
 			hid_input_report(urb->context, HID_INPUT_REPORT,
 					 urb->transfer_buffer,
 					 urb->actual_length, 1);
